Order lifecycle
Listing and reading orders, payment, status actions, cancellation and automatic cancellation.
Restaurants and Çarşı businesses use the same order endpoints. The body carries shared fields; the product lines differ by the vertical field: RestoranSiparisi for restaurant, DukkanSiparisi for store. The Çarşı-specific picking and return steps are on the Picking and return page.
Each row links to the full definition in the API reference — fields, response codes and the try-it console.
Status flow
pending→preparing→ready→on_the_way→delivered(cancelled from most states)pending→confirmed→preparing→on_the_way→delivered(cancelled from most states)The actions that write the status are the same on both verticals: accept, ready, dispatch, deliver, cancel. The target status depends on the vertical (see the Writing status table below). For status names and meanings, see Order statuses.
Listing and reading orders
curl "https://api.supergelsin.com/api/partner/v1/orders?updatedSince=2026-01-31T10:00:00Z&limit=50" \
-H "Authorization: Basic $(printf '%s:%s' "$API_KEY" "$API_SECRET" | base64)" \
-H "X-Integrator: Ornek POS" \
-H "X-Operator: kasiyer_01"GET /orders is a paged list and returns { items, nextCursor }. Ordering is by updatedAt ascending, then id ascending; the list starts at the oldest change and moves forward by cursor. If nextCursor is set, send it as cursor in the next request; null means the end of the stream. Orders with incomplete payment are never listed.
| Alan | Tip | Açıklama |
|---|---|---|
limit | integer | Page size, 1–50; default 50. |
status | string | Comma-separated list of statuses. Restaurant: pending, preparing, ready, on_the_way, delivered, cancelled; Çarşı: pending, confirmed, preparing, on_the_way, delivered, cancelled and return_pending. An unknown value returns 400 invalid_query; allowed lists the permitted values. |
updatedSince | ISO 8601 | Time zone required (2026-01-31T10:00:00Z). Returns orders changed at or after this moment (the boundary is included). A value without seconds or without a time zone returns 400 invalid_query. |
cursor | string | The nextCursor from the previous response. A corrupted value restarts the stream from the beginning. |
- Default: when neither
statusnorupdatedSinceis given, only active orders are returned (restaurant:pending,preparing,ready,on_the_way; Çarşı:pending,confirmed,preparing,on_the_way). - When
updatedSinceis given, all statuses come back, including delivery and cancellation changes; this is how the point of sale reconciles its own records. - On the next pull, pass a value a few seconds earlier than the last
updatedAtyou saw and remove duplicates by theidandupdatedAtpair: the change time is written before the operation completes, so a newly changed order may not show up with a very close timestamp. - On Çarşı,
status=return_pendingreturns orders cancelled as undeliverable whose return is awaiting confirmation;returnLinesis filled on these orders.
GET /orders/{id} returns the full body of a single order. An order with incomplete payment and an order of another business receive the same 404 not_found. The webhook body (the order field) is the same object; webhooks provide low latency, and these endpoints are the source of truth (Webhooks).
Order body
| Alan | Tip | Açıklama |
|---|---|---|
id · ref | string | ref is the visible order number: the last 8 characters of id, in capitals. It matches the number on the panel, the ticket and the notifications. |
merchantId · vertical | string | Business identifier and vertical (restaurant or store). |
isTest | boolean | If true, this is a test order created with POST /orders/test; it does not reach the kitchen or picking screen of the business (picking results can still be written through this API). |
createdAt · updatedAt · scheduledAt | ISO 8601 | updatedAt is the last change moment, for updatedSince and sync. scheduledAt is set on a future-dated (scheduled) order, otherwise null. |
note | string | null | Customer note. Removed when the customer window ends. |
subtotal · deliveryFee · total | number | Amounts. |
payment | object | Collection information (see Payment below). |
cancelReason · deliveryFailed | object | null | The cancellation reason on a cancelled order; deliveryFailed (reasonCode, completedSale, at) on an order closed as undeliverable. |
invoice · courier · customer | object | Invoice link (Invoice), external courier details (Courier) and customer details. |
Customer information is narrowed 2 hours after closing (the name is shortened, the phone and coordinates are removed, the address is reduced to District / Province, the note is removed); the order summary (items, amounts, payment, invoice) is not affected by this narrowing.
| Alan | Tip | Açıklama |
|---|---|---|
type | enum | Delivery type: delivery, pickup. |
items[] | array | id (the menu item identifier), name, quantity, unitPrice, options and selectedOptions (groupName, choiceId, choiceName, price, optionType; unresolved: true if no match is found in the menu). |
charges | object | serviceFee, tip, discount, couponCode. |
deliveryProvider | string | Who delivers: self or an external courier company code (prefixed 3pl:). |
prep | object | minutes, estimated, readyAt. The order arrives before acceptance: estimated: true means the time is an estimate; on acceptance the time is fixed and readyAt is filled. |
preferences | object | doNotKnock, dropOffAtDoor, noCutlery. |
| Alan | Tip | Açıklama |
|---|---|---|
items[] | array | clientReferenceId, sku, barcode, name, quantity, unitPrice, total, substitutionPreference (ask, similar, cancel) and pick (status, pickedQuantity, substituteName, refundAmount). |
taxTotal | number | VAT total. |
picking | object | Picking summary: total, counts, unresolved, completed. The dispatch action requires completed: true. |
returnLines | array | null | Set only on an order awaiting return confirmation (cancelled as undeliverable); null otherwise. The lines are the input of POST /orders/{id}/return. |
Mapping lines to your products
Map lines by identifier, never by name. On a restaurant, items[].id is the item id from the GET /menu response; for options, selectedOptions[].choiceId is the modifierGroups[].choices[].id in the menu (Menu and item mapping). On a Çarşı business, the mapping key is clientReferenceId; match the product with the identifier you sent (Catalogue).
Payment: the amount due at the door
Collection information is inside the order and is the same on both verticals. channel and dueAmount tell the cashier whether to collect money at the door.
"payment": {
"channel": "door", // door = collected at the door · online = paid through the platform
"instrument": "bank_card", // cash | bank_card | meal_card
"method": "pos_merchant",
"dueAmount": 250 // amount to collect at the door
}dueAmount is the amount to be collected at the door. It is 0 when channel is online or when the order is cancelled (including undeliverable). For payment at the door it is the order total; on Çarşı it can decrease after picking ends, when the picking shortfall is deducted. The amount read before picking closes is not final; read the order again after picking ends.
| Alan | Tip | Açıklama |
|---|---|---|
cash | door · cash | Cash, at the door |
card | online · bank_card | Bank and credit card, online |
pos_merchant | door · bank_card | Bank and credit card, at the door |
meal_card_door_multinet | door · meal_card | Meal card (multinet), at the door |
meal_card_online_multinet | online · meal_card | Meal card (multinet), online. Not enabled: it does not appear on any order. |
meal_card_door_pluxee | door · meal_card | Meal card (pluxee), at the door |
meal_card_online_pluxee | online · meal_card | Meal card (pluxee), online. Not enabled: it does not appear on any order. |
meal_card_door_edenred | door · meal_card | Meal card (edenred), at the door |
meal_card_online_edenred | online · meal_card | Meal card (edenred), online. Not enabled: it does not appear on any order. |
meal_card_door_setcard | door · meal_card | Meal card (setcard), at the door |
meal_card_online_setcard | online · meal_card | Meal card (setcard), online. Not enabled: it does not appear on any order. |
meal_card_door_metropol | door · meal_card | Meal card (metropol), at the door |
meal_card_online_metropol | online · meal_card | Meal card (metropol), online. Not enabled: it does not appear on any order. |
meal_card_door_tokenflex | door · meal_card | Meal card (tokenflex), at the door |
meal_card_online_tokenflex | online · meal_card | Meal card (tokenflex), online. Not enabled: it does not appear on any order. |
meal_card_door_iwallet | door · meal_card | Meal card (iwallet), at the door |
meal_card_online_iwallet | online · meal_card | Meal card (iwallet), online. Not enabled: it does not appear on any order. |
instrument is meal_card for meal-card methods. The online meal-card methods (meal_card_online_*) are not enabled at the moment. The set is closed for this version; if you meet a code you do not recognise, look at the channel and instrument fields instead of ignoring it.
Writing status
curl -X POST "https://api.supergelsin.com/api/partner/v1/orders/cm_ornek_siparis/status" \
-H "Authorization: Basic $(printf '%s:%s' "$API_KEY" "$API_SECRET" | base64)" \
-H "X-Integrator: Ornek POS" \
-H "X-Operator: kasiyer_01" \
-H "Content-Type: application/json" \
-d '{ "action": "accept", "prepMinutes": 25 }'| Alan | Tip | Açıklama |
|---|---|---|
accept | preparing | confirmed | On a restaurant, preparing; on Çarşı, turns a pending order into confirmed. If the Çarşı order is already confirmed the result is the same and prepMinutes is ignored. |
ready | ready | On a restaurant, ready. On Çarşı the status does not change: 200 if picking is closed, otherwise 409 picking_incomplete. |
dispatch | on_the_way | On Çarşı it cannot be written before picking is closed; close picking first with POST /orders/{id}/picking. |
deliver | delivered | Delivered. |
cancel | cancelled | reasonCode is required; reason is an optional free-text explanation (cut to 200 characters). |
| Alan | Tip | Açıklama |
|---|---|---|
actionzorunlu | enum | accept, ready, dispatch, deliver, cancel. Any other value returns 400 invalid_action. |
prepMinutes | integer | Restaurants only, with accept. Preparation time, 1–180 minutes; otherwise 400 invalid_prep_minutes. Ignored on Çarşı. |
reasonCode | enum | Required for cancel; missing returns 400 reason_required, invalid returns 400 invalid_reason. Valid codes are in the GET /cancel-reasons response. |
occurredAt | ISO 8601 | The moment the transition actually happened; used when the point-of-sale connection dropped or the notification was queued. Applied on restaurants only; on Çarşı it is not applied and the transition is written at the moment the request arrives. It cannot be in the future (more than 5 minutes), before the order was opened or before the previous stage, and can go back at most 24 hours; otherwise 400 invalid_occurred_at is returned and reason gives the cause. |
If the target status is already in effect the result does not change and the response is 200; the same request can be repeated. The response is the current order body. An invalid transition returns 409 invalid_transition; current gives the order status and allowed the actions possible from that status.
GET /orders/{id}.Cancellation and reasons
GET /cancel-reasons returns all cancellation reasons for the business's vertical: who they are attributed to (attributedTo), their effect on performance (affectsPerformance), whether they are selectable (selectable) and in which order statuses they can be chosen (allowedFrom). Only codes with selectable: true are used with the cancel action. The list is not paged.
- Undeliverable reasons (
customer_unreachable,invalid_address) are accepted only while the order ison_the_way; an order on the way cannot be cancelled with another reason. - Cancelling an order paid online refunds the payment to the customer. How the sale closed after an undeliverable outcome is in
deliveryFailed.completedSale: on a restaurant,truemeans the sale is complete, and even thoughstatusiscancelledit is not cancelled at the till; it is closed as a sale paid online. On Çarşı it is alwaysfalse; for an online payment the whole amount is refunded to the customer. - On Çarşı, the return of an order cancelled as undeliverable is confirmed with
POST /orders/{id}/return(Picking and return).
Automatic cancellation of an unaccepted order
A pending order that is not accepted is cancelled automatically with the reason acceptance_timeout 12 minutes after it reaches the business; this applies on both verticals and is recorded in the business's performance. The period runs from the moment the order reaches the business; for online payment, that is the moment the payment is confirmed. accept must be written before this period ends.
On Çarşı, a future-dated (scheduled) order is not cancelled automatically. On a restaurant, a scheduled order must also be accepted within this period. Test orders (isTest: true) are outside automatic cancellation.