Ordering Flights
Once you have selected your flights, added the necessary ancillaries, and obtained the pricing information, you can proceed to place an order for the selected itinerary. This step finalizes the booking process and requires providing payment information.
Requesting Order
POST /flight/[sessionId]/order
Use this endpoint to place an order for the selected flights using the specified payment details.
You may provide a new payment or an alternative payment method here; or, create one using the Payment Management endpoint.
Request
💣 If you choose to use the payment management endpoints, you must not provide the payment information in this request. Doing so will result in an error.
Order using a Payment Information Object
If paying with a regular payment object and have not created a payment object using the Payment Management endpoint, you must provide the payment information in this request.
{
"payment": {
"code": "visa",
"first_name": "John",
"last_name": "Doe",
"token": "401299Hb1tTS9999",
"expiry": "10/25",
"billing_information": {
"unit": "211",
"country": "CA",
"state": "ON",
"address": "529 West Broadway",
"city": "Toronto",
"postal_code": "L5W1N6"
}
}
}
payment
: (Payment Information?) Payment to be used for the order.
Order using an Alternative Payment
Alternatively, if you are planning to use an alternative payment method; and, have not attached an alternative payment to the session, you can provide the alternative payment information in this request.
{
"alternativePayment" : {
"method": "VERTO",
"payload" : {
"token" : "bd12b3d4-5c63-4938-86df-cf4a2207fc59",
}
}
}
alternativePayment
: (Alternative Payment Information?) Alternative Payment to be used for the order.
Attaching Meta Data to the Order Session
You may attach a set of meta-data properties to the order session. This can be useful for filtering and searching orders later on. These must be string key-value pairs set in the clientMeta
object.
{
"clientMeta" : {
"arbitrary-key" : "arbitrary-value"
}
}
🔔 Please ensure that the meta-data properties are URL safe, as will be used in the URL for filtering and searching orders.
Response
{
"flow": "FLIGHT_BOOKING",
"expireAt": "2023-07-31T00:00:00.000Z",
"createdAt": "2023-06-27T22:24:45.817Z",
"public": "aa27fbad-5c63-4938-86df-cf4a2207fc59"
}
The response will be a new session. The order session serves as a reference to manage and access specific orders.
🧨 Once the order is placed, the search session that you have been using will be invalidated. For any action from here on, you will need to use the new public returned in this response.
🛎 The session returned will be of flow
FLIGHT_BOOKING
. This session is a long-lived one that will expire after the travel date of the last flight in the itinerary. You can see the details of the session using the Get Session endpoint.
Possible Errors
Status Code | Error | Reason |
---|---|---|
400 | [Validation Error] | Failed Validation |
404 | Session not found or expired | Request targeting a non-existent session. |
500 | NDCx Internal Error | Unknown |
412 | Pricing not found. Please price the session before attempting to order | Pricing call hasn’t been made for the current combination of fares, brands and seats. |
409 | Session is currently locked by another process. Please try again later. | Session is locked by another process. |
409 | Multiple payment methods provided for the order | There are multiple alternativePayment or payment are provided in the order. |
412 | No payment method provided for the order | No payment of any kind has been provided for the order. |
412 | Alternative payment method is not valid | The alternative payment provided cannot be verified. |
422 | The order was created, but the passenger information return was malformed. Order Locator: locator | The order has been created, but we have not been able to validate the created order. Manual Intervention is required. |
412 | Not all flights are selected | The Itinerary has not yet been fully selected. |