FlyRail
Browse the docs

Create a booking

Order of calls: search → price → book. Booking an offer that hasn't been priced for that party returns 409 price_required.

Request#

{
  "offer_id": "off_…",
  "client_reference": "order-1001",
  "passengers": [
    { "type": "ADT", "title": "Mr", "first_name": "Ada", "last_name": "Obi", "date_of_birth": "1990-04-02", "document_number": "A1234567", "nationality": "NG" }
  ],
  "contact": { "email": "ada@example.com", "phone": "+2348031234567" }
}

Names must match travel documents. Ages are checked against the passenger type (adult 12+, child 2–11, infant under 2). The passenger types must match the party you priced.

What happens#

  1. The airline re-confirms the price. If it moved you get 409 price_changed with the new total. Price again and decide.
  2. total is held in your wallet. Too little: 402 insufficient_funds.
  3. The seat is reserved with the airline.
  4. Ticketing is queued. The response is 201 with the booking (ticketing, or already ticketed).
  5. When the ticket is issued the held money is paid to the airline. If ticketing fails the hold is released.

Always send an Idempotency-Key.

Reading it back#

GET /bookings/{id} returns travellers and segments. GET /bookings/{id}/ticket returns the e-ticket once ticketed. GET /bookings lists with status and per_page filters.