Enterprise

Flighterz Developer Data API

Sync your company travel data into your ERP, data warehouse or finance system. Keys are issued from your business portal.

This API is read and sync only. It exposes read endpoints and signed change notifications. It can never search, book, issue, change or cancel a reservation.

Get your keys

Authentication

Pass your API key as a Bearer token on every request over HTTPS. Keys belong to one company account, so you only ever read your own data.

curl https://flighterz.com/api/v1/me \
  -H "Authorization: Bearer flz_live_xxxxxxxxxxxx"

Base URL: https://flighterz.com/api/v1

Scopes

Each key carries a set of read scopes. An endpoint returns insufficient_scope if the key is missing its scope.

account:readRead the company profile, plan and wallet balance.
employees:readRead the employee directory.
org:readRead departments, cost centers and projects.
trips:readRead trips and their itineraries.
bookings:readRead flight and service bookings and tickets.
invoices:readRead tax invoices and statement entries.
budgets:readRead budgets and live committed spend.
reports:readRead aggregated spend analytics.

Endpoints

EndpointScopeDescription
GET/meaccount:readCompany profile, plan and wallet.
GET/employeesemployees:readList employees. Paginated.
GET/employees/{id}employees:readOne employee.
GET/departmentsorg:readList departments.
GET/cost-centersorg:readList cost centers.
GET/projectsorg:readList projects.
GET/tripstrips:readList trips. Filters: status, departmentId.
GET/trips/{id}trips:readOne trip with its bookings.
GET/bookingsbookings:readList flight bookings. Filters: status, tripId.
GET/bookings/{id}bookings:readOne flight booking by id or reference.
GET/service-bookingsbookings:readList hotel, activity and transfer bookings.
GET/invoicesinvoices:readList tax invoices.
GET/budgetsbudgets:readBudgets with live committed spend.
GET/reports/spendreports:readAggregated spend over twelve months.

List endpoints are cursor paged: pass ?limit= (max 200) and ?cursor= from the previous meta.nextCursor. Amounts are in halalas (SAR times 100).

Responses

Every success returns a data field, and list responses add a meta with pagination.

{
  "data": [ { "id": "...", "reference": "TRP-ABCDE", "status": "TICKETED" } ],
  "meta": { "limit": 50, "count": 50, "nextCursor": "clx..." }
}

Errors return an error object with a stable code and a human message.

{ "error": { "code": "insufficient_scope", "message": "This key is missing the trips:read scope." } }

Rate limits

Live keys allow 120 requests per minute; sandbox keys allow 60. Each response carries X-RateLimit-Limit and X-RateLimit-Window headers, and a 429 includes Retry-After.

Webhooks

Register HTTPS endpoints in your portal and subscribe to events. When something changes we post a signed JSON event so you can pull the current state from the read endpoints.

booking.createdA corporate flight booking was recorded.
booking.issuedA corporate flight booking was ticketed.
service_booking.createdA corporate hotel, activity or transfer booking was recorded.
trip.createdA new trip was opened for the company.
subscription.updatedThe company plan or status changed.

Verify the signature

Every delivery carries an X-Flighterz-Signature header. Recompute the HMAC over the timestamp and raw body with your endpoint secret, and reject an old timestamp to prevent replay.

// Header: X-Flighterz-Signature: t=1700000000,v1=<hex>
import crypto from "node:crypto";

function verify(rawBody, header, secret, toleranceSec = 300) {
  const parts = Object.fromEntries(header.split(",").map((p) => p.split("=")));
  const expected = crypto
    .createHmac("sha256", secret)
    .update(`${parts.t}.${rawBody}`)
    .digest("hex");
  const fresh = Math.abs(Date.now() / 1000 - Number(parts.t)) < toleranceSec;
  return fresh && crypto.timingSafeEqual(Buffer.from(expected), Buffer.from(parts.v1));
}

Deliveries retry with exponential backoff up to eight attempts. Respond with any 2xx to acknowledge.

Sandbox

Create a sandbox key (flz_test_) to build against the same read endpoints at a lower rate limit before you switch to a live key.