Refund or write off a completed order
For a completed sale, whole or line by line. refund returns the money and, with restock, puts the ingredients back. waste never restocks; with refund_money the customer is paid back, otherwise the sale stays as it is and only the loss (cost) is recorded. When money is returned for part of an order, the refunded quantity is split off as a cancelled line, the order totals are recomputed and the amount is taken back from each payment method (and balance, points, on-account) in proportion to what it paid; adjustments[].allocation shows the split. Refunding everything that is left moves the order to refunded. 409 with details.reason (already_refunded, already_cancelled, not_completed, nothing_left, item_not_found, quantity_exceeds, nothing_selected).
| 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 |
|---|---|---|
| type * | string | `refund`: the goods come back and the money is returned. `waste`: the goods are lost (spilled, spoiled); choose with refund_money whether the customer gets the money back. |
| reason * | string | — |
| lines | array | Optional. Omit to apply to the whole remaining order; otherwise {order_item_id, quantity} per line. Quantity cannot exceed what is left on the line. |
| refund_money | boolean | Waste only. A refund always returns the money. |
| restock | boolean | Refund only: put the ingredients back into stock. Waste never restocks. |
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/01m43skagzf2fyxddvx9pfd6es/adjustments' \
-H 'Authorization: Bearer flk_your_key:your_secret' \
-H 'Content-Type: application/json' \
-d '{
"type": "refund",
"reason": "Bir latte soğuk geldi",
"lines": [
{
"order_item_id": "01m43skah4dc0sn9gzbsn47xkg",
"quantity": 1
}
],
"restock": true
}'
HTTP 200 · application/json
{
"data": {
"id": "01m43skagzf2fyxddvx9pfd6es",
"order_number": "NIS-261004-0001",
"branch_id": "01m43skaeda12bjqjep39fcf12",
"channel": "kasa",
"service_type": "counter",
"table": null,
"status": "completed",
"display_number": "001",
"kitchen": {
"status": "new",
"preparing_at": null,
"ready_at": null,
"delivered_at": null
},
"customer_id": null,
"customer_name": null,
"payment_method_id": "01m43skag5crkqccdv8s6pec3k",
"totals": {
"total": 120,
"subtotal": 109.09,
"tax": 10.91,
"discount": 0,
"campaign_discount": 0,
"cost": 21.6,
"gross_profit": 87.49
},
"customer_payment": {
"paid_with_balance": 0,
"paid_with_points": 0,
"points_spent": 0,
"points_earned": 0
},
"items": [
{
"id": "01m43skah4dc0sn9gzbsn47xkg",
"product_id": "01m43skaey8gzy9pfes08mfqq2",
"campaign_id": null,
"quantity": 1,
"unit_price": 100,
"list_price": 100,
"campaign_discount": 0,
"total_price": 100,
"tax_rate": 10,
"tax_amount": 9.09,
"cancelled_at": null,
"cancel_reason": null,
"addons": []
},
{
"id": "01m43skah7t7yy7pkn0b2mz9r5",
"product_id": "01m43skaf1cqnpzhjkf1tbpvyk",
"campaign_id": null,
"quantity": 1,
"unit_price": 20,
"list_price": 20,
"campaign_discount": 0,
"total_price": 20,
"tax_rate": 10,
"tax_amount": 1.82,
"cancelled_at": null,
"cancel_reason": null,
"addons": []
},
{
"id": "01m43skajxgva82dr2013meg4j",
"product_id": "01m43skaey8gzy9pfes08mfqq2",
"campaign_id": null,
"quantity": 1,
"unit_price": 100,
"list_price": 100,
"campaign_discount": 0,
"total_price": 100,
"tax_rate": 10,
"tax_amount": 9.09,
"cancelled_at": "2026-10-04T15:47:53+00:00",
"cancel_reason": "Bir latte soğuk geldi",
"addons": []
}
],
"payments": [
{
"payment_method_id": "01m43skag5crkqccdv8s6pec3k",
"name": "Nakit (test)",
"type": "cash",
"amount": 65.45,
"reference": null
},
{
"payment_method_id": "01m43skaf7hqw7h747bq0ztfsm",
"name": "Kredi kartı (test)",
"type": "credit_card",
"amount": 54.55,
"reference": null
}
],
"adjustments": [
{
"id": "01m43skajwv75e8bvzz06zmgy5",
"type": "refund",
"refunded": true,
"restocked": true,
"whole_order": false,
"amount": 100,
"cost": 21.6,
"reason": "Bir latte soğuk geldi",
"allocation": [
{
"name": "Nakit (test)",
"type": "cash",
"amount": 54.55,
"source": "payment",
"payment_method_id": "01m43skag5crkqccdv8s6pec3k"
},
{
"name": "Kredi kartı (test)",
"type": "credit_card",
"amount": 45.45,
"source": "payment",
"payment_method_id": "01m43skaf7hqw7h747bq0ztfsm"
}
],
"lines": [
{
"order_item_id": "01m43skah4dc0sn9gzbsn47xkg",
"product_id": "01m43skaey8gzy9pfes08mfqq2",
"quantity": 1,
"amount": 100,
"cost": 21.6
}
],
"created_at": "2026-10-04T15:47:53+00:00"
}
],
"note": "Kısmi iade: Bir latte soğuk geldi",
"ordered_at": "2026-10-04T15:47:53+00:00",
"paid_at": "2026-10-04T15:47:53+00:00",
"created_at": "2026-10-04T15:47:53+00:00",
"updated_at": "2026-10-04T15:47:53+00:00"
}
}