POST/v1/flights/order/:gdsprovider/:offerId

Create flight order

Creates an instant flight booking or hold order from a selected offer. Public bookings resolve internal price from offerId or tracked offer data.

Share
POST/v1/flights/order/:gdsprovider/:offerId

API console

Try it

Send a real request to the sandbox API and inspect the response.

Credentials

Log in to pick from your saved API keys instead of pasting them.

Path parameters

2 fields

GDS provider

Global Distribution System used to source flight content. Select 0 for the default provider.

Offer ID

Identifier of the offer returned by a previous flight search request.

Request body

cURL request

cURL
bash
curl -X POST 'https://api.sandbox.travelandz.com/v1/flights/order/0/:offerId' \
  -H 'Authorization: Bearer YOUR_SECRET_KEY' \
  -H 'X-Travelandz-Id: YOUR_PUBLIC_KEY:YOUR_PROFILE_CODE' \
  -H 'Content-Type: application/json' \
  -d '{"currency":"EUR","passengers":[{"id":"pas_0000B7VCW4ca7emwcBOyUf","type":"adult","title":"mr","phone_number":"+573128837058","firstName":"Alejandro","lastName":"Toledo","gender":"m","email":"jairotoledo2003@gmail.com","bornDate":"2003-08-14"}],"type":"instant"}'

Add your credentials to send a request.

Response

Click "Try it!" to send a request and see the response here.

Creates an instant flight booking or hold order from a selected offer. Public bookings resolve internal price from offerId or tracked offer data.

Endpoint

MethodPathAuth
POST/v1/flights/order/:gdsprovider/:offerIdRequired API key
Required headers:
HeaderDescription
AuthorizationBearer <secret_key>. The secret is shown only once when the credential is created.
X-Travelandz-Id<public_key>:<profile_code>. The profile_code is the dp_-prefixed Developer Profile code shown in your dashboard. This binds the request to a profile and credential.
Content-TypeUse application/json for requests with a body.

Request Params Schema

gdsprovider
numberYes
offerId
stringYes

Request Body Schema

currency
enum
EURUSDCNY
Yes
Currency requested for the public booking. Internal price is resolved by offerId or tracked offer data
passengers
arrayYes
passengers[]id
stringYes
Passenger id from the selected tracked public offer. It must exactly match the offer passenger id and type. Empty, missing, duplicate or extra passenger ids are rejected. Mystifly offers generate ids such as mystifly_pax_1.
passengers[]type
enum
adultchildinfant_without_seat
Yes
passengers[]title
enum
mrmsmrsmiss
Yes
passengers[]phone_number
string
Format: E.164 phone number
Yes
Satisfies passengers[].phone. In gdsprovider=1 flows, passengers[0].phone_number also satisfies holder.phone and derives holder.countryCode
passengers[]infant_passenger_id
stringNo
Required when the passenger is attached to an infant
passengers[]identity_documents
arrayNo
Identity document objects. Example: [{ type, unique_identifier, issuing_country_code, expires_on }]. Required when the offer or required-fields response asks for them
passengers[]firstName
stringYes
Satisfies passengers[].name from required-fields
passengers[]lastName
stringYes
Satisfies passengers[].lastName from required-fields
passengers[]gender
enum
mf
Yes
passengers[]email
stringYes
Satisfies passengers[].email. Some gdsprovider=1 flows only consume the first passenger email as the top-level holder email
passengers[]bornDate
string
Format: YYYY-MM-DD
Yes
passengers[]country
stringNo
2-letter ISO country code. Use when required-fields marks nationality as true
passengers[]NationalID
stringNo
Use when the selected flow requires a national identity number. In current gdsprovider=1 responses this can be implied by allowedDocuments including dni even without an explicit nationalId flag
passengers[]loyaltyProgrammeAccounts
arrayNo
Optional loyalty account objects. Example: [{ airlineIataCode, accountNumber }]. Use only when supportedLoyaltyPrograms includes the airline code
totalSegments
arrayYes
totalSegments[]originCode
stringYes
Mapped from offer.slices[].segments[].departure.iataCode
totalSegments[]destinationCode
stringYes
Mapped from offer.slices[].segments[].arrival.iataCode
totalSegments[]flightNumber
stringYes
Mapped from offer.slices[].segments[].flightNumber
totalSegments[]departureDate
string
Format: ISO 8601
Yes
Mapped from offer.slices[].segments[].departure.departingAt
holdId
stringNo
Only for providers that support hold payment
type
enum
instanthold
No
Default instant. hold only applies when the selected provider supports it

Success Response

Returns order identifiers, status and provider booking payload.

Response Body Schema

orderId
stringYes
holdExpiresAt
string
Format: ISO 8601
No
holdPriceGuaranteed
stringNo
liveMode
booleanYes
True when the request is served by the live Travelandz environment. This value comes from Travelandz, not the provider payload.

Operational Notes

  • Public booking always requires a tracked snapshot of the selected public offer for the same profile, gdsprovider and offerId.
  • passengers[].id is the passenger id from the tracked offer, not an internal user identifier.
  • passengers[].id and passengers[].type must exactly match the tracked offer passengers. Empty ids, duplicates, missing passengers, extra passengers or type mismatches are rejected.
  • Mystifly public offers generate internal passenger ids such as mystifly_pax_1, mystifly_pax_2, etc. Reuse those ids exactly as returned by the offer.
  • Do not send internal user identifiers; they are not part of the public booking contract.
  • Do not send originalPrice in public bookings. The API resolves internal price and currency from offerId or the tracked offer payload. If originalPrice is sent, public validation rejects the request as a non-whitelisted field.
  • Send identity_documents[] when the offer or required-fields endpoint indicates identity documents are required.
  • type=hold and holdId only apply when the selected booking flow supports hold payment.
  • totalSegments[] is only required when the selected booking flow needs segment metadata. Build it from every offer.slices[].segments[] item.

required-fields to create-order mapping

required-fields responsecreate-order fieldNotes
passengers[].titlepassengers[].titleDirect match
passengers[].typepassengers[].typeDirect match
passengers[].namepassengers[].firstNameRename on booking body
passengers[].lastNamepassengers[].lastNameDirect match
passengers[].genderpassengers[].genderDirect match
passengers[].bornDatepassengers[].bornDateDirect match
passengers[].nationalitypassengers[].countryUse 2-letter ISO country code
passengers[].phonepassengers[].phone_numberE.164 format
passengers[].emailpassengers[].emailIn gdsprovider=1 flows, only the first passenger email can be consumed as holder email
passengers[].documentIdentifierpassengers[].identity_documents[].unique_identifierOnly when a document object is required
passengers[].documentTypepassengers[].identity_documents[].typeLimited by allowedDocuments
passengers[].documentExpiresAtpassengers[].identity_documents[].expires_onOnly when required
passengers[].documentCountryCodepassengers[].identity_documents[].issuing_country_codeOnly when required
passengers[].allowedDocumentspassengers[].identity_documents[].typeIf it includes dni, also collect passengers[].NationalID
holder.phonepassengers[0].phone_numberSome flows derive holder contact from the first passenger
holder.emailpassengers[0].emailSome flows derive holder contact from the first passenger
holder.countryCodederived from passengers[0].phone_numberNo separate booking field; use E.164 phone prefix

The generic flags age, address, city, postalCode and documentIssuedAt do not currently map to explicit public booking fields.

Nested passenger payloads

json
json
{
  "identity_documents": [
    {
      "type": "passport",
      "unique_identifier": "X1234567",
      "issuing_country_code": "ES",
      "expires_on": "2030-12-31"
    }
  ],
  "loyaltyProgrammeAccounts": [
    {
      "airlineIataCode": "BA",
      "accountNumber": "123456789"
    }
  ]
}

totalSegments example

json
json
[
  {
    "originCode": "MAD",
    "destinationCode": "BCN",
    "flightNumber": "1234",
    "departureDate": "2026-08-20T08:15:00"
  }
]
totalSegmentsSource in offer.slices[].segments[]
originCodesegment.departure.iataCode
destinationCodesegment.arrival.iataCode
flightNumbersegment.flightNumber
departureDatesegment.departure.departingAt

Example

bash
bash
curl -X POST https://api.sandbox.travelandz.com/v1/flights/order/0/offer_123 \
  -H "Authorization: Bearer $TRAVELANDZ_SECRET_KEY" \
  -H "X-Travelandz-Id: $TRAVELANDZ_PUBLIC_KEY:$TRAVELANDZ_PROFILE_CODE" \
  -H "Content-Type: application/json" \
  -d '{"currency":"EUR","type":"instant","passengers":[{"id":"pas_0001","type":"adult","title":"mr","phone_number":"+34612345678","firstName":"John","lastName":"Doe","gender":"m","email":"john.doe@example.com","bornDate":"1990-01-15","country":"ES"}]}'

Request Body - Example Value

json
json
{
  "currency": "EUR",
  "passengers": [
    {
      "id": "pas_0000B7VCW4ca7emwcBOyUf",
      "type": "adult",
      "title": "mr",
      "phone_number": "+573128837058",
      "firstName": "Alejandro",
      "lastName": "Toledo",
      "gender": "m",
      "email": "jairotoledo2003@gmail.com",
      "bornDate": "2003-08-14"
    }
  ],
  "type": "instant"
}

Responses

CodeDescription
200Flight order created successfully.
400Bad request – invalid payload.
401Unauthorized – invalid or missing credentials.
403Forbidden – invalid credentials.
500Internal server error

200 Response Body

Media type: application/json

json
json
{
  "orderId": "ord_0000B7VCdoZtPDdnjqCYIe",
  "liveMode": false
}