Cancel an unpaid order
post
https://api.flactrum.com/v1/orders/{order}/cancel
For an order whose payment has NOT been taken. Restores the balance and points spent, puts the ingredients back into stock and moves the order to cancelled, which drops it from the kitchen board. A paid sale is refunded instead — 409 here — because a cancellation never shows as money leaving the till. Send restock: false when the order was made and thrown away; the loss then stays in stock and is reported as waste.
| Required scope | orders.refund |
| Success status | 200 |
| Returns | One Order object |
Parameters
| Name | In | Type | Description |
|---|---|---|---|
| order * | path | string | ULID of the record. |
Request body
| Field | Type | Description |
|---|---|---|
| reason | string|null | — |
| restock | boolean | Whether the ingredients go back into stock. Send false when the product was actually consumed. |
Response fields
| Field | Type | Description |
|---|---|---|
| id | string | — |
| order_number | string | — |
| branch_id | string | — |
| channel | string | Where the sale came from. |
| status | string | Payment lifecycle. A kiosk order paid at the counter stays `pending` until POST /orders/{order}/pay. |
| display_number | string | Short daily number called out to the customer, e.g. 007. |
| kitchen | object | Kitchen stage: `status` is new, preparing, ready, delivered or null (never goes to the kitchen), with the time each stage was reached. |
| customer_id | string|null | — |
| customer_name | string|null | Free text typed at the kiosk so staff can call the order by name. Unrelated to customer_id, which is a registered loyalty customer. |
| payment_method_id | string|null | On a kiosk order this is the method the customer chose; the money is still collected at the counter, so the order stays `pending` until POST /orders/{order}/pay. |
| totals | object | total, subtotal, tax, discount, campaign_discount, cost, gross_profit. |
| customer_payment | object | How much was covered by balance and points, and what was earned. |
| items | array | Prices are frozen at sale time; later menu or campaign changes never alter a past receipt. A line refunded later is split off with `cancelled_at` set and no longer counts toward the totals. |
| payments | array | How the money was collected, one entry per method. A split bill (several methods) has several entries; balance and points are in customer_payment. |
| adjustments | array | Refunds and waste recorded after the sale, oldest first. |
| note | string|null | — |
| ordered_at | string | — |
Examples
Recorded from the test suite — these are real requests and their real responses.
curl -X POST 'https://api.flactrum.com/v1/orders/01m43sk9kvk2fqvz6mgeqvq418/cancel' \
-H 'Authorization: Bearer flk_your_key:your_secret' \
-H 'Content-Type: application/json' \
-d '{
"reason": "Müşteri kasaya hiç gelmedi"
}'
HTTP 200 · application/json
{
"data": {
"id": "01m43sk9kvk2fqvz6mgeqvq418",
"order_number": "NIS-261004-0001",
"branch_id": "01m43sk9hgqc33y08h3pv79tty",
"channel": "kasa",
"service_type": "counter",
"table": null,
"status": "cancelled",
"display_number": "001",
"kitchen": {
"status": "new",
"preparing_at": null,
"ready_at": null,
"delivered_at": null
},
"customer_id": null,
"customer_name": null,
"payment_method_id": "01m43sk9k5dnn01e3xty8xstpm",
"totals": {
"total": 200,
"subtotal": 181.82,
"tax": 18.18,
"discount": 0,
"campaign_discount": 0,
"cost": 43.2,
"gross_profit": 138.62
},
"customer_payment": {
"paid_with_balance": 0,
"paid_with_points": 0,
"points_spent": 0,
"points_earned": 0
},
"items": [
{
"id": "01m43sk9m2njrb7hwsmx8gby39",
"product_id": "01m43sk9j16y93kh2v6bcvv0gw",
"campaign_id": null,
"quantity": 2,
"unit_price": 100,
"list_price": 100,
"campaign_discount": 0,
"total_price": 200,
"tax_rate": 10,
"tax_amount": 18.18,
"cancelled_at": null,
"cancel_reason": null,
"addons": []
}
],
"payments": [
{
"payment_method_id": "01m43sk9k5dnn01e3xty8xstpm",
"name": "Nakit (test)",
"type": "cash",
"amount": 200,
"reference": null
}
],
"adjustments": [],
"note": "İptal: Müşteri kasaya hiç gelmedi",
"ordered_at": "2026-10-04T15:47:52+00:00",
"paid_at": "2026-10-04T15:47:52+00:00",
"created_at": "2026-10-04T15:47:52+00:00",
"updated_at": "2026-10-04T15:47:52+00:00"
}
}
curl -X POST 'https://api.flactrum.com/v1/orders/01m43sk9tgb0hr83x9ybgjvnxq/cancel' \
-H 'Authorization: Bearer flk_your_key:your_secret' \
-H 'Accept: application/json'
HTTP 409 · application/json
{
"error": {
"code": "conflict",
"message": "A paid sale is not cancelled; refund it instead.",
"details": {
"status": "completed"
}
}
}