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

testinghttps://api.edu.cdek.ru/v2/orders
productionhttps://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

1uuid1

CDEK information system’s order identifier that needs to be updated

UUID

yes, if cdek_number is empty

2cdek_number1

CDEK order number that needs to be updated

long

yes, if uuid is empty

3tariff_code2

Tariff code (old and new tariff modes must be same)

integer

no

4comment

Note to the order

string(255)

no

5shipment_point

Code of CDEK pickup point to which a shipment will be accepted, or a shipment brought by a client independently.
Cannot be used concurrently with from_location

string()

no

6delivery_point

Code of CDEK pickup point to which the parcel will be delivered.
Cannot be used concurrently with to_location

string()

no

7delivery_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.1value

Additional fee amount

float

yes

7.2vat_sum

VAT amount

float

no

7.3vat_rate

VAT rate (value - 0, 10, 20, null – no VAT)

integer

no

8delivery_recipient_cost_adv

Additional delivery fee charged by an e-shop from the receiver, depends on the order’s price
It is possible to send several thresholds

threshold[]

no

8.1threshold

Goods price threshold (active with conditions “less: or “equal”), in round currency units

integer

yes

8.2sum

Additional delivery fee for goods, the total price of which falls within the interval

float

yes

8.3vat_sum

VAT sum included in the additional delivery fee

float

no

8.4vat_rate

VAT rate (value 0, 10, 20, null = no VAT)

integer

no

9sender

Sender

contact

no

9.1company

Company name

string(255)

no

9.2name

Contact person full name

string(255)

no

9.3email

E-mail address

Must comply with RFC 2822

string(255)

no

9.4passport_series

Passport series

string(4)

no

9.5passport_number

Passport number

string(30)

no

9.6passport_date_of_issue

Passport issue date

date (yyyy-MM-dd)

no

9.7passport_organization

Passport issuing authority

string(255)

no

9.8tin

Tax ID number

Can contain 10 or 12 characters

string(12)

no

9.9passport_date_of_birth

Birthdate

date (yyyy-MM-dd)

no

9.10phones

Phone numbers list

No more than 10 numbers

phone[]

no

9.10.1number

Phone number

International format is required: country code (+7 for Russia) and the number itself (10 or more figures)

string(255)

yes

9.10.2additional

Additional information (additional number)

string(255)

no

10seller

Real seller’s bank details

seller

no

10.1name

Real seller’s name

string(255)

no

10.2inn

Real seller’s tax ID number

string(12)

no

10.3phone

Real seller’s phone number

string(255)

no

10.4ownership_form

Incorporation form code

integer

no

11recipient

Receiver

contact

no

11.1company

Company’s name

string(255)

no

11.2name

Contact person’

string(255)

no

11.3passport_series

Passport series

string(4)

no

11.4passport_number

Passport number

string(30)

no

11.5passport_date_of_issue

Passport issue date

date (yyyy-MM-dd)

no

11.6passport_organization

Passport issuing authority

string(255)

no

11.7tin

Tax ID number

Can contain 10 or 12 characters

string(12)

no

11.8passport_date_of_birth

Birthdate

date (yyyy-MM-dd)

no

11.9email

E-mail

Must comply with RFC 2822

string(255)

no

11.10phones

Phone numbers list

No more than 10 numbers

phone[]

no

11.10.1number

Phone number

International format is required: country code (+7 for Russia) and the number itself (10 or more figures)

string(255)

yes

11.10.2additional

Additional information (additional number)

string(255)

no

12to_location2

Receiving address
Cannot be used concurrently with delivery_point

location

no

12.1code

CDEK location code ("List of Cities" method)

integer

no

12.2fias_guid

Federal Information Address System unique code

UUID

no

12.3postal_code

Postcode

string(255)

no

12.4longitude

Longitude

float

no

12.5latitude

Latitude

float

no

12.6country_code

Country code in ISO_3166-1_alpha-2 format

string(2)

no

12.7region

Region name

string(255)

no

12.8region_code

Region code (CDEK register)

integer

no

12.9sub_region

Subregion name

string(255)

no

12.10city

City name

string(255)

no

12.11kladr_code

All-Russian Classifier of Addresses code

Deprecated field

string(255)

no

12.12address

Address line

string(255)

yes

13from_location

Sending address
Cannot be used concurrently with shipment_point

location

no

13.1address

Address line

string(255)

yes

14services2

Additional services

service[]

no

14.1code

Additional service type

integer

yes

14.2parameter

Additional service parameter:

  • number of packages for the "Packaging 1", "Courier package A2", "Secure package A2", "Secure package A3", "Secure package A4", "Secure package A5" services (all order types)

  • Declared value for the Insurance service (for order with type “Delivery” only)

integer

no

15packages2

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.1package_idCDEK information system’s package identifier stringno, if a new package is transferred (with a new number)
15.2number

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.3weight

Total weight (in grams)

integer

yes

15.4length

Package dimensions. Length (in centimeters)

integer

yes, if other dimensions are specified

15.5width

Package dimensions. Width (in centimeters)

integer

yes, if other dimensions are specified

15.6height

Package dimensions. Height (in centimeters)

integer

yes, if other dimensions are specified

15.7comment

Note to the package
Only for delivery type orders

string(255)

no

15.8items

Goods positions in the package

Only for “E-shop” orders
No more than 126 unique items in one order.
The total number of products in action can be from 1 to 10,000

item[]

yes

15.8.1name

Goods name (may also contain description: size, color)

string(255)

yes

15.8.2ware_key

Goods ID/item number

The item number can contain only symbols: [A-z A-z 0-9! @ "# # $;% ^: &? * () _ - + =? <> ,. {} [] \ /, Space]

string(50)

yes

15.8.3marking

Marking of item.
If marking is indicated for Item, the Amount parametr can't be greater than 1

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 format

Example: 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.4payment

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.1value

Cash on delivery sum (in case of preliminary payment = 0)

float

yes

15.8.4.2vat_sum

VAT amount

float

no

15.8.4.3vat_rate

VAT rate (value - 0, 10, 20, null - no VAT)

integer

no

15.8.5cost

Declared value (for one unit, in the specified currency, value >=0). This value is used for payment calculation

float

yes

15.8.6weight

Weight (for one unit, in grams)

integer

yes

15.8.7weight_gross

Gross weight

integer

yes, if order is international

15.8.8amount

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.9name_i18n

Name in the foreign language

string(255)

yes

15.8.10brand

Brand in the foreign language

string(255)

no

15.8.11country_code

Country code in ISO_3166-1_alpha-2 format

string(2)

no

15.8.12material

Material code

string(255)

no

15.8.13wifi_gsm

Contains wifi/gsm

boolean

no

15.8.14url

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 nameDescriptionField typeMandatory (yes/no)
1entityData of the order over which request is sent
no
1.1uuidOrder identifier in the CDEK ISUUIDno
2requestsData on the request/requests over the orderrequest[]yes
2.1request_uuidRequest 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


{
   "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—2024, Курьерская компания СДЭК