/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: 2048

Body

application/json
{
    "externalOperationId": "string",
    "reason": "string"
}

Name

Description

reason*

Type: string

Cancellation reason

Max length: 2048

externalOperationId

Type: string

Operation ID

Max length: 2048

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: 200

data

Type: OperationResponseData

status

Type: string

Default: success

Enum: success

OperationResponseData

Name

Description

operation

Type: Operation

Operation

Name

Description

amount*

Type: string<double>

Transaction amount in a fiat currency

Example: 123.45

operationId*

Type: string<uuid>

Max length: 2048

operationType*

Type: string

Enum: AUTHORIZE, BIND_CARD, REFUND, CAPTURE, VOID, RECURRING, PREPAYMENT, SUBMIT

orderId*

Type: string

Max length: 2048

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: 2048

params

Type: object

pointsAmount

Type: string<double>

Transaction amount in Plus points

Example: 123.45

reason

Type: string

Error cause

Max length: 2048

status

Type: string

Default: PENDING

Enum: PENDING, SUCCESS, FAIL

updated

Type: string<date-time>

Date and time when the operation was updated (ISO 8601)