> ## Documentation Index
> Fetch the complete documentation index at: https://docs.dev.gojinko.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Checkout Trip

> Checkout a trip: returns a checkout URL the user opens to pay, plus agent payment params

Turn a finalized trip into its two payment paths. 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 checkout\_url is what a human opens in a browser to pay; agent\_spt\_params is what an agent uses to pay programmatically via submit\_agent\_payment.

<Accordion title="Tool description (what the LLM sees)" defaultOpen={false}>
  ```text theme={null}
  Checkout a trip: returns the web checkout_url a human opens to pay, plus the agent_spt_params an agent can use to pay programmatically (no browser).

  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:
    checkout({ trip_id })

  The BFF schedules a quote, polls until it completes, schedules fulfillment, and returns a Stripe checkout URL, all in one synchronous call.
    • Human path: open the returned checkout_url in a browser to pay. Stripe webhooks finalize the booking after payment succeeds; no client-side confirm step is required.
    • Agent path: mint a Shared Payment Token scoped to agent_spt_params, then call submit_agent_payment({ trip_id, shared_payment_token }).

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

## Parameters

| Name      | Type     | Required | Description                                                                                                             |
| --------- | -------- | -------- | ----------------------------------------------------------------------------------------------------------------------- |
| `trip_id` | `string` | Yes      | Trip ID from the trip tool. The trip must have items (add\_item) and travelers (upsert\_travelers) set before checkout. |
