Changing the delivery address/time
General information
The service allows changing the delivery terminal (if shipping to the terminal was initially ordered) or address, date and time (in case shipping to the address was ordered) as well as indicating new receiver and/or payer who incurs the cost of cargo delivery/redirection. To change the delivery address, date and time full access to sender, receiver or payer is required, however the change of destination city is available only to the user with the full access to the sender (for more information on full access see "Available counterparties" method, the description of info.accessLevel parameter). To check the possibility of changing, use "Checking possibility to change the order" method. The changes do not come into effect immediately. After further verification the request can be approved or declined. To check the change request status use "Change history" method.
Changing the delivery address and time
Method request
Request structure
Method address: https://api.dellin.ru/v3/orders/change_delivery.json
{ "appkey":"00000000-0000-0000-0000-000000000000", "sessionID":"00000000-0000-0000-0000-000000000000", "orderID":"00000000", "delivery":{ "arrival":{ "produceDate":"2020-04-10", "variant":"terminal", "terminalID":123, "addressID":"457824578", "address":{ "search":"Омск, Ленина, 5", "street":"5500000100005970000000000", "house":"5", "building":"1", "structure":"3А", "flat":"Б-234" }, "city":"5500000100000000000000000", "time":{ "worktimeStart":"09:00", "worktimeEnd":"18:00", "breakStart":"12:30", "breakEnd":"13:30", "exactTime":true }, "payer":"receiver" } }, "storePayer":"third", "members":{ "requester":{ "role":"sender" }, "receiver":{ "counteragentID":456783515, "counteragent":{ "form":"0x8F51001438C4D49511DBD774581EDB80", "name":"Ромашка", "document":{ "type":"passport", "serial":"0000", "number":"123456" }, "inn":1234567890, "juridicalAddress":{ "search":"Омск, Ленина, 5", "street":"5500000100005970000000000", "house":"5", "building":"1", "structure":"3А", "flat":"Б-234" } }, "contactIDs":[ 12345678, 78456123 ], "contactPersons":[ { "name":"Иван Иванович" }, { "name":"Петр Петрович" } ], "phoneIDs":[ 98765412, 65478921 ], "phoneNumbers":[ { "number":"79213332211", "ext":"0123" } ], "email":"testSender@mail.ru", "dataForReceipt":{ "send":true, "phone":"+79999999999", "email":"test@mail.ru" } }, "third":{ "counteragentID":456783515, "counteragent":{ "form":"0x8F51001438C4D49511DBD774581EDB80", "name":"Ромашка", "document":{ "type":"passport", "serial":"0000", "number":"123456" }, "inn":1234567890, "juridicalAddress":{ "search":"Омск, Ленина, 5", "street":"5500000100005970000000000", "house":"5", "building":"1", "structure":"3А", "flat":"Б-234" } }, "contactIDs":[ 12345678, 78456123 ], "contactPersons":[ { "name":"Иван Иванович" }, { "name":"Петр Петрович" } ], "phoneIDs":[ 98765412, 65478921 ], "phoneNumbers":[ { "number":"79213332211", "ext":"0123" } ], "email":"testSender@mail.ru", "dataForReceipt":{ "send":true, "phone":"+79999999999", "email":"test@mail.ru" } }, "storeThird":{ "counteragentID":456783515, "counteragent":{ "form":"0x8F51001438C4D49511DBD774581EDB80", "name":"Ромашка", "document":{ "type":"passport", "serial":"0000", "number":"123456" }, "inn":1234567890, "juridicalAddress":{ "search":"Омск, Ленина, 5", "street":"5500000100005970000000000", "house":"5", "building":"1", "structure":"3А", "flat":"Б-234" } }, "contactIDs":[ 12345678, 78456123 ], "contactPersons":[ { "name":"Иван Иванович" }, { "name":"Петр Петрович" } ], "phoneIDs":[ 98765412, 65478921 ], "phoneNumbers":[ { "number":"79213332211", "ext":"0123" } ], "email":"testSender@mail.ru", "dataForReceipt":{ "send":true, "phone":"+79999999999", "email":"test@mail.ru" } } } }
Method address: https://api.dellin.ru/v3/orders/change_delivery.xml
<request> <appkey>00000000-0000-0000-0000-000000000000</appkey> <sessionID>00000000-0000-0000-0000-000000000000</sessionID> <orderID>00000000</orderID> <delivery> <arrival> <produceDate>2020-04-10</produceDate> <variant>terminal</variant> <terminalID>123</terminalID> <addressID>457824578</addressID> <address> <search>Омск, Ленина, 5</search> <street>5500000100005970000000000</street> <house>5</house> <building>1</building> <structure>3А</structure> <flat>Б-234</flat> </address> <city>5500000100000000000000000</city> <time> <worktimeStart>09:00</worktimeStart> <worktimeEnd>18:00</worktimeEnd> <breakStart>12:30</breakStart> <breakEnd>13:30</breakEnd> <exactTime>true</exactTime> </time> <payer>receiver</payer> </arrival> </delivery> <storePayer>third</storePayer> <members> <requester> <role>sender</role> </requester> <receiver> <counteragentID>456783515</counteragentID> <counteragent> <form>0x8F51001438C4D49511DBD774581EDB80</form> <name>Ромашка</name> <document> <type>passport</type> <serial>0000</serial> <number>123456</number> </document> <inn>1234567890</inn> <juridicalAddress> <search>Омск, Ленина, 5</search> <street>5500000100005970000000000</street> <house>5</house> <building>1</building> <structure>3А</structure> <flat>Б-234</flat> </juridicalAddress> </counteragent> <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> <email>testSender@mail.ru</email> <dataForReceipt> <send>true</send> <phone>+79999999999</phone> <email>test@mail.ru</email> </dataForReceipt> </receiver> <third> <counteragentID>456783515</counteragentID> <counteragent> <form>0x8F51001438C4D49511DBD774581EDB80</form> <name>Ромашка</name> <document> <type>passport</type> <serial>0000</serial> <number>123456</number> </document> <inn>1234567890</inn> <juridicalAddress> <search>Омск, Ленина, 5</search> <street>5500000100005970000000000</street> <house>5</house> <building>1</building> <structure>3А</structure> <flat>Б-234</flat> </juridicalAddress> </counteragent> <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> <email>testSender@mail.ru</email> <dataForReceipt> <send>true</send> <phone>+79999999999</phone> <email>test@mail.ru</email> </dataForReceipt> </third> <storeThird> <counteragentID>456783515</counteragentID> <counteragent> <form>0x8F51001438C4D49511DBD774581EDB80</form> <name>Ромашка</name> <document> <type>passport</type> <serial>0000</serial> <number>123456</number> </document> <inn>1234567890</inn> <juridicalAddress> <search>Омск, Ленина, 5</search> <street>5500000100005970000000000</street> <house>5</house> <building>1</building> <structure>3А</structure> <flat>Б-234</flat> </juridicalAddress> </counteragent> <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> <email>testSender@mail.ru</email> <dataForReceipt> <send>true</send> <phone>+79999999999</phone> <email>test@mail.ru</email> </dataForReceipt> </storeThird> </members> </request>
Description of parameters
Request
Request | |||
---|---|---|---|
Parameter | Required | Type | Description |
appkey | Yes | string | Application key. To get the key, register |
sessionID | Yes | string | To get the session ID, use the "User Authorization" method |
orderID | Yes | string | The number of the order for which it is necessary to change the delivery address and time |
delivery | Yes | object | Delivery parameters |
delivery.arrival | Yes | Arrival | Delivery to the address |
storePayer | No* | string | Party that incurs the cost of paid storage (1). Possible values:
*It is only possible to pass the parameter if changes to the order details are initiated by the sender. In this case the parameter is required |
members | Yes | object | Shipping parties |
members.requester | Yes | Requester | The party initiating changes to order details |
members.receiver | No | Member | New receiver. The parameter should not be passed if the receiver stays the same It is not possible to change the receiver if changes to the order details are initiated by the receiver (that is "members.requester.role" parameter value is "receiver") |
members.third | No* | Member | New payer who incurs the cost of cargo delivery/redirection. The parameter should not be passed if the payer stays the same *Parameter is required if the new payer who incurs the cost of cargo delivery/redirection is the third party (that is "members.requester.role" parameter value is "sender") |
members.storeThird | No* | Member | Third party that incurs the cost of paid storage (1). *The parameter is required if the costs of paid storage are incurred by the third party (that is "storePayer" parameter value is "sender") |
Notes:
|
Arrival
Arrival | |||
---|---|---|---|
Parameter | Required | Type | Description |
produceDate | No* | string | Date of forwarding driver arrival to the receiver. Format: YYYY-MM-DD *At least one of the parameters is required: "produceDate", "time", "variant" |
variant | No* | string | Shipping method. Possible:
*If it is necessary to specify a new terminal/delivery address, then the parameter is required. *At least one of the parameters is required: "produceDate", "time", "variant" |
terminalID | No* | integer | Terminal ID from the "Terminals directory". It is only possible to choose a pick-up point or a default terminal in this case (in "Terminals directory" "city.terminals.terminal.isPVZ" or "city.terminals.terminal.default" parameter value should be "true") If delivery to the receiver's address is ordered ("variant" parameter value is "address"), then parameter is ignored *If the parameter "variant" is passed, than one of the excluding parameters is required: "terminalID", "addressID", "address", "city" |
addressID | No* | integer | Address ID from the "Address book" *If the parameter "variant" is passed, than one of the excluding parameters is required: "terminalID", "addressID", "address", "city" |
address | No* | Address | Address *If the parameter "variant" is passed, than one of the excluding parameters is required: "terminalID", "addressID", "address", "city" |
city | No* | string | CLADR code of the city. It's possible to get CLADR code using the services presented on the page "CLADR search". If the parameter is passed the arrival terminal is determined automatically. If delivery to the receiver's address is ordered ("variant" parameter value is "address"), then parameter is ignored *If the parameter "variant" is passed, than one of the excluding parameters is required: "terminalID", "addressID", "address", "city" |
time | No* | object | Time of cargo delivery to the address *At least one of the parameters is required: "produceDate", "time", "variant" |
time.worktimeStart | Yes | string | Period start. Format: HH:MM |
time.worktimeEnd | Yes | string | Period end. Format: HH:MM |
time.breakStart | No | string | Period end. Format: HH:MM |
time.breakEnd | No | string | Break end. Format: HH:MM |
time.exactTime | No | boolean | Delivery at the exact time. Default value: "false" |
payer | No | string | Payer who incurs the cost of cargo delivery/redirection Possible values:
It is only possible to pass the parameter if changes to the order details are initiated by the sender (that is "members.requester.role" parameter value is "sender") |
Address
Address | |||
---|---|---|---|
Parameter | Required | Type | Description |
search | No (1) | string | Address as a string. It is possible to pass address as text or as coordintaes. The coordinates should not be used to pass the information about the juridical address, that is in blocks "juridicalAddress" of class "Counteragent". When passing address as a text along with the address it is necessary to pass the name of the city, the address elements should be separated by comma, for example "Омск, Ленина, 5". The coordinates should be separated by comma as well, the first number - latitude "59.924501, 30.241762". Maximum 1024 symbols (2) |
street | No (1) | string | CLADR code of the street. It's possible to get CLADR code using the services presented on the page "CLADR search" (2) |
house | No (1) | string | House (2). Maximum number of characters - 7 |
building | No | string | Building (2). Maximum number of characters - 5 |
structure | No | string | Structure (2). Maximum number of characters - 7 |
flat | No | string | Apartment/office (2). Maximum number of characters - 5 |
Notes:
|
Requester
Requester | |||
---|---|---|---|
Parameter | Required | Type | Description |
role | Yes | string | Requester role. Possible values:
|
Member
Member | |||
---|---|---|---|
Parameter | Required | Type | Description |
counteragentID | No* | integer | Counterparty ID from "Address book" *One of the excluding parameters is required: "counteragentID" or "counteragent" |
counteragent | No* | Counteragent | Counterparty as a set of parameters *One of the excluding parameters is required: "counteragentID" or "counteragent" |
contactIDs | No* | array of integers | Contact persons IDs from "Address book". Maximum 3 elements in the array *One of the excluding parameters is required: "contactID" or "contactPersons" |
contactPersons | No* | array of ContactPersons | Contact persons data. Maximum 3 elements in the array *One of the excluding parameters is required: "contactID" or "contactPersons" |
contactPersons.name | Yes | string | Contact person name |
phoneIDs | No* | array of integers | Phone number IDs from "Address book". Maximum 3 elements in the array *One of the excluding parameters is required: "phoneIDs" or "phoneNumbers" |
phoneNumbers | No* | array of PhoneNumbers | Phone numbers list. Maximum 3 elements in the array *One of the excluding parameters is required: "phoneIDs" or "phoneNumbers" |
phoneNumbers.number | Yes | string | Phone number. Only digits and plus sign are allowed (plus can only be passed at the beginning of the string that starts with 7 or 375) |
phoneNumbers.ext | No | string | Extension phone number. 5 digits maximum |
No | string | Email for sending notifications to the participants of transportation | |
dataForReceipt | No* | object | Contact information for sending an electronic payment receipt to the payer that is an individual *If the counterparty is an individual, the parameter is required. If the counterparty is a legal entity, the parameter is ignored |
dataForReceipt.send | Yes | boolean | Consent to receive an electronic payment receipt. Possible values:
|
dataForReceipt.phone | No* | string | Phone number to send payment receipt. Format: "+79XXXXXXXXX" (12 figures, starts with "+79" and then 9 digits) *If "send" parameter value is "true", then at least one of the parameters is required: "phone" or "email". If "send" parameter value is "false", then parameter is ignored |
dataForReceipt.email | No* | string | Email to send payment receipt *If "send" parameter value is "true", then at least one of the parameters is required: "phone" or "email". If "send" parameter value is "false", then parameter is ignored |
Counteragent
Counteragent | |||
---|---|---|---|
Parameter | Required | Type | Description |
form | Yes | string | UID of legal form of organization, see "Search of forms of organization" |
name | Yes | string | Individual or company name |
document | No* | object | Personal ID data *If the counterparty is an individual, the parameter is required. If the counterparty is a legal entity, the parameter is ignored |
document.type | Yes | string | Document type. Possible values:
|
document.serial | Yes* | string | Document series *For some countries the parameter is not required and therefore ignored |
document.number | Yes | string | Document number. Number format may vary depending on the country |
inn | No* | string | TIN (taxpayer identification number). Allowed number of characters may vary depending on country and legal form of organization *If the counterparty is a legal entity, the parameter is required. If the counterparty is an individual, the parameter is ignored |
juridicalAddress | No | Address | Legal address. The parameter is used for legal entities only (that is when legal entity UID is passed in the "form" parameter) |
Method response
Response structure
{ "metadata":{ "status":200, "generated_at":"2019-11-18 12:52:26" }, "data":{ "state":"success", "information": [ "Смена адреса и времени доставки груза будет бесплатной при подаче запроса до 17:00 (по местному времени)." ], "foundAddresses": [ { "field": "delivery.arrival.address", "source": "Омск, Ленина, 5", "result": "Россия, Омская обл, г Омск, ул Ленина, д 5" }, { "field": "members.receiver.counteragent.juridicalAddress", "source": "Омск, Ленина, 5", "result": "Россия, Омская обл, г Омск, ул Ленина, д 5" }, { "field": "members.third.counteragent.juridicalAddress", "source": "Омск, Ленина, 5", "result": "Россия, Омская обл, г Омск, ул Ленина, д 5" }, { "field": "members.storeThird.counteragent.juridicalAddress", "source": "Омск, Ленина, 5", "result": "Россия, Омская обл, г Омск, ул Ленина, д 5" } ] } }
<response> <metadata> <status>200</status> <generated_at>2019-11-18 12:52:26</generated_at> </metadata> <data> <state>success</state> <information>Смена адреса и времени доставки груза будет бесплатной при подаче запроса до 17:00 (по местному времени).</information> <foundAddresses> <field>delivery.arrival.address</field> <source>Омск, Ленина, 5</source> <result>Россия, Омская обл, г Омск, ул Ленина, д 5</result> </foundAddresses> <foundAddresses> <field>members.receiver.counteragent.juridicalAddress</field> <source>Омск, Ленина, 5</source> <result>Россия, Омская обл, г Омск, ул Ленина, д 5</result> </foundAddresses> <foundAddresses> <field>members.third.counteragent.juridicalAddress</field> <source>Омск, Ленина, 5</source> <result>Россия, Омская обл, г Омск, ул Ленина, д 5</result> </foundAddresses> <foundAddresses> <field>members.storeThird.counteragent.juridicalAddress</field> <source>Омск, Ленина, 5</source> <result>Россия, Омская обл, г Омск, ул Ленина, д 5</result> </foundAddresses> </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.state | string | Status in English. Possible value - "success" "Success" status indicates that the request was accepted. After further verification the request can be approved or declined. To check the change request status use "Change history" method |
data.information | array of strings | Information on conditions when the delivery address and time can be changed free of charge |
data.foundAddresses | array of FoundAddresses | Data on found addresses. The parameter is present in the response if "search" parameter of the "Address" class was passed in the request |
FoundAddresses
FoundAddresses | ||
---|---|---|
Parameter | Type | Description |
field | string | The parent object that was used to pass the "search" parameter |
source | string | Entered value |
result | string | Address found |
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 | ||
621001 | 400 | По данному заказу изменение адреса и времени недоступно | The dispatch address and time for the order can not be changed | - | - |
621002 | 400 | По данному заказу изменение адреса и времени недоступно | The dispatch address and time for the order can not be changed | Изменение по данному заказу недоступно в связи с отсутствием доступа | It is not possible to change the order details since there is no access |
622003 | 400 | Указанная роль заказчика для данного заказа недоступна | The specified requester role is not allowable for the order | - | - |
622004 | 400 | Нет доступа к контрагенту заказа | No access to the counterparty | - | - |
622005 | 400 | Невозможно оформить доставку до терминала | It's not possible to order delivery to the terminal | - | - |
622006 | 400 | Невозможно оформить доставку до адреса | It's not possible to order delivery to the address | - | - |
622007 | 400 | По данному заказу изменение получателя недоступно | The receiver for the order can not be changed | - | - |
622008 | 400 | По данному заказу изменение плательщика недоступно | The payer for the order can not be changed | - | - |
622014 | 400 | Ошибка наложенного платежа | Cash on delivery error | Получателем в заказе с наложенным платежом может быть только физическое лицо | Cash on delivery payment is only possible if the receiver is an individual (not a legal entity) |