Travix Lab
API Reference

API Documentation

Everything you need to integrate: authentication, endpoints, schemas, SDKs, error codes, and webhooks.

Authentication

All Travix Lab API endpoints require authentication via a Bearer token. Include your API key in theAuthorization header on every request. Never expose your API key in client-side code or version control.

# Include on every request:
Authorization: Bearer YOUR_API_KEY

# Example with curl:
curl -X POST https://api.travixlab.com/v1/flights/search \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "origin": "DXB", "destination": "LHR", "date": "2026-09-01" }'

OAuth 2.0 also supported: For server-to-server integrations requiring short-lived access tokens, use the client credentials flow at POST /oauth/token. Contact us for OAuth client credentials.

Base URLs

Two environments are available — sandbox for testing and development, production for live traffic. All endpoints are identical between environments; only the base URL changes.

Sandboxhttps://sandbox.api.travixlab.com/v1
Mock inventory, no live bookings, free to use
Productionhttps://api.travixlab.com/v1
Live suppliers, real bookings, paid plan required

Sandbox Environment

The sandbox is a full-featured test environment with realistic mock inventory. You can complete end-to-end booking flows — search, price, book, issue, cancel — without real charges or supplier calls. Sandbox credentials are provisioned within one business day of signup.

  • Flights: 1,000+ mock itineraries with real fare logic and seat maps
  • Hotels: 500+ mock properties with availability, rates, and room types
  • eSIM: All country plans available with mock activation flow
  • Payments: Use test card 4242 4242 4242 4242 for successful transactions
  • Webhooks: Events fire in real time against sandbox bookings
  • No rate limits in sandbox — test at full throughput

Rate Limits

Rate limits apply per API key. When exceeded, the API returns HTTP 429 with aRetry-After header indicating when to retry.

PlanRequests / secBurstMonthly quota
SandboxUnlimitedNo limit
Starter30 req/s100 req/s (10s)5M requests
Growth100 req/s300 req/s (10s)50M requests
EnterpriseCustomCustomUnlimited

Error Codes

All errors follow a consistent JSON schema with code,message, and optionaldetails array for field-level validation errors.

{
  "error": {
    "code": "VALIDATION_ERROR",
    "message": "Invalid request parameters",
    "details": [
      { "field": "date", "issue": "Must be a future date (YYYY-MM-DD)" },
      { "field": "passengers.adults", "issue": "Must be between 1 and 9" }
    ]
  }
}
StatusNameMeaning
400Bad RequestInvalid parameters or malformed request body
401UnauthorizedMissing or invalid API key
403ForbiddenAPI key doesn't have access to this endpoint
404Not FoundResource (booking, PNR, hotel) not found
409ConflictBooking conflict — seat or room no longer available
422Unprocessable EntityValidation error — check error.details for field errors
429Rate LimitedToo many requests — see Retry-After header
500Internal Server ErrorServer-side error — safe to retry with Idempotency-Key
503Service UnavailableUpstream supplier unavailable — retry after delay

Official SDKs

Official SDKs are available in 6 languages. All SDKs are auto-generated from our OpenAPI spec, maintained by Travix Lab engineers, and updated in lockstep with API changes.

Node.js / TypeScript
npm install @travixlab/sdk
Python
pip install travixlab
PHP
composer require travixlab/sdk
Java
com.travixlab:travixlab-sdk:latest
.NET / C#
dotnet add package Travixlab.SDK
Go
go get github.com/travixlab/go-sdk

Webhooks

Webhooks deliver real-time event notifications to your server. Each webhook payload is signed with HMAC-SHA256 using your webhook secret. Verify the signature before processing to prevent spoofed events.

// Node.js: Verify webhook signature
const crypto = require('crypto');

function verifyWebhook(payload, signature, secret) {
  const hmac = crypto.createHmac('sha256', secret);
  hmac.update(payload);
  const expected = 'sha256=' + hmac.digest('hex');
  return crypto.timingSafeEqual(
    Buffer.from(expected),
    Buffer.from(signature)
  );
}
EventDescription
booking.confirmedA booking has been successfully confirmed with the supplier
booking.failedBooking attempt failed — check error details for reason
ticket.issuedE-ticket or voucher has been generated and dispatched
booking.cancelledBooking cancelled — refund details included if applicable
pnr.modifiedPNR has been modified (seat change, passenger update, etc.)
payment.capturedPayment successfully captured from card or wallet
payment.refundedRefund processed — amount and timeline included
esim.activatedeSIM QR code scanned and plan activated by traveller

Idempotency

For write operations (booking, payment, cancellation), send anIdempotency-Keyheader. If your request fails before receiving a response, retry with the same key — the server will return the original response rather than creating a duplicate booking.

POST /v1/bookings
Authorization: Bearer YOUR_API_KEY
Idempotency-Key: 7f9c3b1a-2e4d-4f8a-9b6e-1c3d5e7f9a2b
Content-Type: application/json

Versioning

Travix Lab APIs use semantic versioning. The current stable version is v1. Breaking changes are always introduced in a new major version (v2, v3). Your existing integration is never silently broken — we provide 90+ days notice before deprecating any version. Non-breaking additions (new optional fields, new endpoints) are added to existing versions without notice.

Need full API reference for a specific product?

Each API has its own detailed reference page with endpoint specs, request/response schemas, and live examples.

Ready to start building?

Request sandbox access and make your first API call in under 30 minutes.