Error Structure

When a request fails, the Trusted Getaways APIs return an HTTP status code other than 200, with a JSON body that explains the error.

Status Codes

StatusMeaningReturned by
400Invalid body, occupancy, components, inventory or currency.Book
401Missing or invalid API key.All APIs
404Listing not found, or not bookable for your organisation.Package Details, Day-wise Itinerary, Book
409Prices have changed: total_amount does not match the current price.Book
500Unexpected error.All APIs

Error Response Formats

401 Unauthorized

{
  "success": false,
  "code": 401,
  "message": "Unauthorized"
}
KeyTypeDescription
successBooleanAlways false for errors.
codeIntegerHTTP status code.
messageStringError message.

400 and 404

{
  "status": 404,
  "message": "Listing not found"
}
KeyTypeDescription
statusIntegerHTTP status code.
messageStringWhat went wrong.

409 Prices Have Changed

{
  "status": 409,
  "message": "Prices have changed",
  "data": {
    "requested_amount": 80000.0,
    "expected_amount": 85000.0,
    "difference": 5000.0,
    "currency": "INR"
  }
}
KeyTypeDescription
statusInteger409.
messageStringAlways Prices have changed.
data.requested_amountNumberThe total_amount you sent.
data.expected_amountNumberThe current price for these travellers and selections.
data.differenceNumberexpected_amount minus requested_amount.
data.currencyStringCurrency of the amounts.

How to Handle Errors

StatusWhat to do
400Check the request: every room fits the room rules, the codes come from the Package Details response, and every field is sent ([] when nothing was chosen). See Pricing and Occupancy Rules.
401Check that the x-api-key header is sent as Bearer <API_KEY>, and that the key matches the environment (sandbox or production).
404Check the package code. The package may no longer be available; refresh your listings.
409Read the package again with the Package Details API, recalculate the total, show the new price to the traveller and call Book again.
500Retry after a short wait. If it continues, contact Volt API support.

Did this page help you?