Skip to content

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 ​

ParameterTypeRequiredDescription
AuthorizationStringYesBearer <token> from Login

Path Parameters ​

ParameterTypeRequiredDescription
order_idStringYesProvider order id (Order.id returned by Create Order)

Query Parameters ​

ParameterTypeRequiredDescription
localeStringNoLocalises 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.

ParameterTypeRequiredDescription
└ reasonStringNoFree-text cancellation reason (e.g. timeout, customer_request)
└ positions[Object]NoTickets to cancel. Omit (or send empty) to cancel the whole order; supply a subset to cancel individual tickets
  └ positionStringYesTicket 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 ​

codemessageDescription
UNAUTHORIZEDInvalid tokenThe bearer token is missing, invalid, or expired (401).
NOT_FOUNDOrder not foundNo order exists for the supplied order_id.
NOT_CANCELABLEOrder cannot be cancelledThe order is already canceled or expired.

TTN Octo API documentation