GET/v1/trains/order/:gdsprovider/:orderId

Get a train order and tickets

Retrieve the current order status and ticket resources.

Share

Retrieve the current order status and ticket resources.

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; orderId comes from order creation.

Request Params Schema

gdsprovider
enum
0
Yes
Currently 0
orderId
stringYes
Order id returned by order creation.

Success response

Returns order with status, reference and itineraryItems[].tickets[]. Ticket types include pdf_ticket, check_in_resource and ticket_on_departure; ticket fields can be null.

Response Body Schema

order
objectYes
ordergdsprovider
numberYes
orderid
stringYes
orderstatus
enum
pendingconfirmedcancelled
Yes
orderreference
stringYes
orderitineraryItems
arrayYes
orderitineraryItems[]itineraryIndex
numberYes
orderitineraryItems[]tickets
arrayYes
orderitineraryItems[]tickets[]type
enum
pdf_ticketcheck_in_resourceticket_on_departure
Yes
orderitineraryItems[]tickets[]url
stringNullable
orderitineraryItems[]tickets[]reference
stringNullable
orderitineraryItems[]tickets[]description
stringNullable

Errors

  • 400 for validation or unknown fields.
  • 401 or 403 for invalid API credentials.
  • 500 internal_communication_error or unknown_error for provider failures.
  • order_not_found when the order does not exist.

Usage notes

Ticket URLs can be provider resources. Treat nullable url, reference and description as expected.

cURL example

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