Create UCP Shopping Cart
create_cartCreate a stateful UCP shopping cart with itemized USD cent totals and instant digital delivery estimates. Use this for low-commitment basket assembly; use create_checkout directly when ready to finalize purchase. Parameters: pass cart.line_items (array of { item: { id }, quantity }), optional cart.context, and optional cart.buyer. Behavior: allocates a ucart_* session valid for 2 hours, validates variant stock, and returns subtotal/total in USD cents plus continue_url.
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": {
"cart": "<cart>"
},
"name": "create_cart"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| cart | Yes | UCP cart creation body. | |
| meta | No | UCP protocol request metadata (meta.ucp-agent and meta.idempotency-key). |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ucp | Yes | Negotiated UCP protocol metadata and capability intersection. |