GET/v1/trains/book/:gdsprovider/:bookingId/required-fields

Get required train booking fields

Resolve the passenger and holder fields required to create an order.

Share

Resolve the passenger and holder fields required to create an order.

Authentication and headers

HeaderDescription
AuthorizationBearer <secret_key>. Keep the secret on the server and never write it to client logs.
X-Travelandz-Id<public_key>:<profile_code>, where the persisted profile code has the form dp_<12 alphanumeric>.
Content-Typeapplication/json for requests with a JSON body.

Request

Path parameters: gdsprovider is currently 0; bookingId comes from prebook.

Request Params Schema

gdsprovider
enum
0
Yes
Currently 0
bookingId
stringYes
Booking id returned by prebook.

Success response

Returns holder flags and passengers[] flags. Each boolean indicates whether the corresponding field must be sent when creating the order; idx identifies the passenger position.

Response Body Schema

holder
objectYes
holderphone
booleanYes
holderemail
booleanYes
holdercountryCode
booleanYes
passengers
arrayYes
passengers[]idx
numberYes
passengers[]title
booleanYes
passengers[]type
booleanYes
passengers[]name
booleanYes
passengers[]lastName
booleanYes
passengers[]age
booleanYes
passengers[]nationality
booleanYes
passengers[]gender
booleanYes
passengers[]phone
booleanYes
passengers[]email
booleanYes
passengers[]countryCode
booleanYes
passengers[]address
booleanYes
passengers[]city
booleanYes
passengers[]postalCode
booleanYes
passengers[]bornDate
booleanYes
passengers[]cityOfBirth
booleanYes
passengers[]countryOfBirth
booleanYes
passengers[]documentIdentifier
booleanYes
passengers[]documentType
booleanYes
passengers[]documentIssuedAt
booleanYes
passengers[]documentExpiresAt
booleanYes
passengers[]documentCountryCode
booleanYes
passengers[]allowedDocuments
arrayYes
passengers[]allowedDocuments[]
string[]Yes

Errors

  • 400 for validation or unknown fields.
  • 401 or 403 for invalid API credentials.
  • 500 internal_communication_error or unknown_error for provider failures.
  • booking_not_found when the pre-booking is missing or expired.

Usage notes

Build the passenger form from the fields marked true; do not assume every booking needs the same identity data.

cURL example

bash
bash
curl --request GET \
  --url "https://api.sandbox.travelandz.com/v1/trains/book/0/booking_123/required-fields" \
  --header "Authorization: Bearer $TRAVELANDZ_SECRET_KEY" \
  --header "X-Travelandz-Id: $TRAVELANDZ_PUBLIC_KEY:$TRAVELANDZ_PROFILE_CODE"