POST/v1/flights/order/required-fields/:gdsprovider/:offerId
Get required flight booking fields
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
| Method | Path | Auth |
|---|---|---|
POST | /v1/flights/order/required-fields/:gdsprovider/:offerId | Required API key |
| Header | Description |
|---|---|
Authorization | Bearer <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-Type | Use application/json for requests with a body. |
Request Params Schema
| Property | Type | Details | Required | Notes |
|---|---|---|---|---|
gdsprovider | number | Yes | Accepted values: 0, 1 | |
offerId | string | Yes | - |
Request Body Schema
| Property | Type | Details | Required | Notes |
|---|---|---|---|---|
offerId | string | Yes | Selected offer id | |
passengers | array | Yes | - | |
passengers[]type | enum | adultchildinfant_without_seat | Yes | - |
Success Response
Returns required field definitions for the offer.
Response Body Schema
| Property | Type | Details | Required | Notes |
|---|---|---|---|---|
holder | object | Yes | - | |
holderphone | boolean | Yes | When true, provide passengers[0].phone_number in E.164 format for flows that consume holder contact data | |
holderemail | boolean | Yes | When true, provide passengers[0].email for flows that consume a holder email | |
holdercountryCode | boolean | Yes | No separate field exists in create-order. For gdsprovider=1 flows this is derived from passengers[0].phone_number in E.164 format | |
passengers | array | Yes | - | |
passengers[]idx | number | Yes | Passenger index from the required-fields response | |
passengers[]title | boolean | Yes | Maps to passengers[].title | |
passengers[]type | boolean | Yes | Maps to passengers[].type | |
passengers[]name | boolean | Yes | Maps to passengers[].firstName | |
passengers[]lastName | boolean | Yes | Maps to passengers[].lastName | |
passengers[]age | boolean | Yes | Informational only. No direct field exists in create-order and this is currently false in public flight flows | |
passengers[]nationality | boolean | Yes | When true, maps to passengers[].country | |
passengers[]gender | boolean | Yes | Maps to passengers[].gender | |
passengers[]phone | boolean | Yes | When true, maps to passengers[].phone_number | |
passengers[]email | boolean | Yes | When true, maps to passengers[].email. Some gdsprovider=1 flows only consume the first passenger email | |
passengers[]address | boolean | Yes | Informational only. No direct field exists in create-order and this is currently false in public flight flows | |
passengers[]city | boolean | Yes | Informational only. No direct field exists in create-order and this is currently false in public flight flows | |
passengers[]postalCode | boolean | Yes | Informational only. No direct field exists in create-order and this is currently false in public flight flows | |
passengers[]bornDate | boolean | Yes | When true, maps to passengers[].bornDate | |
passengers[]documentIdentifier | boolean | Yes | When true, maps to passengers[].identity_documents[].unique_identifier | |
passengers[]documentType | boolean | Yes | When true, maps to passengers[].identity_documents[].type when a document object is used | |
passengers[]documentIssuedAt | boolean | Yes | Informational only. No direct field exists in create-order and this is currently false in public flight flows | |
passengers[]documentExpiresAt | boolean | Yes | When true, maps to passengers[].identity_documents[].expires_on | |
passengers[]documentCountryCode | boolean | Yes | When true, maps to passengers[].identity_documents[].issuing_country_code | |
passengers[]allowedDocuments | array | Nullable | Allowed 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
POSTendpoint because it accepts passenger context in the request body. GET /v1/flights/order/required-fields/:gdsprovider/:offerIdexists for compatibility, but integrations should usePOST.- The real response contract is
holderpluspassengers[]; it is not arequiredFields[]wrapper. - Use the response to decide whether
identity_documents,NationalID, nationality or document expiration must be collected before booking. allowedDocumentslimits valid values forpassengers[].identity_documents[].type. If it includesdni, also collectpassengers[].NationalIDeven though the current response does not expose a dedicatednationalIdboolean.- In gdsprovider=1 flows,
holder.countryCodedoes not correspond to a separate booking field. It is satisfied bypassengers[0].phone_numberin E.164 format. - In gdsprovider=1 flows,
passengers[].emailcan be marked as required even though only the first passenger email may be consumed as the holder email.
Example
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
{
"offerId": "offer_123",
"passengers": [
{
"type": "adult"
}
]
}Responses
| Code | Description |
|---|---|
200 | Required booking fields resolved successfully. |
400 | Bad request – invalid payload. |
401 | Unauthorized – invalid or missing credentials. |
403 | Forbidden – invalid credentials. |
500 | Internal server error |
200 Response Body
Media type: application/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"
]
}
]
}