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

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: 

{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

1entityData of the order receipt over which request is sent
no

1.1

uuidReceipt identifierUUIDyes
1.2ordersList of ordersorder[ ]yes
1.2.1order_uuidOrder identifier in CDEK information systemUUIDno
1.2.2cdek_numberCDEK order numberlongno
1.3copy_countQuantity of a receipt’s copies on one pageintegerno
1.4typeReceipt type. May take on values:
tpl_china – receipt in Chinese
tpl_armenia – receipt in Armenian
string(255)no
1.5url1Link 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.6statusesReceipt statusstatus[ ]yes
1.6.1codeStatus code (see Appendix 1)string()yes
1.6.2nameStatus namestring()yes
1.6.3date_timeDate and time of status setting (format yyyy- MM-dd'T'HH:mm:ssZ)datetimeyes
2requestsData on the request/requests over the order receiptrequest[]yes
2.1request_uuidOrder receipt identifier in CDEK information systemUUIDno
2.2typeRequest type
May take on values: CREATE, UPDATE, DELETE, AUTH, GET
string()yes
2.3state

Current status of the request
May take on values: 

ACCEPTED - pre-validation passed and request accepted
WAITING - the request is awaiting processing (depends on the execution of another request)
SUCCESSFUL - the request was processed successfully
INVALID - the request was processed with an error

string()yes
2.4date_timeDate and time of setting current status of the request (format yyyy-MM-dd'T'HH:mm:ssZ)datetimeyes
2.5errorsRequest processing errorserror[]no
2.5.1codeError codestring()yes
2.5.2messageError descriptionstring()yes
2.6warningsRequest processing warningswarning[]no
2.6.1codeWarning codestring()yes
2.6.2messageWarning descriptionstring()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

Sample Request
https://api.cdek.ru/v2/print/orders/72753034-4b28-40af-a89e-fc2e18935307
Sample Response
{
    "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

  • No labels