Changing the order payer data
General information
The service allows changing the payer for an already placed order. It is necessary to have full access to the counterparty from the account to appoint them as a new payer (see Available counterparties method, response parameter "info.accessLevel").
To change the recipient for the order and appointing the new recipient as the payer, use Changing the order receiver data method.
To check the possibility of changing the payer, use Checking possibility to change the order method.
Changing the order payer data
Method request
Request example
Method address: https://api.dellin.ru/v3/orders/change_payer.json
{ "appkey":"00000000-0000-0000-0000-000000000000", "sessionID":"00000000-0000-0000-0000-000000000000", "orderID":"00000000", "counteragentUID":"0x8f51001438c4d49511dbd774581edb7a", "docUID": "0x81870050568388af11ea718b63f47df1", "contactIDs":[ 12345678, 78456123 ], "contactPersons":[ { "name":"Иван Иванович" }, { "name":"Петр Петрович" } ], "phoneIDs":[ 98765412, 65478921 ], "phoneNumbers":[ { "number":"79213332211", "ext":"0123" } ], "dataForReceipt":{ "phone":"+79999999999", "email":"test@mail.ru" } }
Method address: https://api.dellin.ru/v3/orders/change_payer.xml
<request> <appkey>00000000-0000-0000-0000-000000000000</appkey> <sessionID>00000000-0000-0000-0000-000000000000</sessionID> <orderID>00000000</orderID> <counteragentUID>0x8f51001438c4d49511dbd774581edb7a</counteragentUID> <docUID>0x81870050568388af11ea718b63f47df1</docUID> <contactIDs>12345678</contactIDs> <contactIDs>78456123</contactIDs> <contactPersons> <name>Иван Иванович</name> </contactPersons> <contactPersons> <name>Петр Петрович</name> </contactPersons> <phoneIDs>98765412</phoneIDs> <phoneIDs>65478921</phoneIDs> <phoneNumbers> <number>79213332211</number> <ext>0123</ext> </phoneNumbers> <dataForReceipt> <phone>+79999999999</phone> <email>test@mail.ru</email> </dataForReceipt> </request>
Description of parameters
Request
Request | |||
---|---|---|---|
Parameter | Required | Type | Description |
appkey | Yes | string | Application key. To get the key, register |
sessionID | Yes | string | Session ID. To get the session ID, use User authorization service |
orderID | Yes | string | The number of the order for which it is necessary to change the payer |
counteragentUID | Yes | string | Counterparty UID (see Available counterparties method) The current account should have full access to the counterparty (see Available counterparties method, response parameter "info.accessLevel") |
docUID | No* | string | Waybill UID. *The parameter is required if several waybill were created for the order |
contactIDs | No* | array of integer | Contact persons IDs from address book. Maximum 3 elements in the array. *One of the following excluding parameters is required: "contactIDs" or "contactPersons" |
contactPersons | No* | array of contactPersons | Contact persons data. Maximum 3 elements in the array. *One of the following excluding parameters is required: "contactIDs" or "contactPersons" |
contactPersons.name | Yes | string | Contact person name |
phoneIDs | No* | array of integer | Phone number IDs from address book. Maximum 3 elements in the array. *One of the following excluding parameters is required: "phoneIDs" or "phoneNumbers" |
phoneNumbers | No* | array of phoneNumbers | Phone numbers list. Maximum 3 elements in the array. *One of the following excluding parameters is required:"phoneIDs" or "phoneNumbers" |
phoneNumbers.number | Yes | string | Phone number. 15 digits maximum |
phoneNumbers.ext | No | string | Extension phone number. 5 digits maximum |
dataForReceipt | No | object | Contact data to send the payment receipt to the individual. The parameter is used only for individuals |
dataForReceipt.phone | No* | string | Phone number for sending the payment receipt, required format: "+79XXXXXXXXX" (where X is any digit). *At least one of the following parameters is required: "dataForReceipt.phone", "dataForReceipt.email" |
dataForReceipt.email | No* | string | Email address for sending the payment receipt. 128 characters maximum *At least one of the following parameters is required: "dataForReceipt.phone", "dataForReceipt.email" |
Method response
Response example
{ "metadata":{ "status":200, "generated_at":"2019-11-18 12:52:26" }, "data":{ "status":"success" } }
<response> <metadata> <status>200</status> <generated_at>2019-11-18 12:52:26</generated_at> </metadata> <data> <status>success</status> </data> </response>
Description of parameters
Response
Response | ||
---|---|---|
Parameter | Type | Description |
metadata | object | System information |
metadata.status | integer | Emulated status http-code. If successful, code 200 is returned. In case of error - 400 |
metadata.generated_at | string | Server response date and time. Format: YYYY-MM-DD HH:MM:SS |
data | object | Success confirmation |
data.status | string | Status in English. Possible value - "success" |
Error handling
Except for common API errors the method response may contain the following errors:
Error number | http-code | Error title | Error description | ||
---|---|---|---|---|---|
Title | Translation | Description | Translation | ||
611001 | 400 | По данному заказу изменение плательщика недоступно | The payer for the order can not be changed | - | - |
611002 | 400 | По данному заказу изменение плательщика недоступно | The payer for the order can not be changed | Изменение по данному заказу недоступно в связи с отсутствием доступа | It is not possible to change the order details since there is no access |
611003 | 400 | Необходимо указать накладную | Please indicate the waybill number | - | - |
611004 | 400 | Данная накладная уже оплачена | The payment on the waybill has been already made | - | - |