Receiving barcode CP for the order
This technique is used to receive a barcode cargo package for the order/orders in the PDF format.
The link to the file with a barcode CP for the order\orders will be available during one hour. |
To download the printed order form file, you need to send a GET request to the URL from the method response. Authentication method: Bearer token
Request to receive barcode CP for the order
To use it, send a GET-request to the URL:
Environment | URL |
---|---|
testing | https://api.edu.cdek.ru/v2/print/barcodes/{uuid} |
production | https://api.cdek.ru/v2/print/barcodes/{uuid} |
{uuid} – identifier of the barcode CP to which the link is requested
Answer to receive the barcode CP for the order
The response body is returned in the JSON format:
№ | Field name | Description | Field type | Mandatory |
---|---|---|---|---|
1 | entity | Data of the barcode CP over which request is sent | no | |
1.1 | uuid | Identifier of the barcode CP file | 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 copies on one page | integer | no |
1.4 | format | Printing format | string(2) | 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/barcodes/{uuid}.pdf | string() | no |
1.6 | statuses | File 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 barcode CP | request[] | yes |
2.1 | request_uuid | Barcode CP 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 a barcode CP for order/orders receipt, send a GET-request to the received URL with authorization token in the heading
https://api.cdek.ru/v2/print/barcodes/72753034-c617-46ef-b70a-8f5f520b6be4 |
{ "entity": { "uuid": "72753034-c617-46ef-b70a-8f5f520b6be4", "orders": [ { "order_uuid": "72753034-bd61-45fc-be66-da4a03ed2ed8" } ], "copy_count": 1, "type": "barcode", "format": "A4", "url": "http://api.cdek.ru/v2/print/barcodes/72753034-c617-46ef-b70a-8f5f520b6be4.pdf", "statuses": [ { "code": "ACCEPTED", "name": "Принят", "date_time": "2020-03-19T11:25:53+0700" }, { "code": "PROCESSING", "name": "Формируется", "date_time": "2020-03-19T11:25:53+0700" }, { "code": "READY", "name": "Сформирован", "date_time": "2020-03-19T11:25:54+0700" } ] }, "requests": [ { "request_uuid": "72753034-e836-499d-bee7-e02053498521", "type": "CREATE", "date_time": "2020-03-19T11:25:54+0700", "state": "SUCCESSFUL" } ] } |
Appendix 1. Barcode CP 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 |
© 2000—2024, Курьерская компания СДЭК