POST/v1/flights/order/required-fields/:gdsprovider/:offerId

Pflichtfelder für Flugbuchungen abrufen

Returns the dynamic passenger, document and identity fields required to complete booking for a selected flight offer.

Returns the dynamic passenger, document and identity fields required to complete booking for a selected flight offer.

Endpoint

MethodPathAuth
POST/v1/flights/order/required-fields/: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
gdsprovidernumberYesAccepted values: 0, 1
offerIdstringYes-

Request Body Schema

PropertyTypeDetailsRequiredNotes
offerIdstringYesSelected offer id
passengersarrayYes-
passengers[]type
enum
adultchildinfant_without_seat
Yes-

Success Response

Returns required field definitions for the offer.

Response Body Schema

PropertyTypeDetailsRequiredNotes
holderobjectYes-
holderphone
booleanYesWhen true, provide passengers[0].phone_number in E.164 format for flows that consume holder contact data
holderemail
booleanYesWhen true, provide passengers[0].email for flows that consume a holder email
holdercountryCode
booleanYesNo separate field exists in create-order. For gdsprovider=1 flows this is derived from passengers[0].phone_number in E.164 format
passengersarrayYes-
passengers[]idx
numberYesPassenger index from the required-fields response
passengers[]title
booleanYesMaps to passengers[].title
passengers[]type
booleanYesMaps to passengers[].type
passengers[]name
booleanYesMaps to passengers[].firstName
passengers[]lastName
booleanYesMaps to passengers[].lastName
passengers[]age
booleanYesInformational only. No direct field exists in create-order and this is currently false in public flight flows
passengers[]nationality
booleanYesWhen true, maps to passengers[].country
passengers[]gender
booleanYesMaps to passengers[].gender
passengers[]phone
booleanYesWhen true, maps to passengers[].phone_number
passengers[]email
booleanYesWhen true, maps to passengers[].email. Some gdsprovider=1 flows only consume the first passenger email
passengers[]address
booleanYesInformational only. No direct field exists in create-order and this is currently false in public flight flows
passengers[]city
booleanYesInformational only. No direct field exists in create-order and this is currently false in public flight flows
passengers[]postalCode
booleanYesInformational only. No direct field exists in create-order and this is currently false in public flight flows
passengers[]bornDate
booleanYesWhen true, maps to passengers[].bornDate
passengers[]documentIdentifier
booleanYesWhen true, maps to passengers[].identity_documents[].unique_identifier
passengers[]documentType
booleanYesWhen true, maps to passengers[].identity_documents[].type when a document object is used
passengers[]documentIssuedAt
booleanYesInformational only. No direct field exists in create-order and this is currently false in public flight flows
passengers[]documentExpiresAt
booleanYesWhen true, maps to passengers[].identity_documents[].expires_on
passengers[]documentCountryCode
booleanYesWhen true, maps to passengers[].identity_documents[].issuing_country_code
passengers[]allowedDocuments
arrayNullableAllowed values for the booking document flow: passport, tax_id, known_traveler_number, passenger_redress_number, dni. If dni is allowed, also collect passengers[].NationalID because the current response does not expose a dedicated nationalId flag

Operational Notes

  • Prefer this POST endpoint because it accepts passenger context in the request body.
  • GET /v1/flights/order/required-fields/:gdsprovider/:offerId exists for compatibility, but integrations should use POST.
  • The real response contract is holder plus passengers[]; it is not a requiredFields[] wrapper.
  • Use the response to decide whether identity_documents, NationalID, nationality or document expiration must be collected before booking.
  • allowedDocuments limits valid values for passengers[].identity_documents[].type. If it includes dni, also collect passengers[].NationalID even though the current response does not expose a dedicated nationalId boolean.
  • In gdsprovider=1 flows, holder.countryCode does not correspond to a separate booking field. It is satisfied by passengers[0].phone_number in E.164 format.
  • In gdsprovider=1 flows, passengers[].email can be marked as required even though only the first passenger email may be consumed as the holder email.

Example

bash
bash
curl -X POST https://api.sandbox.travelandz.com/v1/flights/order/required-fields/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 '{"offerId":"offer_123","passengers":[{"type":"adult"}]}'

Request Body - Example Value

json
json
{
  "offerId": "offer_123",
  "passengers": [
    {
      "type": "adult"
    }
  ]
}

Responses

CodeDescription
200Required booking fields resolved 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
{
  "holder": {
    "phone": true,
    "email": true,
    "countryCode": true
  },
  "passengers": [
    {
      "idx": 0,
      "title": true,
      "type": true,
      "name": true,
      "lastName": true,
      "age": false,
      "nationality": true,
      "gender": true,
      "phone": true,
      "email": true,
      "address": false,
      "city": false,
      "postalCode": false,
      "bornDate": true,
      "documentIdentifier": true,
      "documentType": true,
      "documentIssuedAt": false,
      "documentExpiresAt": true,
      "documentCountryCode": true,
      "allowedDocuments": [
        "passport",
        "dni"
      ]
    }
  ]
}