Webhooks
Webhooks are used to send events to the client URL:
- order status change events
- receiving photo documents on orders
- receiving information about preorder closing
- readiness of the printed form
The URL connection timeout prior to sending a message is 15 seconds. In case of failed connection, the system will not try to send the message again. |
Webhook Subscription
To get webhooks, you should activate the subscription. For more information about subscription management, see Webhook Subscription
Webhook Structure
The event in the JSON format will be sent to the specified URL:
No. | Field name | Description | Field type | Mandatory (yes/no) |
1 | type | Event type: | string | yes |
2 | date_time | Date and time of event in ISO 8601 format: | datetime | yes |
3 | uuid | Entity identifier: | UUID | yes |
4 | attributes | Event attributes | yes |
For an event type ORDER_STATUS attributes contains:
No. | Field name | Description | Field type | Mandatory (yes/no) |
---|---|---|---|---|
4.1 | is_return | Sign of a return order: | boolean | yes |
4.2 | cdek_number | CDEK order number | long | yes |
4.3 | number | Order number in the Client IS | string() | no |
4.4 | status_code | Status code (for more details, see the Appendix 1) | string() | yes |
4.5 | status_reason_code | Additional status code (for more details, see Appendix 2) | string() | no |
4.6 | status_date_time | Date and time of status setting | datetime | yes |
4.7 | city_name | Place of origin of the status | string() | no |
4.8 | city_code | Place id of origin of the status (It isn't returned for Created) | string() | no |
4.9 | code | Status code (see Appendix 1 for details) | ||
4.10 | is_reverse | Return order sign | ||
4.11 | is_client_return | Client return sign | ||
4.12 | related_entities | Related entities, array of objects | ||
4.12.1 | type | Linked entity type, can take the following values: direct_order - direct order client_direct_order - direct order for which a client return has been issued. | ||
4.12.2 | cdek_number | CDEK order number | ||
4.12.3 | uuid | ID of the linked entity |
For an event type PRINT_FORM attributes contains:
No. | Field name | Description | Field type | Mandatory (yes/no) |
---|---|---|---|---|
4.1 | type | Type of print form: | long | yes |
4.4 | url | Link to download the file: | string() | yes |
For an event type DOWNLOAD_PHOTO attributes contains:
No. | Field name | Description | Field type | Mandatory (yes/no) |
---|---|---|---|---|
4.1 | cdek_number | CDEK order number | string() | yes |
4.4 | link | Link to download the file: | string() | yes |
{ "type": "ORDER_STATUS", "date_time": "2023-11-28T07:44:45+0000", "uuid": "72753031-1820-4f99-9240-aab139f05ca5", "attributes": { "is_return": false, "is_reverse": false, "is_client_return": false, "cdek_number": "1100285492", "number": "17011574744791", "related_entities": [], "code": "RECEIVED_AT_SHIPMENT_WAREHOUSE", "status_code": "3", "status_date_time": "2023-11-28T07:44:45+0000", "city_name": "Новосибирск", "city_code": "270" } } |
{ "type": "PRINT_FORM", "date_time": "2023-11-28T09:03:31+0000", "uuid": "72753031-e1f1-4fc8-97ee-d58a010b6a67", "attributes": { "type": "BARCODE", "url": "http://api.cdek.ru/v2/print/barcodes/72753031-e1f1-4fc8-97ee-d58a010b6a67.pdf" } } |
{ "type": "DOWNLOAD_PHOTO", "date_time": "2023-11-29T05:00:01+0000", "uuid": "72753031-7288-4d57-a893-29451197aa01", "attributes": { "cdek_number": 1100239959, "link": "https://photo-docs.production.cdek.ru/archives/qWErtY" } } |
Appendix 1. Order Statuses
Code | Status | Comment |
1 | Created | The order has been registered in the CDEK database. |
2 | Deleted | The order has been canceled by the e-shop before it has been delivered to the CDEK warehouse in the sender's city |
3 | Accepted by the sender's warehouse | The cargo has been accepted by the CDEK warehouse in the sender's city. |
6 | Issued for delivery in the sender's city | The cargo has been issued from the CDEK warehouse in the sender's city. The cargo has been prepared for delivery (consolidated with other parcels) |
16 | Returned to the sender's warehouse | Cargo has been accepted again in the sender's city (it has not been handed over to the carrier for some reason). Note: this status does not mean that the cargo has been returned to the sender. |
7 | Handed over to the carrier in the sender's city | The shipment in the sender's city has been registered. The consolidated cargo has been handed over for delivery (to the airport/ loaded into the car) |
21 | Shipped to the transit city | The shipment to the transit city has been registered. Data and time of shipment have been recorded by the carrier. |
22 | Received in the transit city | The receipt in the transit city has been registered. |
13 | Accepted by the transit warehouse | The cargo has been accepted in the transit city |
17 | Returned to the transit warehouse | The cargo has been accepted again in the transit city (the cargo has been returned to the warehouse). Note: this status does not mean that the cargo has been returned to the sender. |
19 | Issued for delivery in the transit city | The cargo has been issued from the warehouse in the transit city |
20 | Handed over to the carrier in the transit city | The shipment in the transit city has been registered by a carrier. |
27 | Sent to the sender city | A shipment to the sender's city was registered. A parcel is in transit. |
8 | Shipped to the receiver's city: | The shipment to the receiver's city has been registered. Cargo is in transit. |
28 | Received in the sending city | A receipt was registered in the sending city. |
9 | Received in the receiver's city: | The receipt in the receiver's city has been registered |
10 | Accepted by the delivery warehouse | The cargo has been accepted by the warehouse of the receiver's city. Waiting for delivery to door |
12 | Accepted by the warehouse for pickup | The cargo has been accepted by the warehouse in the receiver's city. Delivery to the warehouse. The parcel will be stored until picked up by the client (e-shop's customer). |
11 | Issued for delivery | The cargo has been added to a courier card and issued to the courier for delivery |
18 | Returned to the delivery warehouse | The cargo has been accepted again by the warehouse in the receiver's city. Delivery attempt has been failed for some reason. Waiting for repeated delivery attempt. Note: this status does not mean that the cargo has been returned to the sender. |
4 | Delivered | The cargo has been successfully delivered and handed over to the receiver (final status). |
5 | Not delivered | The buyer has refused to accept the purchase. Return to the e-shop (final status). |
Appendix 2. Additional Order Statuses
Code | Additional status | Delivery service rendered (0–no, 1–yes) | Related status |
1 | Return, incorrect address | 0 | Not delivered |
2 | Return, failed call | 0 | Not delivered |
3 | Return, the receiver does not live at the specified address | 0 | Not delivered |
4 | Return, the order may not be executed: the actual weight is different from the declared weight by more than X g | 0 | Not delivered |
5 | Return, the order may not be executed: the shipment has been documented, but the cargo has not actually been shipped | 0 | Not delivered |
6 | Return, the order may not be executed: the order number is doubled in a single acceptance certificate | 0 | Not delivered |
7 | Return, the order may not be executed: the company does not deliver cargoes to this city/region | 0 | Not delivered |
8 | Return, package damage has been detected upon acceptance from the sender | 0 | Not delivered |
9 | Return, the package has been damaged during transportation by the carrier | 0 | Not delivered |
10 | Return, the package has been damaged at our warehouse / during delivery by a courier | 0 | Not delivered |
11 | Return, refusal to accept: No reason explained | 1 | Not delivered |
12 | Return, refusal to accept: Quality claim | 1 | Not delivered |
13 | Return, refusal to accept: Shortage | 1 | Not delivered |
14 | Return, refusal to accept: Resorting | 1 | Not delivered |
15 | Return, refusal to accept: The receiver is unsatisfied with time of delivery | 1 | Not delivered |
16 | Return, refusal to accept: The receiver has already purchased the same product. | 1 | Not delivered |
17 | Return, refusal to accept: The receiver changed his/her mind. | 1 | Not delivered |
18 | Return, refusal to accept: Error in documentation | 1 | Not delivered |
19 | Return, refusal to accept: The package has been damaged at the receiver's office | 1 | Not delivered |
20 | Partial delivery | 1 | Delivered |
21 | Return, refusal to accept: No money | 1 | Not delivered |
22 | Return, refusal to accept: Not satisfied with the product | 1 | Not delivered |
23 | Return, storage period expired | 0 | Not delivered |
24 | Return, failed to pass through customs | 0 | Not delivered |
25 | Return, the order may not be executed: commercial cargo | 0 | Not delivered |
26 | Lost | 0 | Not delivered |
27 | Failed to be picked up, disposal | 0 | Not delivered |
© 2000—2024, Курьерская компания СДЭК