Поиск по сайту

API
Главная / API - Changing the delivery address/time

Changing the delivery address/time

Обновлено 08.09.2021
197 кб

General information 

The service allows changing the delivery terminal (if shipping to the terminal was initially ordered) or address 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 check the possibility of changing, use "Checking possibility to change the order" method, to check the change request status - "Change history" method.

Changing the delivery address and time

Method request

Request example

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
ParameterRequiredTypeDescription  

appkey

YesstringApplication key. To get the key, register

sessionID

Yesstring

To get the session ID, use the "User Authorization" method

orderID

Yesstring

The number of the order for which it is necessary to change the delivery address and time

deliveryYesobjectDelivery parameters
delivery.arrivalYesArrivalDelivery to the address
storePayerNo*string

Party that incurs the cost of paid storage (1).

Possible values:

  • "sender";
  • "receiver";
  • "payer" - the third party that was indicated as a payer when the order was placed;
  • "third" - third party. If the value is passed then "members.storeThird" parameter is required
*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
membersYesobjectShipping parties
members.requesterYesRequesterThe party initiating changes to order details
members.receiverNoMember

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.thirdNo*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.storeThirdNo*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:

  1. The storage of the arrived cargo is free of charge for the first two business days, starting from the third day it is necessary to pay for the cargo storage. For more information on conditions and prices see Delovye Linii company website.

Arrival
Arrival
ParameterRequiredTypeDescription

produceDate

No*string

Date of forwarding driver arrival to the receiver.

Format: YYYY-MM-DD

*If delivery to the receiver's address is ordered ("variant" parameter value is "address"), then parameter is required

variant

Yesstring

Shipping method.

Possible:

  • "terminal" - shipping to the terminal;
  • "address" - shipping to the address

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

*One of the excluding parameters is required: "terminalID", "addressID", "address", "city"
addressIDNo*integer

Address ID from the "Address book"

*One of the excluding parameters is required: "terminalID", "addressID", "address", "city"
addressNo*Address

Address

*One of the excluding parameters is required: "terminalID", "addressID", "address", "city"
cityNo*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

*One of the excluding parameters is required: "terminalID", "addressID", "address", "city"
timeNo*object

Time of cargo delivery to the address

*If delivery to the receiver's address is ordered ("variant" parameter value is "address"), then parameter is required
time.worktimeStartYesstring

Period start.

Format: HH:MM

time.worktimeEndYesstring

Period end.

Format: HH:MM

time.breakStartNostring

Period end.

Format: HH:MM

time.breakEndNostring

Break end.

Format: HH:MM

time.exactTimeNoboolean

Delivery at the exact time.

Default value: "false"

payerNostring

Payer who incurs the cost of cargo delivery/redirection

Possible values:

  • "sender";
  • "receiver";
  • "payer" - the third party that was indicated as a payer when the order was placed;
  • "third" - new third party. If the value is passed then "members.third" parameter is required
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
ParameterRequiredTypeDescription

search

No (1)stringAddress as a string. Maximum 1024 symbols. Along with the address it is necessary to pass the name of the city (2)
streetNo (1)string

CLADR code of the street. It's possible to get CLADR code using the services presented on the page "CLADR search" (2)

houseNo (1)string

House (2).

Maximum number of characters - 7

buildingNostring

Building (2).

Maximum number of characters - 5

structureNostring

Structure (2).

Maximum number of characters - 7

flatNostring

Apartment/office (2).

Maximum number of characters - 5

Notes:

  1. Address information must be passed in the request therefore either "search" parameter is required or "street" and "house" parameters are required.
  2. If "search" parameter is passed in the request, then "street", "house", "building", "structure" or "flat" parameters must not be passed in the request

Requester
Requester
ParameterRequiredTypeDescription

role

Yesstring

Requester role.

Possible values:

  • "sender";
  • "receiver";
  • "customer" -  the third party that was indicated as a payer when the order was placed

Member
Member
ParameterRequiredTypeDescription
counteragentIDNo*integer

Counterparty ID from "Address book"

*One of the excluding parameters is required: "counteragentID" or "counteragent"
counteragentNo*Counteragent

Counterparty as a set of parameters

*One of the excluding parameters is required: "counteragentID" or "counteragent"
contactIDsNo*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"
contactPersonsNo*array of ContactPersons

Contact persons data.

Maximum 3 elements in the array

*One of the excluding parameters is required: "contactID" or "contactPersons"
contactPersons.nameYesstringContact person name
phoneIDsNo*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"
phoneNumbersNo*array of PhoneNumbers

Phone numbers list.

Maximum 3 elements in the array

*One of the excluding parameters is required: "phoneIDs" or "phoneNumbers"
phoneNumbers.numberYesstring

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.extNostring

Extension phone number.

5 digits maximum

emailNostring

Email for sending notifications to the participants of transportation

dataForReceiptNo*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.sendYesboolean

Consent to receive an electronic payment receipt. Possible values:

  • "true" - user passed "phone" and/or "email" to send payment receipt;
  • "false" - user refused to provide contact information to send payment receipt
dataForReceipt.phoneNo*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.emailNo*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
ParameterRequiredTypeDescription
formYesstring

UID of legal form of organization, see "Search of forms of organization"

nameYesstringIndividual or company name
documentNo*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.typeYesstring

Document type.

Possible values:

  • "passport";
  • "drivingLicence";
  • "foreignPassport" - international passport. For some countries "foreignPassport" value is not available
document.serialYes*string

Document series

*For some countries the parameter is not required and therefore ignored

document.numberYesstring

Document number.

Number format may vary depending on the country

innNo*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
juridicalAddressNoAddress

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 example

{
   "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
ParameterTypeDescription
metadataobjectSystem information
metadata.statusinteger

Emulated status http-code. If successful, code 200 is returned. In case of error - 400

metadata.generated_atstring

Server response date and time.

Format: YYYY-MM-DD HH:MM:SS

dataobjectSuccess confirmation
data.statestring

Status in English. Possible value - "success"

data.informationstringInformation on conditions when the delivery address and time can be changed free of charge
data.foundAddressesarray of FoundAddressesData on found addresses. The parameter is present in the response if "search" parameter of the "Address" class was passed in the request

FoundAddresses
FoundAddresses
ParameterTypeDescription
fieldstringThe parent object that was used to pass the "search" parameter
sourcestring

Entered value

resultstring

Address found

Error handling

Except for common API errors the method response may contain the following errors:

Error numberhttp-codeError titleError description
TitleTranslationDescriptionTranslation

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)