POST/v1/flights/order/required-fields/: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 fieldsGDS 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
bash
curl -X POST 'https://api.sandbox.travelandz.com/v1/flights/order/required-fields/0/:offerId' \
-H 'Authorization: Bearer YOUR_SECRET_KEY' \
-H 'X-Travelandz-Id: YOUR_PUBLIC_KEY:YOUR_PROFILE_CODE' \
-H 'Content-Type: application/json' \
-d '{"offerId":"off_0000B7VCW4q5OD5G49hmKn","passengers":[{"type":"adult"}]}'Add your credentials to send a request.
Response
Click "Try it!" to send a request and see the response here.
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
gdsproviderAccepted values:
0, 1offerIdRequest Body Schema
offerIdSelected offer id
passengerspassengers[]typeSuccess Response
Returns required field definitions for the offer.
Response Body Schema
holderholderphoneWhen true, provide
passengers[0].phone_number in E.164 format for flows that consume holder contact dataholderemailWhen true, provide
passengers[0].email for flows that consume a holder emailholdercountryCodeNo separate field exists in
create-order. For gdsprovider=1 flows this is derived from passengers[0].phone_number in E.164 formatpassengerspassengers[]idxPassenger index from the required-fields response
passengers[]titleMaps to
passengers[].titlepassengers[]typeMaps to
passengers[].typepassengers[]nameMaps to
passengers[].firstNamepassengers[]lastNameMaps to
passengers[].lastNamepassengers[]ageInformational only. No direct field exists in
create-order and this is currently false in public flight flowspassengers[]nationalityWhen true, maps to
passengers[].countrypassengers[]genderMaps to
passengers[].genderpassengers[]phoneWhen true, maps to
passengers[].phone_numberpassengers[]emailWhen true, maps to
passengers[].email. Some gdsprovider=1 flows only consume the first passenger emailpassengers[]addressInformational only. No direct field exists in
create-order and this is currently false in public flight flowspassengers[]cityInformational only. No direct field exists in
create-order and this is currently false in public flight flowspassengers[]postalCodeInformational only. No direct field exists in
create-order and this is currently false in public flight flowspassengers[]bornDateWhen true, maps to
passengers[].bornDatepassengers[]documentIdentifierWhen true, maps to
passengers[].identity_documents[].unique_identifierpassengers[]documentTypeWhen true, maps to
passengers[].identity_documents[].type when a document object is usedpassengers[]documentIssuedAtInformational only. No direct field exists in
create-order and this is currently false in public flight flowspassengers[]documentExpiresAtWhen true, maps to
passengers[].identity_documents[].expires_onpassengers[]documentCountryCodeWhen true, maps to
passengers[].identity_documents[].issuing_country_codepassengers[]allowedDocumentsAllowed 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 flagliveModeTrue when the request is served by the live Travelandz environment. This value comes from Travelandz, not the provider payload.
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": "off_0000B7VCW4q5OD5G49hmKn",
"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": false,
"email": false,
"countryCode": false
},
"passengers": [
{
"idx": 0,
"title": true,
"type": true,
"name": true,
"lastName": true,
"age": false,
"nationality": false,
"gender": true,
"phone": true,
"email": true,
"address": false,
"city": false,
"postalCode": false,
"bornDate": true,
"documentIdentifier": false,
"documentType": false,
"documentIssuedAt": false,
"documentExpiresAt": false,
"documentCountryCode": false,
"allowedDocuments": null
}
],
"liveMode": false
}