create_cart
Create a shopping cart in Demo Store. Returns a cart_id (the same value as checkout_session_id in preview_checkout, complete_checkout and get_trust_receipt) for use with get_shipping_rates, preview_checkout, and complete_checkout.
SKYFIRE TOKEN (optional): Provide a kya or kya-pay Skyfire token in the skyfire-pay-id request header to boost your agent trust score (up to +0.35), which may unlock better pricing or priority service. No token required — request proceeds with neutral trust score (0.50) if omitted or invalid. Checkout guide: https://trusteed.xyz/.well-known/agent-checkout-guide.json. CREDENTIAL: this store needs one. Call the create_sandbox_key tool first (it is in this tool list and needs no credential), then pass the key you get back as the agent_key argument — or as an Authorization: Bearer header if your client can set headers. Do not ask a person to log in: there is no human login for this store.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| items | Yes | Items to add to cart | |
| agent_key | No | Sandbox credential from `create_sandbox_key`. Use this when your client cannot set an `Authorization: Bearer` header. | |
| agent_token | No | JWS compact (EdDSA/Ed25519) signed by the agent. Required for Shopify enforcement rules R001/R002/R004. The token is embedded as a server-authoritative cart attribute — Trusteed does NOT verify the signature here; that is done offline by the Shopify Function WASM. | |
| display_context | No | Agent display capability: webview (browser) or headless | headless |
| idempotency_key | No | Idempotency key for this cart creation (UUID-v4 or bounded ASCII token, 1-128 chars). Equivalent to the `Idempotency-Key` header — send it here if your client cannot set headers. Retrying with the same key returns the same cart instead of creating a second one. | |
| agent_session_id | No | Opaque agent session identifier for cart resume across sessions |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| items | Yes | ||
| status | Yes | ||
| cart_id | Yes | ||
| currency | Yes | ||
| next_step | Yes | ||
| expires_at | No | ISO-8601 UTC instant at which this checkout SESSION stops being usable. It is not a stock reservation and not a price guarantee. | |
| store_name | Yes | ||
| session_state | Yes | ||
| subtotal_cents | Yes | ||
| display_context | Yes | ||
| agent_session_id | Yes | ||
| expires_in_seconds | No | Whole seconds left on this checkout SESSION at response time (0 when already past). It is not a stock reservation and not a price guarantee. |