Page tree
Skip to end of metadata
Go to start of metadata

Webhooks are used to send events to the client URL:

  • order status change events;
  • readiness of the printed form.

The URL connection timeout prior to sending a message is 3 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:
ORDER_STATUS - order status events
PRINT_FORM - print forms readiness

string

yes

2

date_time

Date and time of event in ISO 8601 format:
ORDER_STATUS - date of setting new status
PRINT_FORM - date of URL generation with pdf-file

datetime

yes

3

uuid

Entity identifier:
ORDER_STATUS  - order
для PRINT_FORM - print form

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.1is_return

Sign of a return order:
true - is returnable
false - is direct

booleanyes

4.2

cdek_number

CDEK order number

long

yes

4.3numberOrder 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()

yes

4.8city_codePlace id of origin of the status

string()

yes

For an event type PRINT_FORM attributes contains:

No.

Field name

Description

Field type

Mandatory (yes/no)

4.1

type

Type of print form:
receipt - order receipt
barcode - barcode CP for the order

long

yes

4.4

url

Link to download the file:
Format: https://api.cdek.ru/v2/print/orders/{uuidasket.pdf for order receipt
https://api.cdek.ru/v2/print/barcodes/{uuidasket.pdf for barcode CP for the order

string()

yes


Sample Event (ORDER_STATUS)
{
  "type": "ORDER_STATUS",
  "date_time": "2020-08-10T21:32:14+0700",
  "uuid": "72753031-2801-4186-a091-0be58cedfee7",
  "attributes": {
    "is_return": false,
    "cdek_number": "1106321645",
    "status_code": "3",
    "status_date_time": "2020-08-10T21:32:12+0700",
    "city_name": "Новосибирск",
    "city_code": "270"
  }
}
Sample Event (PRINT_FORM)
{
  "type": "PRINT_FORM",
  "date_time": "2019-07-11T13:07:34+0700",
  "uuid": "72753031-8347-40c0-ab0f-1a49c7a262c1",
  "attributes": {
    "type": "barcode",
    "url": "https://api.cdek.ru/v2/print/barcodes/{uuid}.pdf"
  }
}

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.

27Sent to the sender cityA 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.

28Received in the sending cityA 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

  • No labels