Creating order receipt
This technique is used to creating an order/orders receipt in the PDF format.
To avoid the platform’s overload, don’t send more than 100 order numbers in one request.
Request to create the order receipt
To use it, send a POST-request to the URL:
Environment | URL |
---|---|
testing | https://api.edu.cdek.ru/v2/print/orders |
production | https://api.cdek.ru/v2/print/orders |
Body of the request
Must be sent in the JSON format (Content-Type: application/json).
The following fields are supported:
№ | Field name | Description | Field type | Mandatory |
---|---|---|---|---|
1 | orders | List of orders | order[ ] | yes |
1.1 | order_uuid | Order identifier in CDEK information system | UUID | yes, if cdek_number was not sent |
1.2 | cdek_number | CDEK order number | long | yes, if order_uuid was not sent |
2 | copy_count | Quantity of a receipt’s copies on one page. It is recommended to select not less than 2: one copy is attached to the cargo and the second one is given to the sender Default value 2 | integer | no |
3 | type | Receipt type. May take on values: tpl_china – receipt in Chinese tpl_armenia – receipt in Armenian Default receipt type depends on order type | string(255) | no |
Answer to create order receipt
The response body is returned in the JSON format:
No. | Field name | Description | Field type | Mandatory (yes/no) |
---|---|---|---|---|
1 | entity | Data of the order receipt over which request is sent | no | |
1.1 | uuid | Identifier of the order receipt in the CDEK IS | UUID | no |
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 |
The received uuid must be used in the technique "Request to receive the order receipt " to receive a link to download the PDF file. |
{ "orders": [ { "order_uuid": "72753034-bd61-45fc-be66-da4a03ed2ed8" } ], "copy_count": 2 } |
{ "entity": { "uuid": "72753034-4b28-40af-a89e-fc2e18935307" }, "requests": [ { "request_uuid": "72753034-c44c-49f3-8b07-4fb5af75bcfa", "type": "CREATE", "state": "ACCEPTED", "date_time": "2020-03-19T12:10:43+0700", "errors": [], "warnings": [] } ] } |
© 2000—2022, Курьерская компания СДЭК