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

API
Главная / API - Changing the order receiver data

Changing the order receiver data

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

General information 

The service allows changing the recipient for an already placed order, if necessary appointing the new recipient as the payer for the order, as well as determining who will incur the costs of the paid storage - the sender, the new recipient or a third party.

Only sender or a user with the full access to the sender-counterparty can change the receiver (for more information on full access see "Available counterparties" method, the description of info.accessLevel parameter). To check the possibility of changing the recipient, 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. 

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.

Changing the order receiver data

Method request

Request structure

Method address: https://api.dellin.ru/v3/orders/change_receiver.json 

{
   "appkey":"00000000-0000-0000-0000-000000000000",
   "sessionID":"00000000-0000-0000-0000-000000000000",
   "orderID":"00000000",
   "receiver":{
      "counteragentID":456783515,
      "counteragent":{
         "form":"0x8F51001438C4D49511DBD774581EDB80",
         "document":{
            "type":"passport",
            "serial":"1111",
            "number":"123456"
         },
         "inn":1234567890,
         "name":"Ромашка",
         "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":"test@mail.ru",
      "dataForReceipt":{
         "phone":"+79999999999",
         "email":"test@mail.ru"
      }
   },
   "changeOrderPayer":true,
   "storePayer":"third",
   "third":{
      "counteragentID":456783515,
      "counteragent":{
         "form":"0x8F51001438C4D49511DBD774581EDB80",
         "document":{
            "type":"passport",
            "serial":"1111",
            "number":"123456"
         },
         "inn":1234567890,
         "name":"Ромашка",
         "juridicalAddress":{
            "search":"Новосибирск, Кутузова, 5",
            "street":"5400000100019470000000000",
            "house":"5",
            "building":"2",
            "structure":"3А",
            "flat":"Б-234"
         }
      },
      "contactIDs":[
         12345678,
         78456123
      ],
      "contactPersons":[
         {
            "name":"Иван Иванович"
         },
         {
            "name":"Петр Петрович"
         }
      ],
      "phoneIDs":[
         98765412,
         65478921
      ],
      "phoneNumbers":[
         {
            "number":"79213332211",
            "ext":"0123"
         }
      ],
      "email":"test@mail.ru",
      "dataForReceipt":{
         "phone":"+79999999999",
         "email":"test@mail.ru"
      }
   }
}

Method address: https://api.dellin.ru/v3/orders/change_receiver.xml

<request>
   <appkey>00000000-0000-0000-0000-000000000000</appkey>
   <sessionID>00000000-0000-0000-0000-000000000000</sessionID>
   <orderID>00000000</orderID>
   <receiver>
      <counteragentID>456783515</counteragentID>
      <counteragent>
         <form>0x8F51001438C4D49511DBD774581EDB80</form>
         <document>
            <type>passport</type>
            <serial>1111</serial>
            <number>123456</number>
         </document>
         <inn>1234567890</inn>
         <name>Ромашка</name>
         <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>test@mail.ru</email>
      <dataForReceipt>
         <phone>+79999999999</phone>
         <email>test@mail.ru</email>
      </dataForReceipt>
   </receiver>
   <changeOrderPayer>true</changeOrderPayer>
   <storePayer>third</storePayer>
   <third>
      <counteragentID>456783515</counteragentID>
      <counteragent>
         <form>0x8F51001438C4D49511DBD774581EDB80</form>
         <document>
            <type>passport</type>
            <serial>1111</serial>
            <number>123456</number>
         </document>
         <inn>1234567890</inn>
         <name>Ромашка</name>
         <juridicalAddress>
            <search>Новосибирск, Кутузова, 5</search>
            <street>5400000100019470000000000</street>
            <house>5</house>
            <building>2</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>test@mail.ru</email>
      <dataForReceipt>
         <phone>+79999999999</phone>
         <email>test@mail.ru</email>
      </dataForReceipt>
   </third>
</request>

Description of parameters

Request
Request
ParameterRequiredTypeDescription

appkey

YesstringApplication key. To get the key, register
sessionIDYesstringSession ID. To get the session ID, use "User authorization" service

orderID

YesstringThe number of the order for which it is necessary to change the receiver

receiver

YesMemberNew receiver info

changeOrderPayer

Yesboolean

Flag indicating that the new receiver should be designated as the payer.

Possible values:

  • "true" - change the payer to the new receiver;
  • "false" - do not change the payer

storePayer

Yesstring

Party that incurs the cost of paid storage.

Possible values:

  • "sender";
  • "receiver";
  • "third" - third party. If the parameter is passed in the request, the "third" is required

third

No*Member

Third party info.

*If "storePayer" parameter value is "third" then the parameter "third" is required

Member
Member
ParameterRequiredTypeDescription

counteragentID

No*integer

Counterparty ID from "Address book".

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

counteragent

No*Counteragent

Counterparty info

*One of the following 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 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

YesstringContact person name

phoneIDs

No*array of integers

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

YesstringPhone number. 15 digits maximum

phoneNumbers.ext

NostringExtension phone number. 5 digits maximum

email

NostringOrdering customer email. 128 characters maximum

dataForReceipt

Noobject

Contact data to send the payment receipt to the individual. The parameter is used in the following cases:

  1. The new receiver is an individual and is going to be the payer ("changeOrderPayer" parameter values is "true", individual UID is passed as "receiver.counteragent.form" request parameter value).
  2. The payer that incurs the costs of the paid storage is neither sender, nor receiver ("storePayer" parameter values is "third",  individual UID is passed as "third.counteragent.form" request parameter value).
dataForReceipt.phoneNo*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.emailNo*string

Email address for sending the payment receipt. 128 characters maximum

*At least one of the following parameters is required: "dataForReceipt.phone", "dataForReceipt.email"

Counteragent

Counteragent

ParameterRequiredTypeDescription

form

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

document

No*object

Personal ID data. The parameter is used only for individuals (that is when an individual UID is passed in the "form" parameter). 

*If the counterparty is an individual, the parameter is required

document.type

Yesstring

Document type.

Possible values:

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

document.serial

Yes*string

Document series

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

document.number

Yesstring

Document number. Number format may vary depending on the country

inn

No*integer

TIN (taxpayer identification number). Allowed number of characters may vary depending on country and legal form of organization. The parameter is used for legal entities only (that is when legal entity UID is passed in the "form" parameter). 

*If the counterparty is a legal entity, the parameter is required

name

YesstringIndividual or company name

juridicalAddress

Noobject

Legal address. The parameter is used for legal entities only (that is when legal entity UID is passed in the "form" parameter)

juridicalAddress.search

No (1)string

Address as a string (2).

It is possible to pass address as text.

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

Minimum 2 symbols, maximum 1024

juridicalAddress.street

No (1)string

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

*CLADR - Classifier of Addresses of Russian Federation 

juridicalAddress.house

No (1)string

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

Maximum 7 characters

juridicalAddress.building

Nostring

Building (2).

Maximum 5 characters

juridicalAddress.structure

Nostring

Structure (2).

Maximum 7 characters

juridicalAddress.flat

Nostring

Apartment/office, including the letter. For example, "222 A" (2).

Maximum 5 characters

Notes:

  1. Address information must be passed in the request therefore either "juridicalAddress.search" parameter is required or "juridicalAddress.street" and "juridicalAddress.house" parameters are required.
  2. If "juridicalAddress.search" parameter is passed in the request, then "juridicalAddress.street", "juridicalAddress.house", "juridicalAddress.building" and "juridicalAddress.structure" parameters must not be passed, but "juridicalAddress.flat" parameter may be passed (in this case the value of the "juridicalAddress.flat" parameter will be used as an apartment/office number)

Method response

Response structure

{
   "metadata":{
      "status":200,
      "generated_at":"2019-11-18 12:52:26"
   },
   "data":{
      "status":"success",
      "foundAddresses":[
         {
            "field":"receiver.counteragent.juridicalAddress",
            "source":"Омск, Ленина, 5",
            "result":"Россия, Омская обл, г Омск, ул Ленина, д 5"
         },
         {
            "field":"third.counteragent.juridicalAddress",
            "source":"Новосибирск, Кутузова, 5",
            "result":"Россия, Новосибирская обл, г Новосибирск, ул Кутузова, д 5"
         }
      ]
   }
}
<response>
   <metadata>
      <status>200</status>
      <generated_at>2019-11-18 12:52:26</generated_at>
   </metadata>
   <data>
      <status>success</status>
      <foundAddresses>
         <field>receiver.counteragent.juridicalAddress</field>
         <source>Омск, Ленина, 5</source>
         <result>Россия, Омская обл, г Омск, ул Ленина, д 5</result>
      </foundAddresses>
      <foundAddresses>
         <field>third.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.statusstring

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.foundAddressesarray of FoundAddressesData on found addresses. The parameter is present in the response if "juridicalAddress.search" parameter of the Counteragent 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

610001

400По данному заказу изменение получателя недоступноThe receiver for the order can not be changed--

610002

400По данному заказу изменение получателя недоступноThe receiver for the order can not be changedИзменение по данному заказу недоступно в связи с отсутствием доступаIt is not possible to change the order details since there is no access

610003

400Указан анонимный контрагент"Anonymous" counteragent indicatedДанная операция невозможна для контрагента анонимаThe operation is not available for an "anonymous" counteragent

610014

400Ошибка наложенного платежаCash on delivery errorПолучателем в заказе с наложенным платежом может быть только физическое лицоCash on delivery payment is only possible if the receiver is an individual (not a legal entity)