create_ucp_checkout
Open a UCP checkout session: pass line_items, and optionally buyer, context, payment, signals, cart_id, fulfillment, discounts, currency, idempotency_key and agentid_token. Pass the same idempotency_key with the same body to retry safely: you get the first session back instead of a second one. Pass agentid_token to have the session record you as a verified buying agent. It answers the session with its id and status. Needs a Last Price credential with price compute scope. Needs a claimed workspace: a sandbox key from self-registration is refused (403) until a person claims the workspace.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| buyer | No | Who is buying. | |
| cart_id | No | The cart this checkout comes from. | |
| context | No | Where the checkout happens: locale, country, channel and the like. | |
| payment | No | The payment handler and currency. | |
| signals | No | Where the buyer came from: referrer, utm values and device type. | |
| currency | No | The currency. Defaults to the first line item's, or USD. | |
| discounts | No | Discount codes to apply. | |
| line_items | Yes | What is being bought. | |
| fulfillment | No | How the order is fulfilled: its methods. | |
| agentid_token | No | Optional: your AgentID ID token (from auth.agentid.com, issued for Last Price), sent as the AgentID-Token header so the quote records you as a verified buying agent. Leave it out to buy unverified. | |
| idempotency_key | No | Your key for this checkout. Retrying with the same key and body returns the first session; the same key with a different body is refused. |