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

API
Главная / API - Order status history

Order status history

Обновлено 16.03.2023
111 кб

General information

The service allows getting a history of order status changes. The service is available to both authorized and unauthorized users.

Order status history

Method request

Request structure

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

{
   "appkey":"00000000-0000-0000-0000-000000000000",
   "docIds":[
      "400267443",
      "400267444"
   ],
   "webOrderNumber":"935743976"
}

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

<request>
   <appkey>00000000-0000-0000-0000-000000000000</appkey>
   <docIds>400267443</docIds>
   <docIds>400267444</docIds>
   <webOrderNumber>935743976</webOrderNumber>
</request>

Description of parameters

Request
Request
ParameterRequiredTypeDescription
appkeyYesstringApplication key. To get the key, register

docIds

No*array of strings

Number of order, waybill or order for shipping from address/delivery to address. More than one parameter can be passed (5 parameters maximum).

*Only one of the following parameters must be passed in a request: docIds, webOrderNumber

webOrderNumber

No*string

Online store order number (internal order number).

*Only one of the following parameters must be passed in a request: docIds, webOrderNumber

Method respose

Response structure

{
   "metadata":{
      "status":200,
      "generated_at":"2023-01-26 15:06:51"
   },
   "data":{
      "statusHistory":{
         "400267443":[
            {
               "number":"400267443",
               "state":"waiting",
               "stateName":"Ожидает сдачи на терминал",
               "stateDate":"2023-01-12T15:52:40.000+03:00",
               "detailedStatus":"waiting",
               "detailedStatusRus":null,
               "detailedStatusDate":"2023-01-12T15:52:40.000+03:00"
            },
            {
               "number":"400267443",
               "state":"inway",
               "stateName":"Груз в пути",
               "stateDate":"2023-01-25T11:10:44.000+03:00",
               "detailedStatus":"inway",
               "detailedStatusRus":null,
               "detailedStatusDate":"2023-01-25T11:10:44.000+03:00"
            },
            {
               "number":"400267443",
               "state":"arrived_to_airport",
               "stateName":"Груз прибыл в аэропорт",
               "stateDate":"2023-01-25T11:12:03.000+03:00",
               "detailedStatus":"arrived_to_airport",
               "detailedStatusRus":null,
               "detailedStatusDate":"2023-01-25T11:12:03.000+03:00"
            }
         ]
      },
      "info":[
         {
            "number":"400267444",
            "message":"Найдено более одного заказа"
         },
         {
            "number":"935743976",
            "message":"Заказ не найден"
         }
      ]
   }
}
<response>
   <metadata>
      <status>200</status>
      <generated_at>2023-01-26 15:06:51</generated_at>
   </metadata>
   <data>
      <statusHistory>
         <400267443>
            <number>400267443</number>
            <state>waiting</state>
            <stateName>Ожидает сдачи на терминал</stateName>
            <stateDate>2023-01-12T15:52:40.000+03:00</stateDate>
            <detailedStatus>waiting</detailedStatus>
            <detailedStatusRus />
            <detailedStatusDate>2023-01-12T15:52:40.000+03:00</detailedStatusDate>
         </400267443>
         <400267443>
            <number>400267443</number>
            <state>inway</state>
            <stateName>Груз в пути</stateName>
            <stateDate>2023-01-25T11:10:44.000+03:00</stateDate>
            <detailedStatus>inway</detailedStatus>
            <detailedStatusRus />
            <detailedStatusDate>2023-01-25T11:10:44.000+03:00</detailedStatusDate>
         </400267443>
         <400267443>
            <number>400267443</number>
            <state>arrived_to_airport</state>
            <stateName>Груз прибыл в аэропорт</stateName>
            <stateDate>2023-01-25T11:12:03.000+03:00</stateDate>
            <detailedStatus>arrived_to_airport</detailedStatus>
            <detailedStatusRus />
            <detailedStatusDate>2023-01-25T11:12:03.000+03:00</detailedStatusDate>
         </400267443>
      </statusHistory>
      <info>
         <number>400267444</number>
         <message>Найдено более одного заказа</message>
      </info>
      <info>
         <number>935743976</number>
         <message>Заказ не найден</message>
      </info>
   </data>
</response>

Description of parameters

Response
Response
ParameterTypeDescription
metadataobjectSystem information
metadata.statusintegerEmulated status http-code. If successful, code 200 is returned
metadata.generated_atstring

Server response date and time.

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

dataobject

History of status changes for each found order, informational messages

data.statusHistoryStatusHistory

List of found orders and history of their status changes

data.infoarray of Info

Array of informational messages.

Parameter is present in a response if the next conditions are met:

  • several document numbers were passed in the request in the docIds parameter;

  • exactly one order was found for at least one number;

  • more than one order was found for at least one number, or none were found.

In this case, the history of status changes for the uniquely found orders is output in the data.statusHistory parameter, and the corresponding informational messages are output for the rest orders in the data. info parameter

Note: If only one document number was passed in the request and more than one order was found for it or none was found, then instead of the data block, the response will return error 130002 with the corresponding description (see "Errors of API methods")

StatusHistory
StatusHistory
ParameterTypeDescription
docId*object

Array with the found history of the order.

*Instead of [docId] here and below, the number of the found document is output in the response

docId.NumberintegerPassed number of the document by which the history of status changes was found
docId.Statestring

Order status in English, see "Directory of order statuses"

docId.StateNamestringOrder status in Russian, see "Directory of order statuses"
docId.StateDatestring

Date when the status was set.

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

docId.DetailedStatusstring

Detailed order status in English.

Possible values (the statuses order corresponds to the order of the possible values of "docId.detailedStatusRus" parameter):

  • "pickup_waiting_pickup" - the driver has not yet departed to the sender's address;
  • "pickup_departed" - the driver departed to the sender's address;
  • "pickup_arrived" - the driver arrived to the sender's address;
  • "pickup_finished" - the driver has picked up the cargo from the sender's address and is heading to the terminal;
  • "delivery_waiting_delivery" - the driver has not yet departed to the receiver's address;
  • "delivery_departed" - the driver departed to the receiver's address;
  • "delivery_arrived"- the driver arrived to the receiver's address;
  • "delivery_finished" - the driver handed over the cargo at the receiver address;
docId.DetailedStatusRusstring

Detailed order status in Russian.

Possible values (the statuses order corresponds to the order of the possible values of "docId.detailedStatus" parameter):

  • "Ожидается забор";
  • "Машина едет на адрес";
  • "Машина на адресе";
  • "Груз забран. Едет на терминал";
  • "Ожидается доставка";
  • "Машина едет на адрес";
  • "Машина на адресе";
  • "Груз доставлен"
docId.DetailedStatusDatestring

Date when the detailed status was set.

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

Info
Info
ParameterTypeDescription
numberstring

Passed number of the document

messagestring

Informational message

Error handling

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