This technique is used to generate a link to an order/orders receipt in the PDF format.
The link to the file with the order\orders receipt will be available during one hour.
Request to receive the order receipt
To use it, send a GET-request to the URL:
Environment | URL |
---|---|
testing | https://api.edu.cdek.ru/v2/print/orders/{uuid} |
production | https://api.cdek.ru/v2/print/orders/{uuid} |
{uuid} – identifier of the receipt to which the link is requested
Answer to receive the order receipt
The response body is returned in the JSON format:
№ | Field name | Description | Field type | Mandatory |
---|---|---|---|---|
1 | entity | Data of the order receipt over which request is sent | no | |
1.1 | uuid | Receipt identifier | UUID | yes |
1.2 | orders | List of orders | order[ ] | yes |
1.2.1 | order_uuid | Order identifier in CDEK information system | UUID | no |
1.2.2 | cdek_number | CDEK order number | long | no |
1.3 | copy_count | Quantity of a receipt’s copies on one page | integer | no |
1.4 | type | Receipt type. May take on values: tpl_china – receipt in Chinese tpl_armenia – receipt in Armenian | string(255) | no |
1.5 | url1 | Link to download the file. Contained in the answer only in the “Formed” status Format: https://api.cdek.ru/v2/print/orders/%7Buuid%7D.pdf | string() | no |
1.6 | statuses | Receipt status | status[ ] | yes |
1.6.1 | code | Status code (see Appendix 1) | string() | yes |
1.6.2 | name | Status name | string() | yes |
1.6.3 | date_time | Date and time of status setting (format yyyy- MM-dd'T'HH:mm:ssZ) | datetime | yes |
2 | requests | Data on the request/requests over the order receipt | request[] | yes |
2.1 | request_uuid | Order receipt identifier in CDEK information system | UUID | no |
2.2 | type | Request type May take on values: CREATE, UPDATE, DELETE, AUTH, GET | string() | yes |
2.3 | state | Current status of the request ACCEPTED - pre-validation passed and request accepted | string() | yes |
2.4 | date_time | Date and time of setting current status of the request (format yyyy-MM-dd'T'HH:mm:ssZ) | datetime | yes |
2.5 | errors | Request processing errors | error[] | no |
2.5.1 | code | Error code | string() | yes |
2.5.2 | message | Error description | string() | yes |
2.6 | warnings | Request processing warnings | warning[] | no |
2.6.1 | code | Warning code | string() | yes |
2.6.2 | message | Warning description | string() | yes |
1 To receive a file with an order/orders receipt, send a GET-request to the received URL with authorization token in the heading
https://api.cdek.ru/v2/print/orders/72753034-4b28-40af-a89e-fc2e18935307
{ "entity": { "uuid": "72753034-4b28-40af-a89e-fc2e18935307", "orders": [ { "order_uuid": "72753034-bd61-45fc-be66-da4a03ed2ed8" } ], "copy_count": 2, "url": "http://api.cdek.ru/v2/print/orders/72753034-4b28-40af-a89e-fc2e18935307.pdf", "statuses": [ { "code": "ACCEPTED", "name": "Принят", "date_time": "2020-03-19T12:10:43+0700" }, { "code": "PROCESSING", "name": "Формируется", "date_time": "2020-03-19T12:10:43+0700" }, { "code": "READY", "name": "Сформирован", "date_time": "2020-03-19T12:10:44+0700" } ] }, "requests": [ { "request_uuid": "72753034-c44c-49f3-8b07-4fb5af75bcfa", "type": "CREATE", "date_time": "2020-03-19T12:10:44+0700", "state": "SUCCESSFUL" } ] }
Appendix 1. Receipt statuses
Code | Status name | Note |
ACCEPTED | Accepted | Request to create the receipt has been accepted |
PROCESSING | Processing | File with the receipt is being processed |
READY | Ready | File with the receipt and file download link are ready |
REMOVED | Removed | The file download link’s time-to-live has expired |
INVALID | Invalid | Invalid request to create the receipt |