Create Checkout Session
create_checkout_sessionStarts a new UCP checkout session for one or more products, clearing any existing cart and returning a session_id for subsequent update and complete calls.
Instructions
Create a UCP checkout session with one or more products.
Use this when the user wants to buy something. Clears any existing cart and starts a new checkout session. Returns a session_id needed for subsequent update and complete calls.
Args: items: List of items to purchase. Each item must have: - product_id (int): from list_shop_products - quantity (int, optional): defaults to 1
Returns: UCP CheckoutSession with session_id, status, line_items, total_chf.
Example: >>> result = await create_checkout_session([{"product_id": 42, "quantity": 1}]) >>> session_id = result['session_id']
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"items": "<items>"
},
"name": "create_checkout_session"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| items | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||