# Get an onward ticket with Onward Flights You're helping someone get an onward ticket: proof of onward travel that airline check-in staff and immigration officers can ask for when someone enters a country on a one-way ticket. Onward Flights makes one from a real flight itinerary, with the passenger's name on it, as a web page and a PDF. It costs $5 ($10 when departing some countries), paid in USDC. Nothing is booked with the airline. ## 1. Work out the trip You need: - The country they're entering, and the city or airport they'll leave it from - When they arrive, and how long they're allowed to stay (their visa or visa exemption) - The airline they're flying in with, and where they're flying in from - The passenger's first and last name, exactly as on their passport - Optionally, an email address to send the ticket to Use anything you already know from this conversation or your memory of the user. Ask for whatever is missing in one short, friendly message, and don't make them fill in a template. Suggest sensible defaults when they're unsure, like an onward flight a week or two after they arrive. To check whether their destination asks for proof of onward travel, read https://onward.flights/{country}.md, e.g. https://onward.flights/thailand.md. Use it for the entry rules only: the flights listed there are for the next few weeks, so search for their dates below. ## 2. Find flights Search one-way flights from an airport in the country they're entering to a nearby, different country, departing well within their permitted stay. Pick flights on a different airline from the one they're flying in with, to a different country from the one they're coming from: check-in staff are more likely to look up a ticket on their own airline. Show them three or so options with the date, time, airline, route and stops, and let them choose. Each flight's `id` is what you buy it with (`ticket_id`), and it expires a day after the search. Use whichever of these you can: - MCP server `https://onward.flights/mcp`: `find_airports`, `search_flights`, `buy_ticket` - HTTP API: `GET https://onward.flights/api/airports?q=bangkok`, `GET https://onward.flights/api/flights?origin=BKK&destination=SIN&date=YYYY-MM-DD` - Web pages, if you can only browse: `https://onward.flights/search?origin=BKK&destination=SIN&date=YYYY-MM-DD` ## 3. Buy it Confirm the flight, the passenger's name and the price with them before paying. - If you can send USDC (on Base, Ethereum, Optimism or Polygon): call `buy_ticket`, or `POST https://onward.flights/api/purchase` with `ticket_id`, `first_name` and `last_name`. Without payment it returns exactly what to pay. Send it, then call again with the transaction hash. Full details: https://onward.flights/llms.txt - Otherwise, stop there and give them the flight's ticket link (https://onward.flights/tickets/{id}). They open it, enter their name and pay with a crypto wallet, and the ticket unscrambles straight away. ## 4. Hand it over Give them the ticket link and the PDF. Suggest they save the PDF or a screenshot to their phone in case they don't have data at the airport, and show it if they're asked for proof of onward travel.