Versions
v4
Flights
Create Order

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.

POST /flight/[sessionId]/order
{
  "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"
    }
  }
}

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.

POST /flight/[sessionId]/order
{
  "alternativePayment" : {
    "method": "VERTO",
    "payload" : {
      "token" : "bd12b3d4-5c63-4938-86df-cf4a2207fc59",
    }
  }
}

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.

POST /flight/[sessionId]/order
{
  "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.

Attaching 3DS data to the Order

If a 3DS flow is requested and completed, the 3DS data should be attached to the order request under the threeDs object.

POST /flight/[sessionId]/order
{
  "threeDs" : {
    "gateway": "stripe",
    "payload": {
      "paymentIntent" : {
        "id": "pi_1J2f3sdf",
        "status": "succeeded"
      }
    }
  }
}

Attaching a Context to the Order

You may attach a context to the order session. This will help the fraud prevention mechanism to understand the context of the order more accurately.

POST /flight/[sessionId]/order
{
  "context" : {
    "gateway": "stripe",
    "payload": {
      "radarSession": {
          "id": "rse_1RMZ41KO2Vs5OgwIcWS8C7oA",
          "passive_captcha_site_key": "9883b18b-8cd9-4469-b478-05c06d8252d8"
      }
    }
  }
}

Automatically Cancelling an Order

You may request the order to be cancelled automatically right after the booking is made. This is useful for testing purposes. This can be done by attaching a x-cancel-ttl http header, which accepts a time-to-live value in milliseconds. The accepted range is between 1000 and 300000. If any other value is passed in, the API will default to 60000.

curl -X POST -H "x-cancel-ttl: 3000" https://api.orx.travel/flight/[sessionId]/order

Response

POST /flight/[sessionId]/order
{
  "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 CodeErrorReasonReason Code
400[Validation Error]Failed ValidationORX_VALIDATION_EXCEPTION
404Session not found or expiredRequest targeting a non-existent session.ORX_SESSION_NOT_FOUND
500NDCx Internal ErrorUnknownORX_UNKNOWN_ERROR
412Pricing not found. Please price the session before attempting to orderPricing call hasn’t been made for the current combination of fares, brands and seats.ORX_PRICING_NOT_FOUND
409session is currently locked by another process. Please try again later.Session is locked by another process.ORX_SESSION_LOCKED
409Multiple payment methods provided for the orderThere are multiple alternativePayment or payment are provided in the order.ORX_MULTIPLE_FOP
412No payment method provided for the orderNo payment of any kind has been provided for the order.ORX_NO_PAYMENT_ATTACHED
412Alternative payment method is not validThe alternative payment provided cannot be verified.ORX_NO_PAYMENT_ATTACHED
422The order was created, but the passenger information return was malformed. Order Locator: locatorThe order has been created, but we have not been able to validate the created order. Manual Intervention is required.ORX_MALFORMED_PASSENGER_INFO
412Not all flights are selectedThe Itinerary has not yet been fully selected.ORX_UNORDERED_FLIGHTS
403The payment was rejected due to a high fraud risk. Please contact support for further assistance.There was a high risk of fraud associated with the transaction.ORX_PAYMENT_REJECTED