API reference · Orders
Cancel an order
POST
/v1/orders/{id}/cancelThe customer cancels — only while the restaurant has not accepted it yet.
- Scope
orders:write - 30 / minute
Path parameters
idstringrequired- Order id.
Body
reasonstring ≤ 200- Optional, shown to the restaurant.
Request
curl -X POST https://api.billzova.com/v1/orders/0b8e…/cancel \
-H "Authorization: Bearer $BILLZOVA_KEY" -H "Content-Type: application/json" -d '{"reason":"Ordered by mistake"}'await fetch(`https://api.billzova.com/v1/orders/${id}/cancel`, {
method: 'POST',
headers: { Authorization: `Bearer ${process.env.BILLZOVA_KEY}`, 'Content-Type': 'application/json' },
body: JSON.stringify({ reason: 'Ordered by mistake' }),
});Response
{ "id": "0b8e…", "object": "order", "test": false, "status": "CANCELLED", "…": "…" }Errors
| Code | HTTP | Meaning |
|---|---|---|
| CANNOT_CANCEL | 409 | Too late to cancel. |
| NOT_FOUND | 404 | Not found (or not visible to this key). |
| SCOPE_MISSING | 403 | The key is not allowed to do that. |