Cancel an order
cancel_orderUse only when the user asks to cancel. Takes the private order ref; unpaid orders are cancelled and paid orders are refunded if they have not gone to print. Returns the updated order; fails with order_not_cancellable once printing has started.
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": {
"ref": "<ref>"
},
"name": "cancel_order"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ref | Yes | Private order reference returned by prepare_postcard. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ref | Yes | Private order reference. Treat like a password. | |
| mode | Yes | "test" = free sandbox (never printed, Stripe test card 4242 4242 4242 4242). "live" = real card, printed and mailed. Always explicit. | |
| cards | Yes | ||
| total | Yes | ||
| status | Yes | ||
| createdAt | Yes | ||
| statusUrl | Yes | ||
| recipients | Yes | ||
| checkoutUrl | Yes | Stripe-hosted payment page (when awaiting payment). | |
| nextActions | Yes | What the agent can do next, in order of preference. | |
| frontPreviewUrl | Yes |