Cancel Order
Cancels the order — fully, or per-ticket when positions is supplied — and returns the amounts actually refunded per ticket (the same conditions shape as Cancel Conditions and Refund).
INFO
The provider applies any cancellation penalty according to its own rules and the time of the request; the caller does not pre-compute the penalty window. Use Cancel Conditions first to preview the refund.
Endpoint
Method: POST
URL: /v1/order/{order_id}/cancel
Request Headers
| Parameter | Type | Required | Description |
|---|---|---|---|
| Authorization | String | Yes | Bearer <token> from Login |
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| order_id | String | Yes | Provider order id (Order.id returned by Create Order) |
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| locale | String | No | Localises the human-readable refund notes, refer to Locale List |
Request Parameters
The request body is optional. Omit it (or omit positions) to cancel the whole order.
| Parameter | Type | Required | Description |
|---|---|---|---|
| └ reason | String | No | Free-text cancellation reason (e.g. timeout, customer_request) |
| └ positions | [Object] | No | Tickets to cancel. Omit (or send empty) to cancel the whole order; supply a subset to cancel individual tickets |
| └ position | String | Yes | Ticket code to cancel (matches OrderTicket.code) |
Request Example
json
{
"reason": "customer_request",
"positions": [
{ "position": "BK-9931" }
]
}Response Parameters
The response is identical in shape to Cancel Conditions: a conditions object with per-ticket RefundTicket lines. The amounts reflect the realised refund after cancellation.
Response Example
json
{
"conditions": {
"can_be_canceled": false,
"currency": "UAH",
"tickets": [
{
"ticket_code": "BK-9931",
"currency": "UAH",
"refund_amount": 585.0,
"refund_fee_amount": 65.0,
"full_refund": false,
"route_changed": false
}
]
}
}Error Code List
| code | message | Description |
|---|---|---|
| UNAUTHORIZED | Invalid token | The bearer token is missing, invalid, or expired (401). |
| NOT_FOUND | Order not found | No order exists for the supplied order_id. |
| NOT_CANCELABLE | Order cannot be cancelled | The order is already canceled or expired. |