Cancellation of the order by the buyer
The method is available for the DBS model.
If you are using an API Key token, one of the accesses in the list is required to call the method
- inventory-and-order-processing — Order processing and inventory
- all-methods — Full account management
Confirms or rejects the buyer's request to cancel the order, which has been sent to the delivery service.
The buyer can cancel the order during its processing or delivery. If the order is still being processed (status PROCESSING
), you do not need to confirm the cancellation of the order — it will be canceled automatically.
If the order has already been sent to the delivery service (status DELIVERY
or PICKUP
) and the user cancelled it, you can notify the cancellation service within 48 hours.
- The delivery service found out about the cancellation before handing over the order to the buyer. Confirm the cancellation with a request PUT campaigns/{campaignId}/orders/{orderId}/cancellation/accept.
- The order has already been delivered — reject the cancellation using the same request. Then the customer will still have the order, and the money for it will not be refunded.
How to find out about cancelled orders:
- Send a request GET campaigns/{campaignId}/orders. Add the input parameter to its URL
onlyWaitingForCancellationApprove=true
. - In the office or via email, you will receive a cancellation notification.
- Enable API notifications. Yandex.Market will send you a request. POST notification when there is a new request to cancel the order. How to work with notifications
If you do not confirm or reject the cancellation within 48 hours, the order will be cancelled automatically.
, Limit: 500 requests per hour |
---|
Request
PUT
https://api.partner.market.yandex.ru/campaigns/{campaignId}/orders/{orderId}/cancellation/accept
Path parameters
Name |
Description |
campaignId* |
Type: integer<int64> The campaign ID. You can find it using a query GET campaigns or find it in the seller's office on the Market — click on the name of your business and go to the page:
, Do not send the store ID instead, which is indicated in the seller's account on the Market next to the store name and in some reports.
Min value: |
orderId* |
Type: integer<int64> The order ID. |
Body
application/json
{
"accepted": false,
"reason": "ORDER_DELIVERED"
}
Name |
Description |
accepted* |
Type: boolean The decision to cancel the order:
|
reason |
Type: OrderCancellationReasonType The reason why the order cannot be cancelled (it is communicated to the buyer). Required parameter if you pass Enum: |
OrderCancellationReasonType
Possible reasons why the order cannot be cancelled.
ORDER_DELIVERED
— the order has already been delivered.ORDER_IN_DELIVERY
— the order is already with the courier.
Type |
Description |
Enum: |
Responses
200 OK
The response to the order cancellation was successfully transmitted.
Body
application/json
{
"status": "OK"
}
Name |
Description |
status |
Type: ApiResponseStatusType The type of response. Possible values:
Enum: |
ApiResponseStatusType
The type of response. Possible values:
OK
— there are no mistakes.ERROR
— an error occurred while processing the request.
Type |
Description |
Enum: |
400 Bad Request
The request contains incorrect data. More information about the error
Body
application/json
{
"status": "OK",
"errors": [
{
"code": "string",
"message": "string"
}
]
}
Name |
Description |
errors |
Type: ApiErrorDTO[] A list of errors. Min items: |
status |
Type: ApiResponseStatusType The type of response. Possible values:
Enum: |
ApiErrorDTO
The general error format.
Name |
Description |
code* |
Type: string The error code. |
message |
Type: string Description of the error. |
401 Unauthorized
The authorization data is not specified in the request. More information about the error
Body
application/json
{
"status": "OK",
"errors": [
{
"code": "string",
"message": "string"
}
]
}
Name |
Description |
errors |
Type: ApiErrorDTO[] A list of errors. Min items: |
status |
Type: ApiResponseStatusType The type of response. Possible values:
Enum: |
403 Forbidden
The authorization data is incorrect or access to the resource is prohibited. More information about the error
Body
application/json
{
"status": "OK",
"errors": [
{
"code": "string",
"message": "string"
}
]
}
Name |
Description |
errors |
Type: ApiErrorDTO[] A list of errors. Min items: |
status |
Type: ApiResponseStatusType The type of response. Possible values:
Enum: |
404 Not Found
The requested resource was not found. More information about the error
Body
application/json
{
"status": "OK",
"errors": [
{
"code": "string",
"message": "string"
}
]
}
Name |
Description |
errors |
Type: ApiErrorDTO[] A list of errors. Min items: |
status |
Type: ApiResponseStatusType The type of response. Possible values:
Enum: |
420 Method Failure
The resource access limit has been exceeded. More information about the error
Body
application/json
{
"status": "OK",
"errors": [
{
"code": "string",
"message": "string"
}
]
}
Name |
Description |
errors |
Type: ApiErrorDTO[] A list of errors. Min items: |
status |
Type: ApiResponseStatusType The type of response. Possible values:
Enum: |
500 Internal Server Error
Internal error of Yandex. Market. More information about the error
Body
application/json
{
"status": "OK",
"errors": [
{
"code": "string",
"message": "string"
}
]
}
Name |
Description |
errors |
Type: ApiErrorDTO[] A list of errors. Min items: |
status |
Type: ApiResponseStatusType The type of response. Possible values:
Enum: |
No longer supported, please use an alternative and newer version.