# Pay a held order and issue the tickets

> Pay for a held booking and issue the tickets.

Endpoint: `POST /flights/pay_order`

Source: https://fx-port.com/docs/api/pay-order

`POST /api/v1/flights/pay_order`

Requires an API key with **Read+Write** permission: a Read key is refused with `read_write_permission_required`.

The agency balance is debited by `pricing.b2bPrice`; in the sandbox no money moves.

The amount and the currency come from the stored booking: do **not** send `currency` (`400 bad_request`); an `amount` is ignored. Send one of `order_id` (the supplier's order id, **preferred**), `booking_id` and `pnr`. `payment_type` is `balance` (default), `card` or `arc_bsp_cash`; only Duffel reads it, Amadeus Algeria pays from the balance whatever you send. A Duffel order that was bought instantly cannot be paid later.

**A refusal of the supplier is HTTP `200` with `success: false` and `paymentSucceeded: false`**: the status alone is not enough, read both. `error.code` is a number as text for Amadeus (`4926`: the order is already issued; `9112`: the reservation is cancelled or expired) and a name for Duffel. Do not retry a payment blindly: read the booking with `get_booking` first. A second `pay_order` for an order that is paid answers `4926`, which is harmless. The exception is `503 balance_lock_timeout` (live only): another operation of your agency held the balance for a moment, the payment never started, and the same request can be sent again after a few seconds.

## Request

### Body

Required, JSON.

- `order_id` (string, optional): The supplier's order id (`booking.reference` of the booking response). **Preferred**.
- `booking_id` (string, optional): The PNR of the booking.
- `pnr` (string, optional): The airline record locator.
- `payment_type` (string, optional): Only Duffel reads it; Amadeus Algeria and Travelport pay from the balance whatever you send. Default `balance`. One of `balance`, `card`, `arc_bsp_cash`. Default `balance`.
- `three_d_secure_session_id` (string, optional): For a Duffel card payment that needs 3-D Secure.
- `price_guaranteed` (boolean, optional): Default `true`: pay the price of the hold. Leave it out.
- `supplier_id` (string, optional): Only used when the booking has no supplier of its own.
- `agency_id` (string, optional): Not needed: the agency of a call is always the one of your API key. The field is accepted so that older clients keep working, and it is ignored.
- `orderId` (string, deprecated, optional): Legacy name: use `order_id`. The previous spelling of `order_id`: The supplier's order id (`booking.reference` of the booking response).
- `bookingId` (string, deprecated, optional): Legacy name: use `booking_id`. The previous spelling of `booking_id`: The PNR of the booking.
- `paymentType` (string, deprecated, optional): Legacy name: use `payment_type`. The previous spelling of `payment_type`: Only Duffel reads it; Amadeus Algeria and Travelport pay from the balance whatever you send.
- `threeDSecureSessionId` (string, deprecated, optional): Legacy name: use `three_d_secure_session_id`. The previous spelling of `three_d_secure_session_id`: For a Duffel card payment that needs 3-D Secure.
- `priceGuaranteed` (boolean, deprecated, optional): Legacy name: use `price_guaranteed`. The previous spelling of `price_guaranteed`: Default `true`: pay the price of the hold.
- `supplierId` (string, deprecated, optional): Legacy name: use `supplier_id`. The previous spelling of `supplier_id`: Only used when the booking has no supplier of its own.
- `agencyId` (string, deprecated, optional): Legacy name: use `agency_id`. The previous spelling of `agency_id`: Not needed: the agency of a call is always the one of your API key.

### Example request

```bash
curl https://api.fx-port.com/api/v1/flights/pay_order \
  -H "Authorization: Bearer fxp_test_YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "order_id": "eJzTd9ePNA9wdA0FAAs8AmE",
  "payment_type": "balance"
}'
```

## Response

### 200: The paid order. `success: false` with `paymentSucceeded: false` and `error` when the supplier refused the payment.

- `environment` (string): The environment of the key that made the call: `sandbox` for fxp_test_ keys, `live` for fxp_live_ keys. Present in every JSON body. One of `sandbox`, `live`.
- `request_id` (string): The id of the request, also in the `X-Request-Id` header.
- `warnings` (array of object): Present only when the request used a previous spelling of a field or something the endpoint ignored.
  - `code` (string): What the warning is about. One of `deprecated_field`, `ignored_field`, `coerced_value`, `deprecated_value`, `deprecated_endpoint`.
  - `field` (string): The request field the warning is about.
  - `replacement` (string): The name to use instead, for `deprecated_*` warnings.
  - `message` (string): A sentence that says what happened and what to do.
  - `documentation_url` (string): Where the naming rules are explained.
- `success` (boolean): `true` when the order was created (booking) or paid (payment).
- `requestId` (string, deprecated): Legacy name: use `request_id`. The id of this request, 8 characters, for support.
- `paymentSucceeded` (boolean): `pay_order` only: whether the payment succeeded. Read it together with `success`.
- `searchId` (string, deprecated): Legacy name: use `search_id`. `book_flight` only: the `search_id` you sent.
- `search_id` (string): `book_flight` only: the `search_id` you sent. The snake_case twin of `searchId`, with the same value: use this name.
- `offerId` (string, deprecated): Legacy name: use `offer_id`. `book_flight` only: the `offer_id` you sent.
- `offer_id` (string): `book_flight` only: the `offer_id` you sent. The snake_case twin of `offerId`, with the same value: use this name.
- `orderId` (string, deprecated): Legacy name: use `order_id`. `pay_order` only: the supplier's order id.
- `order_id` (string): `pay_order` only: the supplier's order id. The snake_case twin of `orderId`, with the same value: use this name.
- `processingTime` (number, deprecated): Legacy name: use `processing_time`. Seconds spent.
- `processing_time` (number): Seconds spent. The snake_case twin of `processingTime`, with the same value: use this name.
- `paymentDetails` (object): `pay_order` only: `paymentId`, `status`, `type` (`issuance`), `paymentAmount`, `currency`, `createdAt`, `message`.
- `booking` (object): The order as the supplier knows it.
  - `reference` (string, deprecated): Legacy name: use `order_id`. The supplier's order id (`ord_...` for Duffel, a base64-like text for Amadeus; for a cancelled hold of Amadeus Algeria the PNR). Send it as `order_id` to `pay_order`, `cancel_order` and `cancel_quote`.
  - `order_id` (string): The supplier's order id (`ord_...` for Duffel, a base64-like text for Amadeus; for a cancelled hold of Amadeus Algeria the PNR). Send it as `order_id` to `pay_order`, `cancel_order` and `cancel_quote`. The snake_case twin of `reference`, with the same value: use this name.
  - `status` (string): `confirmed`, `pending` (a hold that is not paid yet), `awaiting_payment`, `cancelled`, `failed` or `partial_refund`.
  - `pnr` (string): The airline record locator. Not unique across suppliers and airlines.
  - `type` (string): `instant`: ticketed at once. `hold`: reserved, not paid. One of `instant`, `hold`.
  - `createdAt` (string): When the order was created.
  - `cancelledAt` (string, nullable): When the order was cancelled.
  - `content` (string): Who manages the order: `managed`.
  - `syncedAt` (string): When FX-Port last synchronised the order with the supplier.
  - `availableActions` (array of string): What can still be done with the order.
  - `voidableUntil` (string, nullable): ISO 8601 UTC end of the same-day void window.
  - `cancellation` (object, nullable): How the order was cancelled: `type`, `deleted`, `deletedAt`.
- `supplier` (object): The supplier of the order.
  - `id` (string, deprecated): Legacy name: use `supplier_id`. Id of the supplier.
  - `supplier_id` (string): Id of the supplier. The snake_case twin of `id`, with the same value: use this name.
  - `technology` (string): The technology of the supplier: `amadeus_aqc` or `duffel`.
  - `name` (string, deprecated): Legacy name: use `supplier_name`. Name of the supplier.
  - `supplier_name` (string): Name of the supplier. The snake_case twin of `name`, with the same value: use this name.
  - `offerId` (string, nullable, deprecated): Legacy name: use `supplier_offer_id`. The supplier's own id of the offer.
  - `supplier_offer_id` (string, nullable): The supplier's own id of the offer. The snake_case twin of `offerId`, with the same value: use this name.
- `agency` (object): Your agency. The id of the agency is not returned: you know it.
  - `currency` (string): ISO 4217 currency of your agency. Every amount of the response is in it.
- `pricing` (object): The agency-facing price of an offer, a booking or a quote. Every amount is in `agencyCurrency`; the rate, when the currencies differ, is `exchangeRate` at the top level of the response.
  - `supplierCurrency` (string): ISO 4217 currency in which the supplier prices the fare.
  - `agencyCurrency` (string): ISO 4217 currency of your agency. Every amount of the block is in it.
  - `basePrice` (number, deprecated): Legacy name: use `base_price`. The airline's base fare, before taxes, in the agency currency.
  - `base_price` (number): The airline's base fare, before taxes, in the agency currency. The snake_case twin of `basePrice`, with the same value: use this name.
  - `taxesAndFees` (number, deprecated): Legacy name: use `taxes_and_fees`. Taxes plus the platform's fees, folded together. Excludes your agency commission.
  - `taxes_and_fees` (number): Taxes plus the platform's fees, folded together. Excludes your agency commission. The snake_case twin of `taxesAndFees`, with the same value: use this name.
  - `agencyCommission` (number, deprecated): Legacy name: use `agency_commission`. The commission of your agency on this sale.
  - `agency_commission` (number): The commission of your agency on this sale. The snake_case twin of `agencyCommission`, with the same value: use this name.
  - `finalPrice` (number, deprecated): Legacy name: use `final_price`. What the traveler pays: `basePrice + taxesAndFees + agencyCommission`.
  - `final_price` (number): What the traveler pays: `basePrice + taxesAndFees + agencyCommission`. The snake_case twin of `finalPrice`, with the same value: use this name.
  - `b2bPrice` (number, deprecated): Legacy name: use `b2b_price`. The amount debited from your agency balance: `finalPrice - agencyCommission`.
  - `b2b_price` (number): The amount debited from your agency balance: `finalPrice - agencyCommission`. The snake_case twin of `b2bPrice`, with the same value: use this name.
  - `totalAmount` (number): Order quote only: an alias of `b2bPrice`.
  - `taxAmount` (number): Order quote of a Duffel order only: the airline's taxes in your agency currency.
  - `originalTaxAmount` (number): Order quote of a Duffel order only: the same taxes in the supplier currency.
  - `additionalServices` (array of object): Paid extras. A list in the offers of a search (empty for most offers).
  - `acd` (object): Whether the fare is an ACD fare. Present on the offers of Amadeus Algeria, absent on Duffel offers. An ACD fare carries more keys with the amounts of the adjustment: they are informational, can change without notice and are not part of the contract.
    - `applied` (boolean): `true` for an ACD fare: the booking needs one passport copy for every traveler, sent with `upload_acd_documents`. `false` for an ordinary fare.
    - `scenario` (string): Only on an ACD fare: the rule that adjusted the price. Informational. One of `A`, `B`.
    - `exempt` (boolean): `true` when the search named an ACD-exempt company of your agency: the fare is priced without ACD.
    - `reason` (string): Only on some ACD fares: why the rule applied. Informational; the wording can change.
- `requiresACD` (boolean): Present only when `true`: the booking needs one passport copy for every traveler: see `upload_acd_documents`.
- `payment` (object): The payment state of the order.
  - `status` (string): `awaiting_payment` for a hold, `paid` once ticketed.
  - `paidAt` (string, nullable): When the order was paid.
  - `paymentRequiredBy` (string, nullable): The payment deadline of a hold, when the supplier gives one.
  - `priceGuaranteeExpiresAt` (string, nullable): Until when the price is guaranteed.
  - `awaitingPayment` (boolean): `true` for a hold that still has to be paid.
- `documents` (array of object): The e-tickets. Empty for a hold.
  - `type` (string): `electronic_ticket`.
  - `uniqueIdentifier` (string): The ticket number (Duffel sandbox: the text `1`).
  - `passengerIds` (array of string): The passengers the document is for.
  - `documentType` (string): `ETICKET`.
  - `status` (string): `ISSUED`.
  - `segmentIds` (array of string): The segments the document covers.
- `bookingReferences` (array of object): The record locators.
  - `pnr` (string): The airline record locator.
  - `carrier` (object): The airline that issued the record locator.
    - `iataCode` (string): IATA code of the airline.
    - `name` (string): Name of the airline.
    - `logoUrl` (string): Address of the logo.
    - `logoLockupUrl` (string, nullable): Address of the wide logo.
- `passengers` (array of object): The passengers.
  - `id` (string, deprecated): Legacy name: use `passenger_id`. Id of the passenger on the order: `"1"` (Amadeus) or `pas_...` (Duffel).
  - `passenger_id` (string): Id of the passenger on the order: `"1"` (Amadeus) or `pas_...` (Duffel). The snake_case twin of `id`, with the same value: use this name.
  - `type` (string, deprecated): Legacy name: use `passenger_type`. `ADULT`, `CHILD`, `INFANT_WITHOUT_SEAT` ... as the supplier writes it.
  - `passenger_type` (string): `ADULT`, `CHILD`, `INFANT_WITHOUT_SEAT` ... as the supplier writes it. The snake_case twin of `type`, with the same value: use this name.
  - `title` (string): `mr`, `mrs` ... derived from the gender.
  - `givenName` (string, deprecated): Legacy name: use `first_name`. Given name, as stored (Amadeus writes it in upper case).
  - `first_name` (string): Given name, as stored (Amadeus writes it in upper case). The snake_case twin of `givenName`, with the same value: use this name.
  - `familyName` (string, deprecated): Legacy name: use `last_name`. Family name, as stored.
  - `last_name` (string): Family name, as stored. The snake_case twin of `familyName`, with the same value: use this name.
  - `gender` (string): `male` or `female`.
  - `bornOn` (string, deprecated): Legacy name: use `date_of_birth`. Date of birth, `YYYY-MM-DD`.
  - `date_of_birth` (string): Date of birth, `YYYY-MM-DD`. The snake_case twin of `bornOn`, with the same value: use this name.
  - `email` (string): The e-mail of the contact.
  - `phoneNumber` (string, deprecated): Legacy name: use `phone_number`. The phone number of the contact.
  - `phone_number` (string): The phone number of the contact. The snake_case twin of `phoneNumber`, with the same value: use this name.
  - `infantPassengerId` (string, nullable): The id of the lap infant this adult carries.
  - `loyaltyProgrammeAccounts` (array of object): Frequent-flyer accounts.
  - `ticketNumber` (string, nullable): The ticket number of this passenger. `null` until the airline returns it.
- `travelerPricing` (array of object): The price of each traveler.
  - `travelerId` (string, deprecated): Legacy name: use `passenger_id`. `"1"`, `"2"` ... for Amadeus, `pas_...` for Duffel.
  - `passenger_id` (string): `"1"`, `"2"` ... for Amadeus, `pas_...` for Duffel. The snake_case twin of `travelerId`, with the same value: use this name.
  - `travelerType` (string, deprecated): Legacy name: use `passenger_type`. `ADULT`, `SENIOR`, `YOUNG`, `CHILD`, `SEATED_INFANT` or `HELD_INFANT` (a lap infant).
  - `passenger_type` (string): `ADULT`, `SENIOR`, `YOUNG`, `CHILD`, `SEATED_INFANT` or `HELD_INFANT` (a lap infant). The snake_case twin of `travelerType`, with the same value: use this name.
  - `fareOption` (string): The fare option, for example `STANDARD`.
  - `price` (object): The price of one traveler.
    - `supplierCurrency` (string): ISO 4217 currency in which the supplier prices the fare.
    - `agencyCurrency` (string): ISO 4217 currency of your agency.
    - `base` (number): The traveler's base fare in the agency currency.
    - `total` (number): The traveler's final price: what this traveler pays. The totals of all travelers add up to `pricing.finalPrice`.
    - `b2bPrice` (number): The traveler's share of the amount debited from your balance.
  - `fareDetailsBySegment` (array of object): The fare of this traveler on every segment.
    - `segmentId` (string): The `id` of the segment this fare detail is about.
    - `cabin` (string): Cabin of the fare on this segment. One of `ECONOMY`, `PREMIUM_ECONOMY`, `BUSINESS`, `FIRST`.
    - `fareBasis` (string, nullable): Fare basis code.
    - `brandedFare` (string, nullable): Fare family code.
    - `brandedFareLabel` (string, nullable): Display label of the fare family.
    - `bookingClass` (string, nullable): Booking class letter.
    - `includedCheckedBags` (object): The checked baggage included in the fare.
      - `quantity` (integer): Number of checked bags included in the fare.
    - `includedCabinBags` (object): The cabin baggage included in the fare.
      - `quantity` (integer): Number of cabin bags included in the fare.
    - `amenities` (array of object): What else the fare includes or sells (seat, bag, meal, Wi-Fi ...).
- `itinerary` (array of object): The flights of the order.
  - `direction` (string): `outbound`, `return` ...
  - `duration` (string): ISO 8601 duration.
  - `stops` (integer): Number of stops.
  - `fareBrandName` (string): Name of the fare brand.
  - `origin` (object): Where this direction starts.
    - `airportCode` (string): IATA code of the airport.
    - `airportName` (string): Name of the airport.
    - `cityName` (string): Name of the city.
    - `countryCode` (string): ISO 3166-1 alpha-2 country code.
    - `timeZone` (string): IANA time zone.
  - `destination` (object): Where this direction ends.
    - `airportCode` (string): IATA code of the airport.
    - `airportName` (string): Name of the airport.
    - `cityName` (string): Name of the city.
    - `countryCode` (string): ISO 3166-1 alpha-2 country code.
    - `timeZone` (string): IANA time zone.
  - `segments` (array of object): The flights of this direction.
    - `id` (string): Id of the segment.
    - `departure` (object): Where and when a segment leaves or arrives.
      - `airportCode` (string): IATA code of the airport.
      - `airportName` (string): Name of the airport.
      - `cityName` (string): Name of the city.
      - `countryCode` (string): ISO 3166-1 alpha-2 country code.
      - `terminal` (string, nullable): Terminal, when the supplier says.
      - `datetime` (string): Local date and time at the airport, `YYYY-MM-DDTHH:MM:SS`, without a time zone.
      - `timeZone` (string): IANA time zone of the airport.
    - `arrival` (object): Where and when a segment leaves or arrives.
      - `airportCode` (string): IATA code of the airport.
      - `airportName` (string): Name of the airport.
      - `cityName` (string): Name of the city.
      - `countryCode` (string): ISO 3166-1 alpha-2 country code.
      - `terminal` (string, nullable): Terminal, when the supplier says.
      - `datetime` (string): Local date and time at the airport, `YYYY-MM-DDTHH:MM:SS`, without a time zone.
      - `timeZone` (string): IANA time zone of the airport.
    - `flight` (object): The airline and the number of the flight.
      - `carrierCode` (string): IATA code of the marketing airline.
      - `flightNumber` (string): The flight number.
      - `operatingCarrier` (string): IATA code of the operating airline.
    - `duration` (string): ISO 8601 duration.
    - `cabin` (string): The cabin.
    - `fareBasis` (string, nullable): Fare basis code.
    - `passengerDetails` (array of object): What each passenger has on this segment.
  - `conditions` (object, nullable): What the fare allows before departure. Indicative only. A Duffel order can carry `null` for both when the airline does not say.
    - `refundBeforeDeparture` (object, nullable): What the fare says about a refund before departure.
      - `allowed` (boolean): Whether a refund is allowed before departure. Indicative, not a promise: the fare rules of the airline decide.
    - `changeBeforeDeparture` (object, nullable): What the fare says about a change before departure.
      - `allowed` (boolean): Whether a change is allowed before departure. Indicative, not a promise: the fare rules of the airline decide.
- `conditions` (object): What the fare allows before departure. Indicative only. A Duffel order can carry `null` for both when the airline does not say.
  - `refundBeforeDeparture` (object, nullable): What the fare says about a refund before departure.
    - `allowed` (boolean): Whether a refund is allowed before departure. Indicative, not a promise: the fare rules of the airline decide.
  - `changeBeforeDeparture` (object, nullable): What the fare says about a change before departure.
    - `allowed` (boolean): Whether a change is allowed before departure. Indicative, not a promise: the fare rules of the airline decide.
- `fareRules` (object): What exchange, refund and revalidation allow.
- `owner` (object): The airline that owns the order.
  - `id` (string, nullable): Duffel's id of the airline.
  - `iataCode` (string): IATA code of the airline that owns the order.
  - `name` (string): Name of the airline.
  - `logoUrl` (string): Address of the logo.
  - `logoLockupUrl` (string, nullable): Address of the wide logo.
  - `conditionsOfCarriageUrl` (string, nullable): Address of the conditions of carriage.
- `services` (array of object): Extra services of the order (bags, seats). Empty.
- `meta` (object): Capabilities of the order and what the supplier reports about it.
  - `supportHold` (boolean, deprecated): Legacy name: use `support_hold`. Whether the supplier can hold.
  - `support_hold` (boolean): Whether the supplier can hold. The snake_case twin of `supportHold`, with the same value: use this name.
  - `supportVoid` (boolean, deprecated): Legacy name: use `support_void`. Whether the supplier can void the ticket the same day.
  - `support_void` (boolean): Whether the supplier can void the ticket the same day. The snake_case twin of `supportVoid`, with the same value: use this name.
  - `voidDeadline` (string, nullable, deprecated): Legacy name: use `void_deadline`. End of the same-day void window.
  - `void_deadline` (string, nullable): End of the same-day void window. The snake_case twin of `voidDeadline`, with the same value: use this name.
  - `voidWindowEndsAt` (string, nullable): End of the void window, when the supplier gives it.
  - `airlineInitiatedChanges` (array of object): Schedule changes the airline made.
  - `changes` (array of object): Changes of the order.
  - `users` (array of object): Users of the order.
  - `orderMetadata` (object, nullable): Supplier-specific metadata of the order.
- `exchangeRate` (number, deprecated): Legacy name: use `exchange_rate`. Only when the supplier's currency is not your agency's.
- `exchange_rate` (number): Only when the supplier's currency is not your agency's. The snake_case twin of `exchangeRate`, with the same value: use this name.
- `internalBooking` (object): The FX-Port identifiers of the booking.
  - `bookingId` (string): The PNR.
  - `internalId` (string): The FX-Port id of the booking (a UUID), the same as `postProcessing.bookingDbId` of the booking call.
- `postProcessing` (object): What FX-Port did after the supplier call.
  - `bookingDbId` (string): The FX-Port id of the booking (a UUID). **The best key to store**: it is accepted as `booking_id` by `get_booking`.
  - `bucketLink` (string, nullable): Address of the PDF of the ticket, `null` until it is generated. A public link.
  - `emailSent` (boolean): Whether the confirmation e-mail went out.
  - `bookingStatusUpdated` (boolean): `cancel_order`: whether the FX-Port booking was updated.
  - `refundMethod` (string): `confirm_cancel`: where the refund went: `balance`.
- `balanceDebited` (boolean): `book_flight` only. Always `false` in the sandbox: nothing is charged.
- `transactionCreated` (boolean): `book_flight` only. Always `false` in the sandbox.
- `payoutCreated` (boolean): `book_flight` only. Always `false` in the sandbox.
- `error` (object): Only when `success` is `false`: the refusal of the supplier for `pay_order`.
  - `message` (string): The supplier's message.
  - `code` (string): The supplier's code: a number as text for Amadeus (`4926`), a name for Duffel (`order_not_cancellable`).
  - `type` (string): The supplier's error type.
  - `details` (array of object): The supplier's details, in its own format.
  - `userMessage` (string): A sentence the supplier wrote for the traveler, when there is one.
- `errors` (array of object): Only when `success` is `false`: the unified error list. `errors[0].code` is the supplier's code in lower case and `errors[0].type` is `supplier_error`.
  - `code` (string): Stable, machine-readable code in snake_case. Branch on this, never on the message.
  - `type` (string): The family of the error: tells you how to react. One of `authentication_error`, `permission_error`, `validation_error`, `not_found`, `conflict`, `payment_error`, `rate_limit_error`, `supplier_error`, `internal_error`.
  - `title` (string): A short label of the error.
  - `message` (string): A sentence for a human: what is wrong and how to fix it. Wording can change; the code does not.
  - `field` (string, nullable): The request field the error is about, when there is one.
  - `details` (object, nullable): Structured extras of the error (for example `available` and `required` for an insufficient balance).
  - `documentation_url` (string): The documentation of this error code.

```json
{
  "environment": "sandbox",
  "success": true,
  "paymentSucceeded": true,
  "requestId": "1ad06b56",
  "orderId": "eJzTd9ePNA9wdA0FAAs8AmE",
  "processingTime": 2.981,
  "paymentDetails": {
    "paymentId": null,
    "status": "succeeded",
    "type": "issuance",
    "paymentAmount": 4925.44,
    "currency": "DZD",
    "createdAt": "2026-11-01T15:26:21.896668",
    "message": "Payment successful! Tickets have been issued."
  },
  "booking": {
    "reference": "eJzTd9ePNA9wdA0FAAs8AmE",
    "status": "confirmed",
    "pnr": "Y7PAEU",
    "type": "instant",
    "createdAt": "2026-11-01T15:26:21.896668",
    "cancelledAt": null,
    "content": "managed",
    "syncedAt": "2026-11-01T15:26:21.896668",
    "availableActions": [],
    "voidableUntil": "2026-11-01T23:00:00Z",
    "cancellation": null
  },
  "supplier": {
    "id": "amadeus_aqc_dz_1",
    "technology": "amadeus_aqc",
    "name": "Amadeus AQC",
    "offerId": "1"
  },
  "agency": {
    "currency": "DZD"
  },
  "pricing": {
    "supplierCurrency": "DZD",
    "agencyCurrency": "DZD",
    "basePrice": 3160,
    "taxesAndFees": 1765.44,
    "agencyCommission": 4.93,
    "finalPrice": 4930.37,
    "b2bPrice": 4925.44,
    "additionalServices": [],
    "acd": {
      "applied": false
    }
  },
  "payment": {
    "status": "paid",
    "paidAt": "2026-11-01T15:26:21.896710",
    "paymentRequiredBy": null,
    "priceGuaranteeExpiresAt": null,
    "awaitingPayment": false
  },
  "documents": [
    {
      "type": "electronic_ticket",
      "documentType": "ETICKET",
      "uniqueIdentifier": "124-2446977397",
      "status": "ISSUED",
      "passengerIds": [
        "1"
      ],
      "segmentIds": [
        "1"
      ]
    }
  ],
  "bookingReferences": [
    {
      "pnr": "Y7PAEU",
      "carrier": {
        "iataCode": "AH",
        "name": "Air Algerie",
        "logoUrl": "https://assets.duffel.com/img/airlines/for-light-background/full-color-logo/AH.svg",
        "logoLockupUrl": "https://assets.duffel.com/img/airlines/for-light-background/full-color-lockup/AH.svg"
      }
    }
  ],
  "passengers": [
    {
      "id": "1",
      "type": "ADULT",
      "title": "mr",
      "givenName": "JAMES",
      "familyName": "SMITH",
      "gender": "male",
      "bornOn": "1988-06-15",
      "email": "traveler@example.com",
      "phoneNumber": "15555550123",
      "infantPassengerId": null,
      "loyaltyProgrammeAccounts": [],
      "ticketNumber": "124-2446977397"
    }
  ],
  "travelerPricing": [
    {
      "travelerId": "1",
      "travelerType": "ADULT",
      "fareOption": "STANDARD",
      "price": {
        "supplierCurrency": "DZD",
        "agencyCurrency": "DZD",
        "base": 3160,
        "total": 4930.37,
        "b2bPrice": 4925.44
      },
      "fareDetailsBySegment": [
        {
          "segmentId": "1",
          "cabin": "ECONOMY",
          "fareBasis": "Y",
          "brandedFare": "STANDARD",
          "brandedFareLabel": "STANDARD",
          "bookingClass": "Y",
          "includedCheckedBags": {
            "quantity": 1
          },
          "includedCabinBags": {
            "quantity": 1
          },
          "amenities": []
        }
      ]
    }
  ],
  "itinerary": [
    {
      "direction": "outbound",
      "duration": "PT1H",
      "stops": 0,
      "fareBrandName": "",
      "origin": {
        "airportCode": "ALG",
        "airportName": "Houari Boumediene Airport",
        "cityName": "Algiers",
        "countryCode": "DZ",
        "timeZone": "Africa/Algiers"
      },
      "destination": {
        "airportCode": "ORN",
        "airportName": "Oran International Airport",
        "cityName": "Oran",
        "countryCode": "DZ",
        "timeZone": "Africa/Algiers"
      },
      "segments": [
        {
          "id": "1",
          "departure": {
            "airportCode": "ALG",
            "airportName": "Houari Boumediene Airport",
            "cityName": "Algiers",
            "countryCode": "DZ",
            "terminal": "1",
            "datetime": "2026-12-22T19:45:00",
            "timeZone": "Africa/Algiers"
          },
          "arrival": {
            "airportCode": "ORN",
            "airportName": "Oran International Airport",
            "cityName": "Oran",
            "countryCode": "DZ",
            "terminal": null,
            "datetime": "2026-12-22T20:45:00",
            "timeZone": "Africa/Algiers"
          },
          "flight": {
            "carrierCode": "AH",
            "carrierName": "Air Algerie",
            "carrierLogoUrl": "https://assets.duffel.com/img/airlines/for-light-background/full-color-logo/AH.svg",
            "flightNumber": "6106",
            "aircraftCode": "73H",
            "aircraftName": null,
            "operatingCarrier": "AH",
            "operatingCarrierName": "Air Algerie",
            "operatingFlightNumber": "6106"
          },
          "duration": "PT1H",
          "distance": null,
          "stops": [],
          "cabin": "ECONOMY",
          "cabinMarketingName": "Economy",
          "fareBasis": "Y",
          "brandedFare": "",
          "brandedFareLabel": "",
          "passengerDetails": [
            {
              "passengerId": "1",
              "cabin": "ECONOMY",
              "cabinMarketingName": "Economy",
              "seat": null,
              "checkedBags": {
                "quantity": 1
              },
              "cabinBags": {
                "quantity": 1
              }
            }
          ]
        }
      ],
      "conditions": {
        "changeBeforeDeparture": {
          "allowed": true
        }
      }
    }
  ],
  "conditions": {
    "refundBeforeDeparture": {
      "allowed": true
    },
    "changeBeforeDeparture": {
      "allowed": true
    }
  },
  "owner": {
    "id": null,
    "iataCode": "AH",
    "name": "Air Algerie",
    "logoUrl": "https://assets.duffel.com/img/airlines/for-light-background/full-color-logo/AH.svg",
    "logoLockupUrl": "https://assets.duffel.com/img/airlines/for-light-background/full-color-lockup/AH.svg",
    "conditionsOfCarriageUrl": null
  },
  "services": [],
  "internalBooking": {
    "bookingId": "Y7PAEU",
    "internalId": "711371c3-00aa-4be2-b790-9f0ca2ccfdb7"
  },
  "fareRules": {
    "refund": {
      "allowed": true
    },
    "exchange": {
      "allowed": true
    },
    "agencyCurrency": "DZD"
  },
  "meta": {
    "paymentStatus": "succeeded",
    "orderConfirmed": true,
    "supportHold": true,
    "supportVoid": true,
    "voidDeadline": "2026-11-01T23:00:00Z",
    "voidWindowEndsAt": null,
    "airlineInitiatedChanges": [],
    "changes": [],
    "users": [],
    "orderMetadata": null
  },
  "postProcessing": {
    "bucketLink": null,
    "emailSent": false
  }
}
```

## Errors

| Status | Code | Example message |
| --- | --- | --- |
| 400 | `bad_request` | Missing required parameter: order_id (or booking_id / pnr) |
| 400 | `invalid_booking_id` | `order_id` is not a valid identifier (letters, digits and - _ . : = ~ only, up to 128 characters). |
| 400 | `bad_request` | Do not pass 'currency'. Currency is resolved automatically from booking/supplier context. |
| 402 | `insufficient_balance` | Agency balance is insufficient. Available: 120.0 DZD, Required: 29876.81 DZD. |
| 403 | `read_write_permission_required` | This endpoint requires an API key with read_write permission. |
| 404 | `not_found` | Booking not found for order_id: ZZZZZZ |
| 503 | `balance_lock_timeout` | The agency balance is busy with another operation. Retry in a few seconds. |

See [Errors](https://fx-port.com/docs/errors.md) for every code and how to react.

## Related guides

- [Pay for a held order](https://fx-port.com/docs/flights/pay-order.md)
- [Get an order quote](https://fx-port.com/docs/flights/get-order-quote.md)
- [Booking flows](https://fx-port.com/docs/flights/booking-flows.md)
