/v1/orders/{order_id}/cancel
Request to cancel the payment.
Available only for payments in AUTHORIZED status.
On success, the payment status will change to VOIDED.
Request
POST
https://pay.yandex.ru/api/merchant/v1/orders/{order_id}/cancel
        
    Production
POST
https://sandbox.pay.yandex.ru/api/merchant/v1/orders/{order_id}/cancel
        
    Sandbox
Path parameters
| 
 Name  | 
 Description  | 
| 
 order_id*  | 
 Type: string Order ID on the merchant's side that was passed in response to /order/create. Max length:   | 
Body
application/json
{
    "externalOperationId": "string",
    "reason": "string"
}
        
    | 
 Name  | 
 Description  | 
| 
 reason*  | 
 Type: string Cancellation reason Max length:   | 
| 
 externalOperationId  | 
 Type: string Operation ID Max length:   | 
Responses
200 OK
Body
application/json
{
    "code": 200,
    "data": {
        "operation": {
            "amount": "123.45",
            "created": "2022-12-29T18:02:01Z",
            "externalOperationId": "string",
            "operationId": "c3073b9d-edd0-49f2-a28d-b7ded8ff9a8b",
            "operationType": "AUTHORIZE",
            "orderId": "string",
            "params": {},
            "pointsAmount": "123.45",
            "reason": "string",
            "status": "PENDING",
            "updated": "2022-12-29T18:02:01Z"
        }
    },
    "status": "success"
}
        
    | 
 Name  | 
 Description  | 
| 
 code  | 
 Type: number Default:   | 
| 
 data  | 
 Type: OperationResponseData  | 
| 
 status  | 
 Type: string Default:  Enum:   | 
OperationResponseData
| 
 Name  | 
 Description  | 
| 
 operation  | 
 Type: Operation  | 
Operation
| 
 Name  | 
 Description  | 
| 
 amount*  | 
 Type: string<double> Transaction amount in a fiat currency Example:   | 
| 
 operationId*  | 
 Type: string<uuid> Max length:   | 
| 
 operationType*  | 
 Type: string Enum:   | 
| 
 orderId*  | 
 Type: string Max length:   | 
| 
 created  | 
 Type: string<date-time> Date and time when the operation was created (ISO 8601)  | 
| 
 externalOperationId  | 
 Type: string Operation ID on the merchant side Max length:   | 
| 
 params  | 
 Type: object  | 
| 
 pointsAmount  | 
 Type: string<double> Transaction amount in Plus points Example:   | 
| 
 reason  | 
 Type: string Error cause Max length:   | 
| 
 status  | 
 Type: string Default:  Enum:   | 
| 
 updated  | 
 Type: string<date-time> Date and time when the operation was updated (ISO 8601)  | 
No longer supported, please use an alternative and newer version.