FlyRail
Browse the docs

Quickstart

Make your first sandbox booking in five minutes.

1. Get a test key#

Register, then open API keys and create a test key. It looks like fr_test_sk_… and is shown once. Keep it on your server, never in a mobile app or browser.

curl -X POST https://sandbox-api.flyrail.space/v1/flights/search \
  -H "Authorization: Bearer $FLYRAIL_KEY" -H "Content-Type: application/json" \
  -d '{"origin":"LOS","destination":"ABV","date":"2026-12-20","adults":1}'

Each option has an offer_id. Offers expire after 30 minutes and belong to your account only.

3. Price the offer#

curl -X POST https://sandbox-api.flyrail.space/v1/offers/OFFER_ID/price \
  -H "Authorization: Bearer $FLYRAIL_KEY" -H "Content-Type: application/json" \
  -d '{"adults":1}'

The answer has fare, service_fee and total in kobo. This is what will be held in your wallet.

4. Book#

curl -X POST https://sandbox-api.flyrail.space/v1/bookings \
  -H "Authorization: Bearer $FLYRAIL_KEY" -H "Content-Type: application/json" \
  -H "Idempotency-Key: order-1001-attempt-1" \
  -d '{"offer_id":"OFFER_ID","client_reference":"order-1001",
       "passengers":[{"type":"ADT","title":"Mr","first_name":"Ada","last_name":"Obi","date_of_birth":"1990-04-02"}],
       "contact":{"email":"ada@example.com","phone":"+2348031234567"}}'

The booking comes back with a status. See the booking lifecycle. In the sandbox it is usually ticketed immediately.

Your test wallet needs funds. Use Wallet → Add test funds in the portal.