Süper GelsinPartner APIv1.0.0
API Referansı
TREN
Başlangıç
  • Hemen Başla
  • Test Ortamı (Sandbox)
  • Yetkilendirme
  • Servis Limitleri
  • Test hesabı başvurusu
Ortak uçlar
  • İşletme
  • Sipariş Yaşam Döngüsü
  • Sipariş Durumları
  • Mali Belge
  • Kurye Firması Entegrasyonu
  • Müşteri Talepleri
  • Değerlendirmeler
  • Webhook
Yemek
  • Menü ve Ürün Eşleme
Çarşı
  • Çarşı'ya genel bakış
  • Katalog
  • Toplama ve Dönüş
Referans
  • Sürümleme ve Hız Sınırı
  • Hata Kodları ve Sorun Giderme
  • Changelog
  • Sıkça Sorulan Sorular
  • API Referansı
Developer Portal/Çarşı (retail)

Picking and return

On a Çarşı order: substitution preference, the picking result and its closing, the picking gate, customer data and the return of an undeliverable order.

Reading orders, writing status, cancellation and payment are shared by both verticals and are on the Order lifecycle page. The two endpoints on this page exist only for Çarşı businesses (vertical: store); calling them with a restaurant key returns 404 not_available_for_vertical.

Endpoints on this page

Each row links to the full definition in the API reference — fields, response codes and the try-it console.

  • POST/orders/{id}/picking
  • POST/orders/{id}/return

Substitution preference (per item)

In retail the product is not always on the shelf. The customer states a preference at order time, item by item; it arrives on the order line as substitutionPreference:

AlanTipAçıklama
askenumAsk: find a substitute but get the customer's approval.
similarenumGive a similar product.
cancelenumDo not substitute.

This field decides what the picker may do; apply the same constraint in your own screen. If the substitute costs more, the difference is not charged to the customer; if it costs less, the difference is refunded.

Writing the picking result

Reporting item results
curl -X POST "https://api.supergelsin.com/api/partner/v1/orders/cm_ornek_siparis/picking" \
  -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 '{ "items": [
    { "clientReferenceId": "POS-1042", "status": "not_found" },
    { "clientReferenceId": "POS-1043", "status": "partial", "pickedQuantity": 2, "note": "Stokta 2 adet kaldı" },
    { "clientReferenceId": "POS-1044", "status": "substituted", "substituteClientReferenceId": "POS-2010", "customerApproved": true }
] }'
Response (200)
{ "orderId": "cm_ornek_siparis", "applied": 3, "failed": 0, "completed": false,
  "results": [ { "clientReferenceId": "POS-1042", "ok": true, "refundAmount": 42.5 } ],
  "adjustmentTotal": 42.5 }

Item results and closing are written in a single request. Items are processed in order; one rejected item does not affect the others, and the result of each item is in results[]. Refund amounts are computed server-side. When the first item result is written, a confirmed order becomes preparing. Picking is written only on a confirmed or preparing order.

Request fields
AlanTipAçıklama
items[]arrayAt most 200 items per request. Each item needs clientReferenceId (the items[].clientReferenceId of the order) and status (picked, partial, not_found, substituted).
pickedQuantitynumberThe quantity for partial; it must be between 1 and the ordered quantity.
pickedWeightnumberGrams for a weighed product; a whole number greater than zero. It is checked against the band frozen at order time: a value above the band is rejected; a genuine shortfall below it is reported as partial with a note.
substituteClientReferenceIdstringFor substituted, the clientReferenceId of the substitute product.
customerApprovedbooleanTrue if the customer approved the substitution. Approval is required on an item whose preference is ask.
notestringFree-text note; required on a partial weight.

Item-level rejection codes (order_not_pickable, picking_closed, invalid_weight, substitution_not_allowed, approval_required and others) are returned in results[].error; the full list is on the Error codes page.

Closing the picking

Closing with a receipt image and bag count
curl -X POST "https://api.supergelsin.com/api/partner/v1/orders/cm_ornek_siparis/picking" \
  -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 '{ "complete": true, "receiptUrl": "https://ornek-entegrator.example/fis/1044.jpg", "bagCount": 3 }'

complete: true closes the picking; a request that sends only items does not close it. At least one of items and complete: true is required. receiptUrl and bagCount are sent only with complete: true. After picking is closed, dispatch can be written with POST /orders/{id}/status.

Closing rules (409)
AlanTipAçıklama
picking_incomplete409On closing, every item must have a definite result; otherwise it is returned and the message gives the number of missing items. The same code is returned if dispatch is written before picking is closed, or if ready is written while picking is not closed.
nothing_found409If no product was found the picking cannot be completed; cancel the order with the reason out_of_stock and the customer is refunded in full.
exceeds_band409The picking result exceeds the order amount; the message gives the amounts.
  • If the closing is rejected, the earlier item results are not rolled back.
  • If complete is sent again to a completed order, 200 and completed: true are returned; refund, ledger and notification do not run again. If a completed order later becomes unpickable (for example cancelled), repeating complete returns 409 picking_incomplete.
  • The receipt image and bag count are written only if the closing succeeds. The receipt image is downloaded from an external https link and stored in the platform storage (an image, at most 8 MB). If a receipt is already recorded it is not rewritten and a receipt_already_saved warning is returned; on a repeated request that sends only bagCount, the bag count is not written either. If the receipt image cannot be copied, the closing does not stop and a receipt_not_saved warning is returned.
  • The picking shortfall is deducted from the amount to be collected at the door: adjustmentTotal is in the response and payment.dueAmount is updated in the order body. Read the order again after picking.

Customer data and test orders

On a Çarşı order the customer's phone number, latitude and longitude are never shared; customer.phone, latitude and longitude are always null. Two hours after the order is delivered or cancelled the customer information is narrowed: the name is shortened (Ayşe Y.), the address is reduced to District / Province and the customer's free-text note is removed from the note field. customer.redacted says the narrowing was done and visibleUntil says when full visibility ends. Narrowed fields are not an error; your integration must not fail on them. Do not store this data indefinitely on your side either (KVKK art. 4/2).

isTest: true shows that the order is a test order created with POST /orders/test. A test order does not reach the picking screen of the business (picking results can still be written through this API) and does not enter revenue, commission or settlement.

Return of an undeliverable order

If the courier cannot reach the customer or the address is wrong, an order on the way can only be cancelled with the code customer_unreachable or invalid_address. On Çarşı, for an online payment, the whole amount is then refunded to the customer (deliveryFailed.completedSale is always false). When the products are back in the store, the return is confirmed item by item.

Orders awaiting return
curl "https://api.supergelsin.com/api/partner/v1/orders?status=return_pending" \
  -H "Authorization: Basic $(printf '%s:%s' "$API_KEY" "$API_SECRET" | base64)" \
  -H "X-Integrator: Ornek POS" \
  -H "X-Operator: kasiyer_01"
Confirming the return
curl -X POST "https://api.supergelsin.com/api/partner/v1/orders/cm_ornek_siparis/return" \
  -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 '{ "lines": [{ "lineId": "cm_ornek_satir", "returnedQuantity": 1, "reason": "lost" }] }'

The pending lines are in the returnLines field of the GET /orders/{id} response (lineId, clientReferenceId, sku, barcode, name, quantity). Every line is sent exactly once. Returned quantities are added back to stock; for a quantity that did not return, reason (lost, damaged) is required and the reason is recorded on the order. Of two concurrent confirmations only one is applied. The response has the form { orderId, restockedLines }.

Errors
AlanTipAçıklama
not_cancelled409The order has not been cancelled.
not_failed_delivery409The order was not closed as undeliverable.
already_confirmed409The return of this order has already been confirmed.
invalid_lines400The return lines do not match the order.
not_found404The order was not found. The message (in Turkish): Sipariş bulunamadı.
PreviousCatalogueNextVersioning & rate limits
On this page
  • Substitution preference (per item)
  • Writing the picking result
  • Closing the picking
  • Customer data and test orders
  • Return of an undeliverable order