Customer refunds
This method is intended to create customer return orders for online stores (e-shops).
The customer return is a return that is issued by the customer himself after the order was delivered.
The difference from a regular refund is in the final status of a direct order:
for customer refunds, the final status is "delivered" and the return is issued by the customer himself, while for regular returns, the final status is "Not delivered" and the return is issued by CDEK.
For partially completed orders, you can issue both a customer return and a regular return (partial returns are not possible for international order yet)
Customer return can be created only for online store (e-shops) orders with the final status "Delivered".
Request to register a client return
To use this process, a POST request should be sent to URL:
Environment | URL |
---|---|
testing | https://api.edu.cdek.ru/v2/orders/{order_uuid}/clientReturn |
production | https://api.cdek.ru/v2/orders/{order_uuid}/clientReturn |
{order_uuid} - id of the direct order in the CDEK information system for which the client return will be created
Request Body
It should be sent in the JSON format (Content-Type: application/json).
The following field is supported:
Field name | Description | Field Type | Required to fill in the form |
---|---|---|---|
tariff_code | Tariff code (for more details see Appendix 1) Use the rates that are specified in the contract. | integer | yes |
Response to order registration
The response is returned in JSON format (following fields are supported):
№ | Field name | Description | Field Type | Mandatory (yes/no) |
---|---|---|---|---|
1 | entity | Order detail | entity | no |
1.1 | uuid1 | ID of the direct order in the CDEC Information System | UUID | no |
2 | requests | Information about the request above the order | request[] | yes |
2.1 | request_uuid | ID of the request in the CDEC Information System | UUID | no |
2.2 | type | The request type can take the following values: CREATE_CLIENT_RETURN | string() | yes |
2.3 | date_time | Date and time of setting the current request status (format yyyy-MM-ddt'H:mm:ssZ) | datetime | yes |
2.4 | state | The current state of the request can take values: ACCEPTED - pre-validation was completed and the request was accepted | string() | yes |
2.5 | errors | Errors that occurred during the request execution | error[] | no |
2.5.1 | code | Error code | string() | yes |
2.5.2 | message | Error Description | string() | yes |
uuid 1 - to view the return order, you need to make a request for the direct order and get information about the return (by the associated entity) there.
For more information, see the section "Order Information", points 3.1, 3.2, and 3.4, responses for receiving information about Customer returns.
Returning information about a related entity:
* uuid -ID of the entity associated with the order
• type - entity type, can take the values:
"client_return_order" - client return order (this value is returned for a direct order which is linked ti the client return was issued);
"client_direct_order" - a direct order for which the client refund was issued
* cdek_number - CDEK order number, can be returned for "client_return_order" and "client_direct_order"
Example:
{ "uuid": "72757777-6002-4a77-af00-180c751305fz", "type": "client_return_order", "cdek_number": "1100000001" } |
{ "tariff_code": 139 } |
{ "entity": { "uuid": "72753031-5dad-4760-9580-eb869062550c" }, "requests": [ { "request_uuid": "0323a5ab-157e-4dbb-a08d-9ec8728a2260", "type": "CREATE_CLIENT_RETURN", "date_time": "2022-12-02T01:31:28+0000", "state": "ACCEPTED" } ] } |
{ "entity": { "uuid": "72753031-5dad-4760-9580-eb869062550c", "type": 1, "is_return": false, "is_reverse": false, "cdek_number": "1108051973", "number": "1669944608", "tariff_code": 139, "comment": "New order", "items_cost_currency": "RUB", "recipient_currency": "RUB", "sender": { "company": "Pogoda", "name": "Petrov Ilya", "email": "msk@cdek.ru", "phones": [ { "number": "79999999999", "additional": "1234" } ], "passport_requirements_satisfied": false }, "seller": { "name": "Petrov Ilya", "phone": "+79999999999", "ownership_form": "4", "address": "Novosibirsk, Lenina 1" }, "recipient": { "company": "Ivanov Ivan", "name": "Ivanov Ivan", "passport_series": "5008", "passport_number": "345123", "passport_date_of_issue": "2019-03-12", "passport_organization":"Moscow Police Department", "tin": "123546789", "email": "pochta@gmail.com", "phones": [ { "number": "79977777777", "additional": "123" } ], "passport_requirements_satisfied": false }, "from_location": { "code": 270, "city": "Novosibirsk ", "fias_guid": "8dea00e3-9aab-4d8e-887c-ef2aaa546456", "country_code": "RU", "country": "Russia", "region": "Novosibirsk region", " region_code": 23, " longitude": 82.906928, " latitude": 55.028739, " address":" Novosibirsk, Bolshevistskaya 101" }, "to_location": { "code": 44, "city": "Moscow", " fias_guid": "0c5b2444-70a0-4932-980c-b4dc0d3f02b5", "country_code": "RU", "country": "Russia", "region": "Moscow", "region_code": 81, "longitude": 37.622513, "latitude": 55.75322, "address": "32 Blucher St." }, "services": [ { "code": "INSURANCE", "parameter": "300.00", "sum": 2.25 }, { "code": "AGENT_COMMISSION", "sum": 35.00 }, { "code": "CASH_ON_DELIVERY", "sum": 0 } ], "packages": [ { "number": "bar-001", "weight": 4000, "length": 10, "width": 10, "weight_volume": 200, "weight_calc": 4000, "height": 10, "comment": "inventory attached", "items": [ { "name": "Product", "ware_key": "00055", "marking": "0104630095188367217<GY>No;wZOE5", "payment": { "value": 3000.0, "vat_sum": 0.0 }, "weight": 700, "weight_gross": 700, "amount": 1, "delivery_amount": 1, "name_i18n": "www.item.ru", "url": "www.item.ru", "cost": 300.0 } ], "package_id": "ad73dfba-2848-46a6-b49f-7731bed3c37f" } ], "statuses": [ { "code": "DELIVERED", "name": "Delivered", "date_time": "2022-12-02T01:31: 05+0000", "city": "SDEC Office" }, { "code": "CREATED", "name": "Created", "date_time": "2022-12-02T01:30: 10+0000", "city": "SDEC Office" }, { "code": "ACCEPTED", "name": "Accepted", "date_time": "2022-12-02T01:30: 09+0000", "city": "SDEC Office" } ], "is_client_return": false, "delivery_mode": "1", "delivery_date": "2022-12-02", "delivery_detail": { "date": "2022-12-02", "recipient_name": "Ivanov Ivan", "payment_sum": 3500.0, "delivery_sum": 257, "total_sum": 323.68, "payment_info": [] }, "calls": {} }, "requests": [ { "request_uuid": "0323a5ab-157e-4dbb-a08d-9ec8728a2260", "type": "CREATE_CLIENT_RETURN", "date_time": "2022-12-02T01:31:28+0000", "state": "SUCCESSFUL" }, { "request_uuid": "b6aa99cb-c66d-47bd-a0d1-55f138691b59", "type": "CREATE", "date_time": "2022-12-02T01:30:09+0000", "state": "SUCCESSFUL" } ], "related_entities": [ { "uuid": "72753031-6002-4b75-af00-180c751305fc", "type": "client_return_order", "cdek_number": "1108051974" } ] } |
Example of a request with an error for a direct order:
{ "entity": { "uuid": "72753031-f307-4869-ad9f-1a1520dcc82f", "type": 1, "is_return": false, "is_reverse": false, "cdek_number": "1108051975", "number": "1669944871", "tariff_code": 139, "comment": "New order", "items_cost_currency": "RUB", "recipient_currency": "RUB", "sender": { "company": "Pogoda", "name": "Petrov Ilya", "email": "msk@cdek.ru", "phones": [ { "number": "79999999999", "additional": "1234" } ], "passport_requirements_satisfied": false }, "seller": { "name": "Petrov Ilya", "phone": "+79999999999", "ownership_form": "4", "address": "Novosibirsk, Lenina 1" }, "recipient": { "company": "Ivanov Ivan", "name": "Ivanov Ivan", "passport_series": "5008", "passport_number": "345123", "passport_date_of_issue": "2019-03-12", "passport_organization":"Moscow Police Department", "tin": "123546789", "email": "pochta@gmail.com", "phones": [ { "number": "79977777777", "additional": "123" } ], "passport_requirements_satisfied": false }, "from_location": { "code": 270, "city": "Novosibirsk ", "fias_guid": "8dea00e3-9aab-4d8e-887c-ef2aaa546456", "country_code": "RU", "country": "Russia", "region": "Novosibirsk region", " region_code": 23, " longitude": 82.906928, " latitude": 55.028739, " address":" Novosibirsk, Bolshevistskaya 101" }, "to_location": { "code": 44, "city": "Moscow", " fias_guid": "0c5b2444-70a0-4932-980c-b4dc0d3f02b5", "country_code": "RU", "country": "Russia", "region": "Moscow", "region_code": 81, "longitude": 37.622513, "latitude": 55.75322, "address": "32 Blucher St." }, "services": [ { "code": "INSURANCE", "parameter": "300.00", "sum": 2.25 } ], "packages": [ { "number": "bar-001", "weight": 4000, "length": 10, "width": 10, "weight_volume": 200, "weight_calc": 4000, "height": 10, "comment": "inventory attached", "items": [ { "name": "Product", "ware_key": "00055", "marking": "0104630095188367217<GY>No;wZOE5", "payment": { "value": 3000.0, "vat_sum": 0.0 }, "weight": 700, "weight_gross": 700, "amount": 1, "delivery_amount": 0, "name_i18n": "www.item.ru", "url": "www.item.ru", "cost": 300.0 } ], "package_id": "edfe971b-5894-4e92-a964-5b362930ed75" } ], "statuses": [ { "code": "CREATED", "name": "created", "date_time": "2022-12-02T01:34:32+0000", "city": "Офис СДЭК" }, { "code": "ACCEPTED", "name": "Принят", "date_time": "2022-12-02T01:34:31+0000", "city": "Офис СДЭК" } ], "is_client_return": false, "delivery_mode": "1", "delivery_detail": { "delivery_sum": 257, "total_sum": 285.18, "payment_info": [] }, "calls": {} }, "requests": [ { "request_uuid": "2e36a0d1-1f7e-4421-aaa6-0cb1c9e437bc", "type": "CREATE_CLIENT_RETURN", "date_time": "2022-12-02T01:34:49+0000", "state": "INVALID", "errors": [ { "code": "ev_crb_status_not_delivery", "message": "(eng) The order from which the customer refund is being created has not yet been served" } ] }, { "request_uuid": "4c5c09e5-85c7-418a-a9ff-22c4546ca5af", "type": "CREATE", "date_time": "2022-12-02T01:34:31+0000", "state": "SUCCESSFUL" } ] } |
We get information about the return order from the direct order in related entities (related_entities) |
© 2000—2023, Курьерская компания СДЭК