Cancel an order
cancel_orderDestructiveIdempotent
Cancel an order. Unpaid: closes the payment link; nothing is charged. Paid and not yet in production: cancels and refunds in full. In production or shipped: cannot be cancelled; the error gives the reason. A second call on a cancelled order is safe.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| reason | No | ||
| order_id | Yes | order_id returned by purchase. |
Output Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| items | Yes | ||
| total | Yes | ||
| status | Yes | ||
| payment | Yes | ||
| order_id | Yes | A bearer key: whoever has it can read and cancel the order. Do not share it publicly. | |
| quote_id | Yes | ||
| timeline | Yes | ||
| next_step | Yes | What the agent should do next, in plain language. | |
| order_url | Yes | The order page. The person sees the status there. | |
| shipments | Yes | ||
| destination | Yes | While address_needed: the quoted destination. | |
| status_reason | Yes | ||
| address_needed | Yes | True when purchase had no street address: the person enters it on the order page before paying. | |
| delivery_estimate_business_days | Yes | Null when the order ended (cancelled, refunded, rejected, expired or delivered). |