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

API
Главная / API - Adding delivery to address

Adding delivery to the receiver's address

Обновлено 20.01.2023
184 кб

General information

The service allows ordering the shipping from the Delovye Linii company terminal to the receiver's address on the basis of the existing order for delivery to the company terminal. The order should have one of the following statuses:

  • received;
  • received_warehousing;
  • inway;
  • arrived;
  • warehousing;
  • arrived_to_airport;
  • airport_warehousing.

The service is available to the authorized as well as to the unauthorized users. The authorized users unlike unauthorized users can use the address book data when working with the method.

Adding delivery to the receiver's address

Method request

Request structure

Method address: https://api.dellin.ru/v2/request_delivery.json

{  
   "appkey":"111",
   "sessionID":"00000000-0000-0000-0000-000000000000",
   "docID":"2000000000000",
   "delivery":{
      "arrival":{
         "addressID":457824578,
         "address":{
            "search":"Омск, Ленина, 5",
            "street":"7800000000004380000000000",
            "house":"4",
            "building":"3",
            "structure":"лит.А",
            "flat":"214а"
         },
         "produceDate":"2020-11-30",
         "time":{
            "worktimeStart":"09:00",
            "worktimeEnd":"18:00",
            "exactTime":true,
            "breakStart":"12:30",
            "breakEnd":"13:30"
         },
         "handling":{
            "freightLift":true,
            "toFloor":10,
            "carry":50
         },
         "requirements":[
            "0x9951e0ff97188f6b4b1b153dfde3cfec",
            "0xabb9c63c596b08f94c3664c930e77778"
         ],
         "payer":"third"
      },
      "comment":"комментарий к отправке"
   },
   "members":{
      "receiver":{
         "contactIDs":[
            12345678,
            78456123
         ],
         "contactPersons":[
            {
               "name":"Иван Иванович"
            },
            {
               "name":"Петр Петрович"
            }
         ],
         "phoneIDs":[
            98765412,
            65478921
         ],
         "phoneNumbers":[
            {
               "number":"79213332211",
               "ext":"0123"
            }
         ]
      },
      "third":{
         "counteragentID":456783515,
         "counteragent":{
            "form":"0x8F51001438C4D49511DBD774581EDB80",
            "name":"Ромашка",
            "inn":"1234567890",
            "juridicalAddress":{
               "search":"Омск, Ленина, 5",
               "street":"7800000000004380000000000",
               "house":"4",
               "building":"2",
               "structure":"3А",
               "flat":"Б-234"
            },
            "document":{
               "type":"passport",
               "serial":"0000",
               "number":"123456"
            }
         },
         "contactIDs":[
            12345678,
            78456123
         ],
         "contactPersons":[
            {
               "name":"Иван Иванович"
            },
            {
               "name":"Петр Петрович"
            }
         ],
         "phoneIDs":[
            98765412,
            65478921
         ],
         "phoneNumbers":[
            {
               "number":"79213332211",
               "ext":"0123"
            }
         ],
         "email":"test@mail.ru",
         "dataForReceipt":{
            "send":true,
            "phone":"+79999999999",
            "email":"test@mail.ru"
         }
      }
   },
   "payment":{
      "type":"cash",
      "promocode":"promo123",
      "email":"test@mail.ru",
      "paymentCity":"7800000000000000000000000",
      "paymentCitySearch":{
         "search":"Омск"
      }
   },
   "notify":{
      "phone":"79999999999",
      "email":"test@mail.ru"
   }
}

Method address: https://api.dellin.ru/v2/request_delivery.xml

<request>
   <appkey>111</appkey>
   <sessionID>00000000-0000-0000-0000-000000000000</sessionID>
   <docID>2000000000000</docID>
   <delivery>
      <arrival>
         <addressID>457824578</addressID>
         <address>
            <search>Омск, Ленина, 5</search>
            <street>7800000000004380000000000</street>
            <house>4</house>
            <building>3</building>
            <structure>лит.А</structure>
            <flat>214а</flat>
         </address>
         <produceDate>2020-11-30</produceDate>
         <time>
            <worktimeStart>09:00</worktimeStart>
            <worktimeEnd>18:00</worktimeEnd>
            <exactTime>true</exactTime>
            <breakStart>12:30</breakStart>
            <breakEnd>13:30</breakEnd>
         </time>
         <handling>
            <freightLift>true</freightLift>
            <toFloor>10</toFloor>
            <carry>50</carry>
         </handling>
         <requirements>0x9951e0ff97188f6b4b1b153dfde3cfec</requirements>
         <requirements>0xabb9c63c596b08f94c3664c930e77778</requirements>
         <payer>third</payer>
      </arrival>
      <comment>комментарий к отправке</comment>
   </delivery>
   <members>
      <receiver>
         <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>
      </receiver>
      <third>
         <counteragentID>456783515</counteragentID>
         <counteragent>
            <form>0x8F51001438C4D49511DBD774581EDB80</form>
            <name>Ромашка</name>
            <inn>1234567890</inn>
            <juridicalAddress>
               <search>Омск, Ленина, 5</search>
               <street>7800000000004380000000000</street>
               <house>4</house>
               <building>2</building>
               <structure>3А</structure>
               <flat>Б-234</flat>
            </juridicalAddress>
            <document>
               <type>passport</type>
               <serial>0000</serial>
               <number>123456</number>
            </document>
         </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>test@mail.ru</email>
         <dataForReceipt>
            <send>true</send>
            <phone>+79999999999</phone>
            <email>test@mail.ru</email>
         </dataForReceipt>
      </third>
   </members>
   <payment>
      <type>cash</type>
      <promocode>promo123</promocode>
      <email>test@mail.ru</email>
      <paymentCity>7800000000000000000000000</paymentCity>
      <paymentCitySearch>
         <search>Омск</search>
      </paymentCitySearch>
   </payment>
   <notify>
      <phone>79999999999</phone>
      <email>test@mail.ru</email>
   </notify>
</request>

Description of parameters

Request
Request
ParameterRequiredTypeDescription
appkeyYesstringThe application key. To get the key, register
sessionIDNostring

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

docIDYesstringNumber of order or the waybill 
deliveryYes
objectDelivery details

delivery.arrival

YesArrivalDelivery to the address details
delivery.commentNostring

Comment to the order. Maximum 500 characters

membersYes
object
Shipping parties
members.receiverYesMemberReceiver data
members.thirdNo*MemberThird party data
paymentYes
PaymentPayment data
notifyNoobjectContact data for the notifications
notify.phoneNostring

Phone number.

Format: "7XXXXXXXXXX" (11 digits starting with 7)

notify.emailNostring

Email address

Arrival
Arrival
ParameterRequiredTypeDescription
addressIDNo*integer

Address ID from the "Address book"

*If the user is unauthorized ("sessionID" parameter is not passed in the request), then the parameter is ignored. If the user is authorized ("sessionID" parameter is passed in the request), then one of the excluding parameters is required: "addressID" or "address"
addressNo*Address

Address data

*If the user is unauthorized, then the parameter is required. If the user is authorized, then one of the excluding parameters is required: "addressID" or "address"
produceDateYesstring

Date of handover of the cargo to the receiver at his address.

Format: YYYY-MM-DD

To get the list of dates for which the delivery to the receiver's address can be scheduled use "Delivery dates" method

timeYesobject

Information on delivery time

time.worktimeStartYesstring

Period start.

Format: HH:MM

time.worktimeEndYesstring

Period end.

Format: HH:MM

time.exactTimeNoboolean

Delivery at the exact time.

Default value: "false"

time.breakStartNostring

Break start.

Format: HH:MM

time.breakEndNostring

Break end.

Format: HH:MM

handlingNoobjectLoading and unloading works at the address
handling.freightLiftNoboolean

Flag indicating that there is a service lift.

Default value: "false"

handling.toFloorNointeger

Number of the floor to which the cargo is to be lifted.

Maximum number of characters - 5

handling.carryNointeger

Distance to which the cargo is to be carried, m.

Maximum number of characters - 5

requirementsNoarray of string

Array of UID's of special requirements to the truck from the "Directory of special transport requirements" and from the "Directory of vehicle loading types".

Special requirements include type of truck loading (side, rear, etc.) and other requirements: crane, removable curtains, etc.

payerYesstring

Payer role.

Possible values:

  • "sender";
  • "receiver";
  • "third" - third party

Address
Address
ParameterRequiredTypeDescription

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

Мaximum 1024 symbols (2)

streetNo (1)string

CLADR* code of the street (see. "CLADR search") (2).

*CLADR - Classifier of Addresses of Russian Federation 

houseNo (1)string

House number, including the letter. For example, "13/A" (2).

Maximum number of characters - 7

buildingNo
string

Building (2).

Maximum number of characters - 5

structureNo
string

Structure (2).

Maximum number of characters - 7

flatNo
string

Apartment/office, including the letter. For example, "222 A" (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" and "structure" parameters must not be passed, but "flat" parameter may be passed (in this case the value of the "flat" parameter will be used as an apartment/office number)

Member
Member
ParameterRequiredTypeDescription
counteragentIDNo*integer

Counterparty ID from the "Address book".

*The parameter is used for "request.member.third" object only. If the user is unauthorized, then parameter is ignored. For authorized users one of the excluding parameters is required: "counteragentID" or "counteragent"
counteragentNo*Counteragent

Counterparty as a set of parameters.

*The parameter is used for "request.member.third" object only. The parameter is required for unauthorized users.  For authorized users 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

*If the user is unauthorized, then parameter is ignored. For authorized users one of the excluding parameters is required: "contactID" or "contactPersons"
contactPersonsNo*array of ContactPersons

Contact persons data.

Maximum 3 elements in the array for authorized users, 1 - for unauthorized

*The parameter is required for unauthorized users.  For authorized users one of the excluding parameters is required: "contactID" or "contactPersons"
contactPersons.nameYesstringName of contact person
phoneIDsNo*array of integers

Phone number IDs from "Address book".

Maximum 3 elements in the array

*If the user is unauthorized, then parameter is ignored. For authorized users one of the excluding parameters is required: "phoneID" or "phoneNumbers"
phoneNumbersNo*array of PhoneNumbers

Phone numbers list.

Maximum 3 elements in the array for authorized users, 1 - for unauthorized

*The parameter is required for unauthorized users.  For authorized users one of the excluding parameters is required: "phoneID" 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 of the order requester

The parameter is used for "request.member.third" object only
dataForReceiptNo*object

Contact information for sending an electronic payment receipt to the payer that is a physical party

*The parameter is used for "request.member.third" object only. The parameter is required for a physical party, that is if UID of a physical party is passed as a value of "form" parameter of the "Counteragent" class of the current request or while creating a counterparty with the help of "Counterparties adding and editing" method 
dataForReceipt.sendYesboolean

Flag indicating consent to receive an electronic payment receipt

dataForReceipt.phoneNo*string

Phone number for sending the payment receipt, required format: "+79XXXXXXXXX" (where X is any digit).

*If "dataForReceipt.send" parameter value is "true", then at least one of the following parameters is required: "dataForReceipt.phone", "dataForReceipt.email"
dataForReceipt.emailNo*string

Email address for sending the payment receipt

*If "dataForReceipt.send" parameter value is "true", then at least one of the following parameters is required: "dataForReceipt.phone", "dataForReceipt.email"

Counteragent
Counteragent
ParameterRequiredTypeDescription
formYesinteger

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

nameYesstringIndividual or company name
innNo*string

TIN (taxpayer identification number). Allowed number of characters may vary depending on country and legal form of organization

*The parameter is required if the counterparty is a legal entity (that is when legal entity UID is passed in the "form" parameter), if counterparty is a physical entity (physical entity UID is passed in the "form" parameter), then the parameter is ignored
juridicalAddressNoAddress

Legal address. The parameter is used for legal entities only

documentNo*object

Personal ID data

*The parameter is required if the counterparty is an individual
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

Payment
Payment
ParameterRequiredTypeDescription

type

Yesstring

Payment type (1).

Available values:

  • "cash" - by cash or credit card;
  • "noncash" - by bank transfer
promocodeNostringPromo code
emailNostringEmail to send an invoice. The parameter is used only in case of payment by the bank transfer (that is if "type" parameter value is "noncash")
paymentCityNo*string

CLADR code of the city of payment (1). It's possible to get CLADR code using the services listed on the "Using CLADR codes" page 

(CLADR - Classifier of Addresses of Russian Federation)

*If payer is a third party  ("delivery.arrival.payer" parameter value is "third"), then one of the excluding parameters - "paymentCity" or "paymentCitySearch" is required, in other cases the parameter is ignored
paymentCitySearchNo*object

City of payment as a string (1)

*If payer is a third party  ("delivery.arrival.payer" parameter value is "third"), then one of the excluding parameters - "paymentCity" or "paymentCitySearch" is required, in other cases the parameter is ignored

paymentCitySearch.search

Yesstring

City as a string. Мaximum 1024 symbols. Along with the name of the city it is possible to pass the name of the country, region or district - this will allow refining the search and eliminating errors that may occur since the cities can have the identical names

Notes:

  1. In some locations it is not possible to pay by cash/credit card ("type" parameter value is "cash"), it is only possible to pay by bank transfer ("type" parameter value is "noncash"). By passing one of the mutually exclusive parameters - "paymentCity" or "paymentCitySearch", it is possible to make sure that the selected form of payment is available in the location. In addition, the list of locations where it is only possible to pay by bank transfer can be found in the "Directory of locations with wire transfer payment"

Method response

Response structure

{  
   "metadata":{
      "status":200,
      "generatedAt":"2020-11-03 12:37:28"
   },
   "data":{
      "state":"success",
      "requestID":3954004,
      "information":[
         "Промокод нельзя применить в заказе"
      ],
      "foundAddresses":[
         {
            "field":"delivery.arrival.address",
            "source":"Омск, Ленина, 5",
            "result":"Россия, Омская обл, г Омск, ул Ленина, д 5"
         },
         {
            "field":"members.third.counteragent.juridicalAddress",
            "source":"Омск, Ленина, 5",
            "result":"Россия, Омская обл, г Омск, ул Ленина, д 5"
         },
         {
            "field":"payment.paymentCitySearch",
            "source":"Омск",
            "result":"Россия, Омская обл, г Омск"
         }
      ]
   }
}
<response>
   <metadata>
      <status>200</status>
      <generatedAt>2020-11-03 12:37:28</generatedAt>
   </metadata>
   <data>
      <state>success</state>
      <requestID>3954004</requestID>
      <information>Промокод нельзя применить в заказе</information>
      <foundAddresses>
         <field>delivery.arrival.address</field>
         <source>Омск, Ленина, 5</source>
         <result>Россия, Омская обл, г Омск, ул Ленина, д 5</result>
      </foundAddresses>
      <foundAddresses>
         <field>members.third.counteragent.juridicalAddress</field>
         <source>Омск, Ленина, 5</source>
         <result>Россия, Омская обл, г Омск, ул Ленина, д 5</result>
      </foundAddresses>
      <foundAddresses>
         <field>payment.paymentCitySearch</field>
         <source>Омск</source>
         <result>Россия, Омская обл, г Омск</result>
      </foundAddresses>
   </data>
</response>

Description of parameters

Response
Response
ParameterTypeDescription
metadataobjectSystem information
metadata.statusinteger

Emulated http-code of status. If successful, code 200 is returned

metadata.generatedAtstring

Server response date and time.

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

dataobject

Information about the order

data.statestringStatus. Possible value - "success"
data.requestIDintegerNumber of the created order
data.informationarray of strings

Info message stating that it is impossible to apply the passed promo code for some reason.

Possible values:

  • "Промокода не существует" - promo code does not exist
  • "Превышено максимальное количество раз использования промокода" - maximum number of times the promo code can be used has been exceeded
  • "Срок действия промокода истек" - promo code has expired
  • "Промокод нельзя применить в заказе" - promo code cannot be applied to the order
data.foundAddressesarray of FoundAddressesData on found addresses/cities. The parameter is present in the response if "search" parameter of the "Address" class or "paymentCitySearch.search" parameter was passed in the request

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

Entered value

resultstring

Address/city found

Error handling

The common API errors are used with the method, for errors format description and errors list see Errors of API methods.