Inspiration

Planning a trip with a few cities in it usually means a lot of open tabs. You book the flight on one site, the hotels on two others, and the tours somewhere else, and you pay four times with four receipts. Price comparison sites help you find a good price, but then they send you off to pay for each piece separately.

We wanted to see if an AI agent could handle the whole thing: read the trip you describe, find the best price for each part across several platforms, and let you pay for all of it once with PayPal.

What it does

  1. You type the trip in plain words, for example "Japan, 2 people: Tokyo day 1, Osaka day 2, Mount Fuji on day 3". An intake agent turns that into stops, nights, dates, number of travellers and a budget, and our code checks it.
  2. A planner agent searches every platform at the same time. Flight fares come from Duffel (test mode), hotel rates from LiteAPI, and market fares from Aviasales through Travelpayouts. Two simulated travel agencies resell the same inventory at their own prices. The agent compares what each platform charges for the same flight or room, checks whether a nearby date is cheaper, and builds a plan that fits the budget. The "Deal hunt" panel shows how much each item saved. Those numbers come from our server, so the model can't make them up.
  3. The trip page shows a day-by-day itinerary and a Bryntum Scheduler timeline with flights, hotel and activities in local time. Anything that clashes is striped red. Click a bar and you can swap that item for another option from the same search, and the plan updates in about a second.
  4. At checkout we first re-check every price with its supplier. If a price changed, you see the new total and approve it again. Then we create one PayPal order with every item as a line item, and you approve it once.
  5. After the payment is captured, Tripweave books each supplier, starting with flights. If one booking fails, we refund only that item's cost to your PayPal, and the timeline marks it as refunded with the reason.
  6. A rebooking agent then looks for another activity that fits the empty slot: inside your dates, not clashing with anything still booked, and within the refunded amount. Its picks show up on the timeline as suggestions. Nothing gets charged unless you book it.
  7. Once the trip is paid you get e-tickets with QR codes and a PDF boarding pass. You also get a "Find gear" list of real products under your remaining budget (Channel3), and a "Trip spend" dashboard built with AG Studio. The dashboard has a PayPal money trail and an AI auditor that checks every order adds up to the cent.

How we built it

  • Next.js 16, React 19 and TypeScript, with Supabase for Postgres, auth and row-level security. It deploys to Heroku from GitHub Actions.
  • PayPal through the official Server SDK (@paypal/paypal-server-sdk). We use Orders v2 to create and capture, partial refunds, and webhooks that we verify with PayPal before trusting them. Every order, capture and refund request sends a PayPal-Request-Id based on the quote, so a retry can't charge or refund twice.
  • OpenAI gpt-6-luna through LangChain and LangGraph. The agents work through typed tools such as search_flights, search_hotels, compare_platforms, check_market, build_itinerary and find_replacements.
  • The model only picks offers by ID. Our code calculates every price, total, budget check, refund and booking, and it re-checks whatever the agent picks. That way the agent can't invent a price, a time or a product.
  • Suppliers sit behind one adapter interface with contract tests, so adding a new platform means one adapter file and some recorded test data.

Challenges we ran into

  • Our first idea was to let the AI pay each supplier directly. In our research we couldn't find a way for one PayPal approval to pay several unrelated merchants without partner status. Vault only works with a single merchant, and the Agent Toolkit has no way to change the payee. So Tripweave acts as the merchant of record: we collect once, pay the suppliers, and refund per item when something fails. We wrote that decision down as an ADR in the repo.
  • PayPal's payee field looked like it might be locked behind partner approval (PAYEE_NOT_CONSENTED), so we tested it in the sandbox. We created, approved and captured an order that paid two different third-party accounts, and it worked. One of those captures stayed in PENDING_REVIEW, so we kept direct supplier payouts in a sandbox lab page and left them out of the main checkout. Airlines can't be paid this way in any case, because they settle through IATA BSP.
  • Real travel inventory is hard to get access to. Amadeus shut down its self-service APIs in July 2026, and real Duffel ticketing needs a funded balance. We use real search and repricing, and we say clearly which parts are simulated.

Accomplishments that we're proud of

  • The full payment flow works end to end in sandbox. You approve once, we capture and book each item, failed items get refunded automatically, webhooks confirm the result, and the AI auditor checks that paid equals booked plus refunded plus pending.
  • The agents do real work, but they never move money themselves.
  • We went from an empty repo to this in six days as a team of four, with 36 test files along the way.

What we learned

The hard part of an agent that spends money is deciding where it has to stop. We spent more time on idempotency keys, re-checking prices before approval and refunding per item than on prompts, and that's what made the payment flow reliable.

What's next

  • Paying hotel and activity suppliers directly through PayPal's partner platform once they're onboarded.
  • Real airline ticketing through Duffel Orders, and real travel agency partners instead of the two simulated ones.
  • Watching prices after booking, and refunding the difference if a booked item gets cheaper.

What's real and what's simulated

Real: the PayPal sandbox orders, captures, refunds and webhooks. Duffel test-mode fares and repricing. LiteAPI hotel rates and sandbox bookings. Travelpayouts market fares. Channel3 products. Every tool call the agents make.

Simulated: the two travel agency partners ("Nusantara Trips" and "SkyBazaar"), airline ticketing, and activity bookings. These return references starting with SIM-.

Built With

Share this project:

Updates

Submission history