Prepare checkout
prepare_orderTurn the cart, address and promo into a draft order and return {checkout_url, draft_id, expires_at}. Send checkout_url to the human: checkout opens pre-filled and they review and pay themselves — the agent never pays. Call it only after showing get_order_preview and getting the human's OK. Each call creates a NEW draft with its own number, so call it once per purchase; the cart itself is not emptied. The draft expires after 48 hours. Prices are re-checked; an empty cart, a missing address or no orderable items return an error (with issues) and create nothing.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "prepare_order"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| note | No | ||
| error | No | Empty cart, missing address or no orderable items. | |
| total | No | ||
| issues | No | ||
| currency | No | ||
| draft_id | No | Draft order number. | |
| expires_at | No | ISO 8601 time when the draft expires (48 h). | |
| checkout_url | No | Pre-filled checkout link — send it to the human to review and pay. |