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

Créer une commande de vol

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

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

PropertyTypeDetailsRequiredNotes
gdsprovidernumberYes-
offerIdstringYes-

Request Body Schema

PropertyTypeDetailsRequiredNotes
currencyenum
EURUSDCNY
YesCurrency requested for the public booking. Internal price is resolved by offerId or tracked offer data
passengersarrayYes-
passengers[]id
stringYesPassenger id from the selected offer. For gdsprovider=1, reuse the empty value if the offer sends an empty id
passengers[]type
enum
adultchildinfant_without_seat
Yes-
passengers[]title
enum
mrmsmrsmiss
Yes-
passengers[]phone_number
string
Format: E.164 phone number
YesSatisfies passengers[].phone. In gdsprovider=1 flows, passengers[0].phone_number also satisfies holder.phone and derives holder.countryCode
passengers[]infant_passenger_id
stringNoRequired when the passenger is attached to an infant
passengers[]identity_documents
arrayNoIdentity document objects. Example: [{ type, unique_identifier, issuing_country_code, expires_on }]. Required when the offer or required-fields response asks for them
passengers[]firstName
stringYesSatisfies passengers[].name from required-fields
passengers[]lastName
stringYesSatisfies passengers[].lastName from required-fields
passengers[]gender
enum
mf
Yes-
passengers[]email
stringYesSatisfies 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
stringNo2-letter ISO country code. Use when required-fields marks nationality as true
passengers[]NationalID
stringNoUse 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
arrayNoOptional loyalty account objects. Example: [{ airlineIataCode, accountNumber }]. Use only when supportedLoyaltyPrograms includes the airline code
totalSegmentsarrayYes-
totalSegments[]originCode
stringYesMapped from offer.slices[].segments[].departure.iataCode
totalSegments[]destinationCode
stringYesMapped from offer.slices[].segments[].arrival.iataCode
totalSegments[]flightNumber
stringYesMapped from offer.slices[].segments[].flightNumber
totalSegments[]departureDate
string
Format: ISO 8601
YesMapped from offer.slices[].segments[].departure.departingAt
holdIdstringNoOnly for providers that support hold payment
typeenum
instanthold
NoDefault instant. hold only applies when the selected provider supports it

Success Response

Returns order identifiers, status and provider booking payload.

Response Body Schema

PropertyTypeDetailsRequiredNotes
orderIdstringYes-
holdExpiresAtstring
Format: ISO 8601
No-
holdPriceGuaranteedstringNo-

Operational Notes

  • passengers[].id is the passenger id from the selected offer, not an internal user identifier.
  • 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. Public hold bookings require a tracked offer for the same profile, gdsprovider and offerId; without it the API returns Tracked flight offer is required to complete this public booking.
  • 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"}]}'