Skip to main content

Cancel an order (JSON)

Cancel a paid order in two steps:

  1. Cancellation preview (quote)POST /json/v2/orders/{orderId}/reshop (see the penalty and refund before committing)
  2. Perform cancellationPOST /json/v2/orders/{orderId}/cancel

This cancels the order built up in the previous walkthroughs ($59 fare + $14 seat + $35 bag = $108 paid). Every request and response was captured live against the test environment.

Step 1: Cancellation preview (quote)

POST /json/v2/orders/MX7NDN465E71/reshop
Request
{
"instruction": { "type": "CancelOrder" },
"passengers": [
{ "paxId": "ADT-1", "type": "ADT" }
]
}

The quote returns the penalty and refund. This order was booked less than 24 hours ago for travel more than 7 days out, so it refunds in full:

Response — 200 OK
{
"data": {
"orderId": "MX7NDN465E71",
"recordLocator": "E2BL5F",
"pax": [
{ "paxId": "ADT-1", "ptc": "ADT" }
],
"offers": [],
"cancellation": {
"offerId": "OF-0bbc85c1-5b2e-4504-85d3-4d844cba5dc3",
"penaltyAmount": { "amount": 0, "currency": "USD" },
"refundAmount": { "amount": 108, "currency": "USD" },
"isRefundable": true
}
},
"error": null
}

Outside the 24-hour window the refund follows the fare's cancellation policy. Applicable penalties are disclosed on every priced offer under fare.penalties. Value may return as flight credit rather than original form of payment (isRefundable: false).

Step 2: Perform cancellation

POST /json/v2/orders/MX7NDN465E71/cancel?ownerCode=MX

No body — just the Authorization header. The order closes and one refund per original payment appears as a negative amount back to the card:

Response — 200 OK
{
"data": {
"order": {
"orderId": "MX7NDN465E71",
"recordLocator": "E2BL5F",
"ownerCode": "MX",
"statusCode": "CLOSED",
"balanceDue": { "amount": 0, "currency": "USD" },
"totalPrice": {
"total": { "amount": 0, "currency": "USD" },
"base": { "amount": 0, "currency": "USD" },
"taxes": [],
"fees": []
},
"items": []
},
"services": [],
"pax": [
{
"paxId": "ADT-1",
"ptc": "ADT",
"name": { "givenName": "Jane", "surname": "Doe" },
"dateOfBirth": "1980-03-01",
"genderCode": "F",
"contactRefId": "CTC-UA"
}
],
"journeys": [],
"payments": [
{ "amount": { "amount": 59, "currency": "USD" }, "statusCode": "SUCCESSFUL" },
{ "amount": { "amount": 14, "currency": "USD" }, "statusCode": "SUCCESSFUL" },
{ "amount": { "amount": 35, "currency": "USD" }, "statusCode": "SUCCESSFUL" },
{ "amount": { "amount": -59, "currency": "USD" }, "statusCode": "PENDING" },
{ "amount": { "amount": -14, "currency": "USD" }, "statusCode": "PENDING" },
{ "amount": { "amount": -35, "currency": "USD" }, "statusCode": "PENDING" }
],
"tickets": []
},
"error": null
}

Refund payments start PENDING and settle asynchronously. A cancelled order stays retrievable — order retrieve keeps returning it with statusCode: "CLOSED".

Notes

  • Hold (unpaid) bookings don't need a quote — cancel them with a change order CancelUnpaidOrder change.
  • Cancelling one journey of a multi-journey order uses the CancelJourney change instead.
  • The reshop quote is informational for a full cancel — the commit recomputes penalty and refund from live booking state at execution time.

Full schema reference: reshop order.