Get bookable offers for a journey returned by the journey search.
Authentication and headers
| Header | Description |
|---|---|
Authorization | Bearer <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-Type | application/json for requests with a JSON body. |
Request
Path: gdsprovider is currently 0; journeyId comes from the journey search. Optional query: language (en, es, zh) and returnCancellationPolicies (boolean).
Required body:
json
{"passengers":[{"type":"adult"},{"type":"senior"}]}Request Params Schema
gdsproviderCurrently
0journeyIdJourney id returned by the journey search.
Request Query Params Schema
languagereturnCancellationPoliciesRequest Body Schema
passengerspassengers[]typeSuccess response
Returns a journey object whose itineraries contain offers[]. Offers include offerId, parts, flexibility, classes, conditions, cancellation policies and { amount, currency } price.
Response Body Schema
journeyjourneygdsproviderjourneyjourneyIdjourneyitineraryjourneyitinerary[]itineraryIndexjourneyitinerary[]segmentsjourneyitinerary[]segments[]segmentIdjourneyitinerary[]segments[]departurejourneyitinerary[]segments[]departuredepartureAtjourneyitinerary[]segments[]departurenamejourneyitinerary[]segments[]departurelocationIdjourneyitinerary[]segments[]departurecountryjourneyitinerary[]segments[]departurecountryCodejourneyitinerary[]segments[]arrivaljourneyitinerary[]segments[]arrivalarrivalAtjourneyitinerary[]segments[]arrivalnamejourneyitinerary[]segments[]arrivallocationIdjourneyitinerary[]segments[]arrivalcountryjourneyitinerary[]segments[]arrivalcountryCodejourneyitinerary[]segments[]identifierjourneyitinerary[]segments[]transportjourneyitinerary[]segments[]durationInMinutesjourneyitinerary[]segments[]operatorjourneyitinerary[]segments[]operatorcodejourneyitinerary[]segments[]operatornamejourneyitinerary[]segments[]operatorimageUrljourneyitinerary[]segments[]servicejourneyitinerary[]segments[]servicenamejourneyitinerary[]segments[]serviceimageUrljourneyitinerary[]offersjourneyitinerary[]offers[]offerIdjourneyitinerary[]offers[]partsjourneyitinerary[]offers[]parts[]segmentsjourneyitinerary[]offers[]parts[]segments[]segmentIdjourneyitinerary[]offers[]parts[]segments[]amenitiesjourneyitinerary[]offers[]parts[]segments[]amenities[]journeyitinerary[]offers[]parts[]flexibilityjourneyitinerary[]offers[]parts[]comfortClassjourneyitinerary[]offers[]parts[]serviceClassjourneyitinerary[]offers[]parts[]conditionsjourneyitinerary[]offers[]parts[]conditions[]typejourneyitinerary[]offers[]parts[]conditions[]conditionjourneyitinerary[]offers[]parts[]conditions[]notejourneyitinerary[]offers[]parts[]conditions[]conditionKeyjourneyitinerary[]offers[]parts[]cancellationPoliciesjourneyitinerary[]offers[]parts[]cancellationPolicies[]__typenamejourneyitinerary[]offers[]parts[]cancellationPolicies[]__typenametypejourneyitinerary[]offers[]parts[]cancellationPolicies[]descriptionjourneyitinerary[]offers[]parts[]cancellationPolicies[]minimum_minutes_before_departurejourneyitinerary[]offers[]parts[]cancellationPolicies[]maximum_minutes_before_departurejourneyitinerary[]offers[]parts[]cancellationPolicies[]minimum_minutes_after_departurejourneyitinerary[]offers[]parts[]cancellationPolicies[]maximum_minutes_after_departurejourneyitinerary[]offers[]parts[]cancellationPolicies[]percentageWhen
__typename is CancellationByPercentagejourneyitinerary[]offers[]parts[]cancellationPolicies[]chargePercentageWhen
__typename is CancellationByPercentChargejourneyitinerary[]offers[]parts[]cancellationPolicies[]chargeAmountWhen
__typename is CancellationByFixedChargejourneyitinerary[]offers[]parts[]cancellationPolicies[]currencyWhen
__typename is CancellationByFixedChargejourneyitinerary[]offers[]parts[]cancellationPolicies[]perPersonWhen
__typename is CancellationByPercentCharge or CancellationByFixedCharge. Is optionaljourneyitinerary[]offers[]parts[]cancellationPolicies[]perLegWhen
__typename is CancellationByPercentCharge or CancellationByFixedCharge. Is optionaljourneyitinerary[]offers[]parts[]isRefundablejourneyitinerary[]offers[]pricejourneyitinerary[]offers[]priceamountjourneyitinerary[]offers[]pricecurrencyjourneyitinerary[]offers[]createdAtjourneyitinerary[]offers[]expiresAtjourneystopoversjourneystopovers[]stopoverIndexjourneystopovers[]durationInMinutesjourneyroutejourneyroute[]itineraryIndexjourneyroute[]stopoverIndexjourneycomfortClassesjourneycomfortClasses[]journeyaccommodationsjourneyaccommodations[]journeyticketClassesjourneyticketClasses[]comfortClassjourneyticketClasses[]serviceClassErrors
400for validation or unknown fields.401or403for invalid API credentials.500 internal_communication_errororunknown_errorfor provider failures.404 zero_journeys_foundwhen offers cannot be found.
Usage notes
Use each offerId with the prebook endpoint. Offers expire, so continue the booking flow before expiresAt.
cURL example
bash
curl --request POST \
--url "https://api.sandbox.travelandz.com/v1/trains/journeys/0/journey_123/offers?language=en&returnCancellationPolicies=true" \
--header "Authorization: Bearer $TRAVELANDZ_SECRET_KEY" \
--header "X-Travelandz-Id: $TRAVELANDZ_PUBLIC_KEY:$TRAVELANDZ_PROFILE_CODE" \
--header "Content-Type: application/json" \
--data '{"passengers":[{"type":"adult"}]}'