Skip to main content
The errorCode field is the most reliable signal for programmatic error handling. HTTP status codes indicate broad categories; error codes give you the exact diagnosis.

Error Response Format

All error responses share a common envelope:

Field Reference


Validation Errors

When a request fails field-level validation — for example, submitting a booking without a passenger email — the reason field becomes an array of objects, each describing a specific field that failed:
Use the reason array to surface field-specific feedback directly in your booking forms. Each object maps precisely to a form field, making inline validation straightforward:

Error Code Catalog

Error codes follow a structured namespace: TB_<CATEGORY>_<CODE>. This makes it easy to handle entire categories with a single prefix check before falling through to specific codes.

Authentication — TB_AUTH_*

Permissions — TB_PERM_*

Validation — TB_VAL_*

Resources — TB_RES_*

System — TB_SYS_*

Rate & Quota Limits — TB_LIM_*

Payments — TB_PAY_*

Payment errors require careful handling. Always check retryable before attempting a retry — retrying a non-retryable payment error can result in multiple authorisation holds on a traveller’s card.

Tenant Status — TENANT_*

These errors apply when your platform operates in a multi-tenant context. They reflect the operational status of the tenant account making the request.

Handling Errors in Code

The following patterns cover the full error handling lifecycle for a Travelbase integration.

Retry Strategy

Not every error should be retried. Use retryable: true as your gate, then apply exponential backoff to avoid overwhelming the API during degraded conditions.
Add random jitter (a small random offset on top of the delay) to prevent a thundering herd — many clients retrying in perfect lockstep can amplify an outage rather than recover from it.

Decision Tree

When you receive an error, follow this path to resolution:
1

Check `fault`

"client" means your request needs to change before retrying. "server" means the problem is on Travelbase’s side and may resolve on its own.
2

Check `retryable`

If false, do not retry — fix the request first. If true, proceed to backoff.
3

Match on `errorCode`

Use the catalog above to understand the exact cause. Handle auth, validation, payments, and tenant errors with dedicated logic paths.
4

Use `suggestedAction`

Surface this field to internal support tooling or operations dashboards. It is written for humans, not machines.
5

Escalate if needed

For TB_SYS_600, TN_ISE_901, TB_PAY_802, or persistent TENANT_SUSPENDED, open a support ticket with the full error body and your request ID.

Common Mistakes


TypeScript Error Code Enum

Copy this enum directly into your project for compile-time safety across all error handling code: