Skip to main content
Turn a finalized trip into a checkout link the user can pay through. Use it once the trip is set and traveler details are filled in, for example after the user picks a Paris to Tokyo round trip and adds a hotel for the stay. The returned URL is what the user opens in a browser to complete payment.
Schedule checkout for a trip — returns a Stripe checkout URL the user can open in a browser to complete payment.

PREREQUISITES (call these first via the trip tool):
  trip(add_item)         → add the chosen flight or hotel to the trip
  trip(upsert_travelers) → set traveler details + contact info
  trip(select_ancillaries) [optional] → add bags/seats/meals before quoting (flights only)

USAGE:
  book({ trip_id })

The BFF schedules a quote, polls until it completes, schedules fulfillment, and returns a Stripe checkout URL — all in one synchronous call. Open the returned checkout_url in a browser to complete payment. Stripe webhooks finalize the booking after payment succeeds; no client-side confirm step is required.

IMPORTANT: Never fabricate traveler data. Always make sure trip(add_item) and trip(upsert_travelers) have been called with real user-provided data first.

Parameters

NameTypeRequiredDescription
trip_idstringYesTrip ID from the trip tool. The trip must have items (add_item) and travelers (upsert_travelers) set before booking.

Examples

Check out a ready trip:
{
  "name": "book",
  "arguments": { "trip_id": "42" }
}
Response:
{
  "status": "success",
  "trip_id": "42",
  "session_id": "123",
  "checkout_url": "https://app.gojinko.com/checkout?sid=123",
  "items": [
    {
      "item_id": 7,
      "kind": "flight",
      "price": { "total": 842.30, "currency": "USD" },
      "available_ancillaries": [
        { "offer_id": "anc_bag_20kg", "type": "BAGGAGE", "price": 35.00, "name": "Extra 20kg bag" }
      ]
    }
  ]
}
What to do with the response:
  1. Open checkout_url in the user’s browser (or your widget’s openLink).
  2. The user completes payment on Stripe.
  3. Webhooks fulfill the booking, no client-side confirmation step needed.
  4. Poll get_trip to watch fulfillment.status go pending → fulfilling → completed.
book calls are idempotent per trip, calling it twice returns the same session_id and checkout_url until the session expires.