Skip to content
FX-Port/Docs
GuidesAPI referenceChangelog
Get API keys
  • Introduction
  • Quickstart
  • Security
  • Authentication
  • Environments and Postman
  • Sandbox
  • Conventions and naming
  • Legacy names and twins
  • Errors
  • Rate limits and fair use
  • Streaming search results

Concepts

  • Overview
  • Booking flows
  • Passengers and ages
  • Pricing
  • Post-booking operations

Search and price

  • Airport autocomplete
  • Search flights
  • Basic routes
  • Passengers and cabins
  • Filters
  • Supplier selection
  • Open-jaw and multi-city
  • Flexible dates
  • Price an offer

Book, pay and cancel

  • Book
  • Quote a held booking
  • Pay a held booking
  • Cancel a held booking
  • Quote a cancellation
  • Confirm a cancellation

After booking

  • Get a booking
  • Get the ticket PDF
  • Get the ticket number
  • ACD passport uploads
  • Use these docs with AI

Flights · Book, pay and cancel

Quote a cancellation

Ask what cancelling an issued Duffel order would refund. Nothing is cancelled until you confirm it.

POST/api/v1/flights/cancel_quote

Ask what cancelling an issued Duffel order would refund. The call creates a pending cancellation at the supplier with the refund amount; nothing is cancelled and no money moves until you confirm it with confirm_cancel.

Permission: Read. Rate group: default (6,000 requests per minute per key). Only Duffel orders: an order of another supplier is answered 400.

Only the confirmation cancels. A quote is valid for one hour (cancellation.expiresAt). The amount is the supplier's offer for that moment: ask again if you wait. Whether an order can be cancelled at all depends on the airline and the fare: many fares answer order_not_cancellable.

This is the self-serve refund path of Duffel orders. Held reservations are cancelled with cancel_order; void, exchange and refund of Amadeus Algeria tickets are manual: see Post-booking operations.

Request body

FieldTypeRequiredDescription
order_idstringYesThe supplier's order id of the booking (ord_..., the booking.reference of the booking response, amadeus_id in get_booking). booking_id and pnr are accepted as other names of the same field (the first one present wins): FX-Port finds the booking of your agency and sends the supplier's own order id to Duffel, so a PNR works too. Prefer the order id: a PNR is not unique.
supplier_idstringNoDefault duffel_1. A value that does not start with duffel is 400.

Legacy names: orderId, bookingId, supplierId. If order_id, booking_id and pnr hold different values, the first one wins and an ignored_field warning names the others. Only bookings of your agency in the environment of your key can be quoted: an unknown order and the order of another agency are both 404 booking_not_found, before the supplier is asked.

Request example

curl https://api.fx-port.com/api/v1/flights/cancel_quote \
  -H "Authorization: Bearer fxp_test_YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "order_id": "ord_0000BC0VDONwA54LrfoCkm"
}'

Response example

A refundable Duffel order (real response of 2026-11-01). The airline refunds USD 76.86, FX-Port credits DZD 19,215.00 to the balance of the agency:

{
  "environment": "sandbox",
  "success": true,
  "requestId": "2cb63f69",
  "orderId": "ord_0000BC0VDONwA54LrfoCkm",
  "processingTime": 0.128,
  "cancellation": {
    "cancellationId": "ore_0000BC0VG9WBaFAZ83u3yy",
    "orderId": "ord_0000BC0VDONwA54LrfoCkm",
    "status": "pending",
    "refund": {
      "originalRefundCurrency": "USD",
      "originalRefundAmount": 76.86,
      "refundCurrency": "DZD",
      "refundAmount": 19215.0,
      "refundTo": "FX-Port Balance",
      "refundToRaw": "balance",
      "convertedSupplierRefundAmount": 19215.0,
      "isFullBalanceRefund": false,
      "kioskCommissionRefund": 0.0
    },
    "expiresAt": "2026-11-01T15:28:32Z",
    "confirmedAt": null,
    "createdAt": "2026-11-01T14:28:32.488592Z",
    "airlineCredits": null,
    "liveMode": false
  },
  "supplier": { "id": "duffel_1", "technology": "duffel", "name": "Duffel" },
  "agency": { "currency": "DZD" },
  "exchangeRate": { "rate": 250.0, "marginPercent": 0.0, "fromCurrency": "USD", "toCurrency": "DZD" },
  "meta": { "quoteValidUntil": "2026-11-01T15:28:32Z", "isConfirmed": false, "canConfirm": true }
}

Field meanings

FieldMeaning
cancellation.cancellationIdore_...: the id to send to confirm_cancel (twin: cancellation_id).
cancellation.statuspending until confirmed.
cancellation.refund.refundAmount, refundCurrencyWhat your balance receives, in the agency currency.
cancellation.refund.originalRefundAmount, originalRefundCurrencyThe airline's amount in the supplier's currency.
cancellation.refund.refundTo, refundToRawFX-Port Balance and balance: the refund goes to your FX-Port balance.
cancellation.refund.isFullBalanceRefundWhether the refund covers the whole price.
cancellation.refund.kioskCommissionRefundA commission refund, when there is one.
cancellation.expiresAt, meta.quoteValidUntilThe end of the validity of the quote, in UTC.
cancellation.airlineCreditsAn airline credit instead of money, when the airline offers one; null otherwise.
meta.canConfirmtrue when confirm_cancel will be accepted.
exchangeRateThe rate between the supplier's currency and yours, as an object.

Errors

The supplier's refusals are 200 answers with success: false (read success): errors[0].type is supplier_error.

Whereerror.codeMeaning
200, success: falseorder_not_cancellable"This order cannot be cancelled through the API." The airline or the fare does not allow it; use Post-booking operations.
200, success: falsealready_cancelledThe order was cancelled before.
200, success: falsenot_foundFX-Port knows the booking but Duffel does not know the order.
400bad_requestNone of order_id, booking_id and pnr was sent (Missing required parameter: order_id), or the supplier is not Duffel.
400invalid_booking_id, invalid_supplier_selectionAn id or the supplier_id is not a valid token.
404booking_not_foundNo booking of your agency in this environment has this reference. An unknown order and the order of another agency are answered the same.

Related

  • Confirm cancel (the next step) and Post-booking operations.
  • Get a flight booking: after the confirmation the status is partial_refund.
PreviousCancel a held bookingNext Confirm a cancellation

On this page

  • Request body
  • Request example
  • Response example
  • Field meanings
  • Errors
  • Related

© 2026 FX-Port

TermsPrivacy[email protected]