Getting started
From an API key to your first reservation: a lookup against the sandbox airline, the webhook that says it's done, and going live.
Get your API keys
Request access and we send you two API keys: a sandbox key that starts pk_test_ and a live key
that starts pk_live_. Sandbox lookups go to the sandbox airline, never touch a real booking,
and are free.
Send the key in the Authorization header of every request, and keep it on your server: anyone with it can look up
bookings on your account.
Start a lookup
A lookup needs the airline's two-letter code, the booking reference, the passenger's surname, and your confirmation that the passenger asked you to retrieve it.
curl https://api.pnrstack.com/v1/lookups \
-H "Authorization: Bearer pk_test_…" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: order-4821" \
-d '{
"airline": "ZZ",
"pnr": "SBXOK1",
"surname": "Hartley",
"consent": "passenger_authorised"
}'The lookup starts at once, and you get its ID back:
{
"id": "lkp_01JC9V2M8R",
"status": "queued",
"airline": "ZZ",
"created_at": "2026-12-04T09:12:05Z"
}Get the reservation
Lookups run in the background, so nothing waits on the request. Most finish within a minute or two, and sandbox ones in a few seconds. Register a webhook and we tell you each time a lookup's status changes:
curl https://api.pnrstack.com/v1/webhooks \
-H "Authorization: Bearer pk_test_…" \
-H "Content-Type: application/json" \
-d '{ "url": "https://example.com/pnrstack/events" }'When the lookup reaches completed, the event carries the whole lookup with its reservation. You can also read it
whenever you like:
curl https://api.pnrstack.com/v1/lookups/lkp_01JC9V2M8R \
-H "Authorization: Bearer pk_test_…"Webhooks covers checking that an event really came from us, and The reservation covers every field you get back.
Handle the other outcomes
Not every lookup ends in a reservation. The airline may ask the passenger for a code, the surname may not match, or the airline's site may be down. The sandbox has a booking reference for each, so your integration handles them all before a real booking goes through: Sandbox lists them.
Go live
Swap the sandbox key for your live key and use real airline codes. Airlines lists the airlines you
can look up and what each one needs. Only lookups that reach completed count toward your plan.