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

Get train refund status

Read refund operations and the state of each refunded item.

Share

Read refund operations and the state of each refunded item.

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 refunds[] with refund id, state, timestamps, total refunded amount and item-level states. A refund can be success, pending or error.

Response Body Schema

refunds
arrayYes
refunds[]id
stringYes
refunds[]state
enum
successpendingerror
Yes
refunds[]createdAt
string
Format: ISO 8601
Yes
refunds[]totalRefunded
objectYes
refunds[]totalRefundedamount
numberYes
refunds[]totalRefundedcurrency
stringYes
refunds[]items
arrayYes
refunds[]items[]id
stringYes
refunds[]items[]state
enum
successpendingerror
Yes
refunds[]items[]amount
objectYes
refunds[]items[]amountamount
numberYes
refunds[]items[]amountcurrency
stringYes
refunds[]items[]parts
arrayYes
refunds[]items[]parts[]segments
arrayYes
refunds[]items[]parts[]segments[]departureAt
string
Format: ISO 8601
Yes
refunds[]items[]parts[]segments[]arrivalAt
string
Format: ISO 8601
Yes
refunds[]items[]parts[]segments[]durationInMinutes
numberYes
refunds[]items[]parts[]segments[]transport
enum
trainbusferry
Yes
refunds[]items[]parts[]segments[]identifier
stringYes

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

Use this endpoint after starting a refund to distinguish completed, pending and failed refund items.

cURL example

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