/v1/orders/{order_id}/cancel

Request to cancel an order.

Only available for payments in the AUTHORIZED status. If successful, the payment status changes to VOIDED.

Request

POST

https://pay.yandex.uz/api/merchant/v1/orders/{order_id}/cancel

Production

POST

https://sandbox.pay.yandex.uz/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 the /orders request when creating the order.

Max length: 2048

Example: ``

Body

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

Name

Description

reason

Type: string

Cancellation reason

Max length: 2048

Example: example

externalOperationId

Type: string

Operation ID

Max length: 2048

Example: example

Responses

200 OK

Body

application/json
{
  "code": 200,
  "data": {
    "operation": {
      "amount": "123.45",
      "created": "2025-01-01T00:00:00Z",
      "externalOperationId": "example",
      "operationId": "123e4567-e89b-12d3-a456-426614174000",
      "operationType": "AUTHORIZE",
      "orderId": "example",
      "params": {},
      "pointsAmount": "123.45",
      "reason": "example",
      "status": "PENDING",
      "updated": "2025-01-01T00:00:00Z"
    }
  },
  "status": "success"
}

Name

Description

code

Type: unknown

Default: 200

data

Type: object

operation

Type: object

amount

Type: string<double>

Transaction amount in a fiat currency

Example: 123.45

operationId

Type: string<uuid>

Max length: 2048

Example: 123e4567-e89b-12d3-a456-426614174000

operationType

Type: string

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

orderId

Type: string

Max length: 2048

Example: example

created

Type: string<date-time>

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

Example: 2025-01-01T00:00:00Z

externalOperationId

Type: string

Operation ID on the merchant side

Max length: 2048

Example: example

params

Type: object

Example
{}

pointsAmount

Type: string<double>

Unavailable in Uzbekistan.

Example: 123.45

reason

Type: string

Error cause

Max length: 2048

Example: example

status

Type: string

Default: PENDING

Enum: PENDING, SUCCESS, FAIL

updated

Type: string<date-time>

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

Example: 2025-01-01T00:00:00Z

Example
{
  "amount": "123.45",
  "created": "2025-01-01T00:00:00Z",
  "externalOperationId": "example",
  "operationId": "123e4567-e89b-12d3-a456-426614174000",
  "operationType": "AUTHORIZE",
  "orderId": "example",
  "params": {},
  "pointsAmount": "123.45",
  "reason": "example",
  "status": "PENDING",
  "updated": "2025-01-01T00:00:00Z"
}
Example
{
  "operation": {
    "amount": "123.45",
    "created": "2025-01-01T00:00:00Z",
    "externalOperationId": "example",
    "operationId": "123e4567-e89b-12d3-a456-426614174000",
    "operationType": "AUTHORIZE",
    "orderId": "example",
    "params": {},
    "pointsAmount": "123.45",
    "reason": "example",
    "status": "PENDING",
    "updated": "2025-01-01T00:00:00Z"
  }
}

status

Type: string

Default: success

Const: success