Update an Order
This method is used for update an order created earlier.
An order can be changed only if there is no cargo movement in the CDEK warehouse (i.e. the order status is “Created”).
Request for Update an Order
To use it, send a PATCH-request to the URL:
Environment | URL |
---|---|
testing | https://api.edu.cdek.ru/v2/orders |
production | https://api.cdek.ru/v2/orders |
Request Body
It should be sent in the JSON format (Content-Type: application/json).
The following fields are supported:
No. | Tag/Attribute | Description | Field type | Mandatory |
---|---|---|---|---|
1 | uuid1 | CDEK information system’s order identifier that needs to be updated | UUID | yes, if cdek_number is empty |
2 | cdek_number1 | CDEK order number that needs to be updated | long | yes, if uuid is empty |
3 | tariff_code2 | Tariff code (old and new tariff modes must be same) | integer | no |
4 | comment | Note to the order | string(255) | no |
5 | shipment_point | Code of CDEK pickup point to which a shipment will be accepted, or a shipment brought by a client independently. | string() | no |
6 | delivery_point | Code of CDEK pickup point to which the parcel will be delivered. | string() | no |
7 | delivery_recipient_cost | Additional delivery fee charged by an e-shop from the receiver. The fee’s currency must match the cash on delivery currency. | money | no |
7.1 | value | Additional fee amount | float | yes |
7.2 | vat_sum | VAT amount | float | no |
7.3 | vat_rate | VAT rate (value - 0, 10, 20, null – no VAT) | integer | no |
8 | delivery_recipient_cost_adv | Additional delivery fee charged by an e-shop from the receiver, depends on the order’s price | threshold[] | no |
8.1 | threshold | Goods price threshold (active with conditions “less: or “equal”), in round currency units | integer | yes |
8.2 | sum | Additional delivery fee for goods, the total price of which falls within the interval | float | yes |
8.3 | vat_sum | VAT sum included in the additional delivery fee | float | no |
8.4 | vat_rate | VAT rate (value 0, 10, 20, null = no VAT) | integer | no |
9 | sender | Sender | contact | no |
9.1 | company | Company name | string(255) | no |
9.2 | name | Contact person full name | string(255) | no |
9.3 | E-mail address Must comply with RFC 2822 | string(255) | no | |
9.4 | passport_series | Passport series | string(4) | no |
9.5 | passport_number | Passport number | string(30) | no |
9.6 | passport_date_of_issue | Passport issue date | date (yyyy-MM-dd) | no |
9.7 | passport_organization | Passport issuing authority | string(255) | no |
9.8 | tin | Tax ID number Can contain 10 or 12 characters | string(12) | no |
9.9 | passport_date_of_birth | Birthdate | date (yyyy-MM-dd) | no |
9.10 | phones | Phone numbers list No more than 10 numbers | phone[] | no |
9.10.1 | number | Phone number International format is required: country code (+7 for Russia) and the number itself (10 or more figures) | string(255) | yes |
9.10.2 | additional | Additional information (additional number) | string(255) | no |
10 | seller | Real seller’s bank details | seller | no |
10.1 | name | Real seller’s name | string(255) | no |
10.2 | inn | Real seller’s tax ID number | string(12) | no |
10.3 | phone | Real seller’s phone number | string(255) | no |
10.4 | ownership_form | Incorporation form code | integer | no |
11 | recipient | Receiver | contact | no |
11.1 | company | Company’s name | string(255) | no |
11.2 | name | Contact person’ | string(255) | no |
11.3 | passport_series | Passport series | string(4) | no |
11.4 | passport_number | Passport number | string(30) | no |
11.5 | passport_date_of_issue | Passport issue date | date (yyyy-MM-dd) | no |
11.6 | passport_organization | Passport issuing authority | string(255) | no |
11.7 | tin | Tax ID number Can contain 10 or 12 characters | string(12) | no |
11.8 | passport_date_of_birth | Birthdate | date (yyyy-MM-dd) | no |
11.9 | Must comply with RFC 2822 | string(255) | no | |
11.10 | phones | Phone numbers list No more than 10 numbers | phone[] | no |
11.10.1 | number | Phone number International format is required: country code (+7 for Russia) and the number itself (10 or more figures) | string(255) | yes |
11.10.2 | additional | Additional information (additional number) | string(255) | no |
12 | to_location2 | Receiving address | location | no |
12.1 | code | CDEK location code ("List of Cities" method) | integer | no |
12.2 | fias_guid | Federal Information Address System unique code | UUID | no |
12.3 | postal_code | Postcode | string(255) | no |
12.4 | longitude | Longitude | float | no |
12.5 | latitude | Latitude | float | no |
12.6 | country_code | Country code in ISO_3166-1_alpha-2 format | string(2) | no |
12.7 | region | Region name | string(255) | no |
12.8 | region_code | Region code (CDEK register) | integer | no |
12.9 | sub_region | Subregion name | string(255) | no |
12.10 | city | City name | string(255) | no |
12.11 | kladr_code | All-Russian Classifier of Addresses code Deprecated field | string(255) | no |
12.12 | address | Address line | string(255) | yes |
13 | from_location | Sending address | location | no |
13.1 | address | Address line | string(255) | yes |
14 | services2 | Additional services | service[] | no |
14.1 | code | Additional service type | integer | yes |
14.2 | parameter | Additional service parameter:
| integer | no |
15 | packages2 | List of information on packages Not transferred packages will be removed The number of places in the order can be from 1 to 255. | package[] | no |
15.1 | package_id | CDEK information system’s package identifier | string | no, if a new package is transferred (with a new number) |
15.2 | number | Package number (Can be counting number of order package or order number), unique within the order Order ID in Client IS | string(20) | yes |
15.3 | weight | Total weight (in grams) | integer | yes |
15.4 | length | Package dimensions. Length (in centimeters) | integer | yes, if other dimensions are specified |
15.5 | width | Package dimensions. Width (in centimeters) | integer | yes, if other dimensions are specified |
15.6 | height | Package dimensions. Height (in centimeters) | integer | yes, if other dimensions are specified |
15.7 | comment | Note to the package | string(255) | no |
15.8 | items | Goods positions in the package Only for “E-shop” orders | item[] | yes |
15.8.1 | name | Goods name (may also contain description: size, color) | string(255) | yes |
15.8.2 | ware_key | Goods ID/item number The item number can contain only symbols: [A-z A-z 0-9! @ "# # $;% ^: &? * () _ - + =? <> ,. {} [] \ /, Space] | string(50) | yes |
15.8.3 | marking | Marking of item. For the correct display of the marking of the goods in the receipt, it is required to transfer the NOT DISASSEMBLED type of marking, which may look like this: 1) Product code in GS1 formatExample: 010468008549838921AAA0005255832GS91EE06GS92VTwGVc7wKCc2tqRncUZ1RU5LeUKSXjWbfNQOpQjKK+A 2) A sequence of valid characters with a total length of 29 characters.Example: 00000046198488X?io+qCABm8wAYa 3) Fur. They have their own format. Example: RU-430302-AAA7582720 | string() | no |
15.8.4 | payment | Payment when the goods are delivered (for one unit, in the specified currency, value >=0) — cash on delivery, value = 0 in case of preliminary payment | money | yes |
15.8.4.1 | value | Cash on delivery sum (in case of preliminary payment = 0) | float | yes |
15.8.4.2 | vat_sum | VAT amount | float | no |
15.8.4.3 | vat_rate | VAT rate (value - 0, 10, 20, null - no VAT) | integer | no |
15.8.5 | cost | Declared value (for one unit, in the specified currency, value >=0). This value is used for payment calculation | float | yes |
15.8.6 | weight | Weight (for one unit, in grams) | integer | yes |
15.8.7 | weight_gross | Gross weight | integer | yes, if order is international |
15.8.8 | amount | Number of the good’s units (in pieces) The number of one item in the order can be from 1 to 999 | integer | yes |
15.8.9 | name_i18n | Name in the foreign language | string(255) | yes |
15.8.10 | brand | Brand in the foreign language | string(255) | no |
15.8.11 | country_code | Country code in ISO_3166-1_alpha-2 format | string(2) | no |
15.8.12 | material | Material code | string(255) | no |
15.8.13 | wifi_gsm | Contains wifi/gsm | boolean | no |
15.8.14 | url | Link to the e-shop’s website with the goods description | string(255) | no |
1Orders are identified on the basis of these fields (uuid has the highest priority).
2Order amount can be re-calculated if new values are entered in these fields.
Response to Update an Order
The response body is returned in the JSON format:
No. | Field name | Description | Field type | Mandatory (yes/no) |
---|---|---|---|---|
1 | entity | Data of the order over which request is sent | no | |
1.1 | uuid | Order identifier in the CDEK IS | UUID | no |
2 | requests | Data on the request/requests over the order | request[] | yes |
2.1 | request_uuid | Request 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 |
{ "uuid":"72753031-5427-4d1b-b1e4-7c4c26be00a0", "cdek_number":"1105660806", "tariff_code":"10", "sender":{ "company":"Pogoda", "name":"Петров Петр", "email":"react@cdek.ru", "phones":[ { "number":"+79134637228", "additional":"1234" } ] }, "recipient":{ "company":"NUMM", "name":"Константинов Константин", "email":"pochta@gmail.com", "phones":[ { "number":"+79134635628", "additional":"123" } ] }, "to_location":{ "code":"137" }, "from_location":{ "address":"Новосибирск, Большевистская 101" }, "services":[ { "code":"DANGER_CARGO" }, { "code":"PACKAGE_1", "parameter":"1" } ], "packages":[ { "number":"bar-666", "height":20, "length":20, "weight":4000, "width":20, "items":[ { "name":"Товар", "ware_key":"00055", "payment":{ "value":3000 }, "cost":300, "amount":1, "weight":700 } ] } ] } |
{ "entity":{ "uuid":"72753031-5427-4d1b-b1e4-7c4c26be00a0" }, "requests":[ { "request_uuid":"72753031-35cc-4ef6-a353-25a09d3a973a", "type":"UPDATE", "state":"ACCEPTED", "date_time":"2020-01-23T11:48:40Z", "errors":[ ], "warnings":[ { "code":"v2_cost_change_by_tariff", "message":"New tariff code can trigger change order cost" }, { "code":"v2_cost_change_by_services", "message":"New services can trigger change order cost" }, { "code":"v2_cost_change_by_parameters", "message":"New parameters (weight, dimensions, items cost) can trigger change order cost" } ] } ] } |
© 2000—2023, Курьерская компания СДЭК