create_order_draft
Freeze one of your carts, with a delivery address, into an order draft and get its approval URL. Requires an API key with the orders:write scope. A person opens the URL, checks the frozen lines, address and totals, picks a payment method and pays in the browser — this tool never places the order itself, and any later change to the cart voids the draft. Repeating the call with the same idempotency_key returns the same draft, but the approval URL is shown only on the first, creating call.
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_id": "<cart_id>",
"idempotency_key": "<idempotency_key>",
"address": "<address>"
},
"name": "create_order_draft"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| address | Yes | The delivery address the order will ship to. | |
| cart_id | Yes | The cart handle, from `create_cart`. | |
| idempotency_key | Yes | A caller-chosen key: repeating a create with the same key returns the same draft instead of drafting twice. At most 128 characters. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| lines | Yes | The draft's lines, from its snapshot. | |
| status | Yes | `pending`, `consumed`, `expired` or `void`. | |
| draft_id | Yes | The draft's id. | |
| order_id | Yes | The placed order's id, once the draft is consumed. | |
| total_yen | Yes | Grand total in yen. | |
| expires_at | Yes | When the approval window closes, RFC 3339. | |
| approval_url | Yes | The browser approval URL (create answer only). | |
| shipping_yen | Yes | Shipping fee in yen. | |
| subtotal_yen | Yes | Sum of line totals in yen. |