fulfillment.status: "completed" in the sandbox environment, paying agentically: no browser, no card, no human at a checkout page.
Every command below is copy-paste ready. Set two variables and work down the page.
What you need
- A sandbox API key. Sandbox and production use separate keys; a production key will not authenticate here.
curlandjq.- For steps 4 to 6, access to the test-token mint, which is not yet available in sandbox.
Sandbox is a fully isolated environment. Bookings made here are never ticketed, never charged, and never reach a real airline.
How agentic payment works
The normal flow sends a human to a checkout page. The agentic flow replaces that step with a Shared Payment Token (SPT), a Stripe object that authorizes one specific charge up to one specific amount.1) Price a flight
Search mode needs a route and a date. Passcurrency: "USD" so the cart quotes in USD.
2) Build the trip
One call creates the trip, adds the item, and attaches the traveler and contact. Both a traveler and a contact withemail and phone are required before a trip can be booked.
3) Check out and read agent_spt_params
checkout quotes the cart and returns everything you need to pay for it.
agent_spt_params is the mandate for the token you are about to mint. Note max_amount is 18865, not 188.65: it is in minor units, hundredths of a dollar.
4) Mint a test Shared Payment Token
This is the step that replaces your buyer’s payment platform: it mints a Stripe test-mode token so you can authorize a booking without a real card. The request, once you have a host to send it to:
A 503 here means the environment has no Stripe agent account configured. That is a deployment issue, not a bad request. Nothing else returns 503.
5) Submit the payment
This step needs the
$SPT from step 4, so in sandbox it is not reachable today. The contract is documented so you can build against it.If the response carries a
checkout_url, the agentic path stopped. The card issuer asked for a 3DS step-up, or declined. Send a human to that URL to finish. This is the designed fallback, not an error, so handle it in production code.6) Poll until it lands
get_trip is a cheap read rather than a live provider call, so polling every few seconds is fine.
completed you get one entry per item:
partial means some items booked and some did not.
The polling loop itself works in sandbox today against any trip, including one paid through the ordinary hosted checkout. Only the token mint in step 4 is blocked.
When something goes wrong
What’s next?
- Webhooks so you learn a booking landed without polling.
- Flight booking guide for the browser-based checkout flow.
- Errors for the full status-code reference, including what happens when a price moves.
