table.closed ✓ CanlıDine-in masa adisyonu kapatıldığında (ödeme alınıp adisyon kapanınca) eklentinin webhookUrl'ine async (fire-and-forget) imzalı POST edilir. Kapanış SONRASI bir bildirimdir.
table.closed (event) ≠ table.close (hook). Hook = kapatmadan ÖNCE senkron gate (allow/deny, akışı durdurabilir); event = kapandıktan SONRA async webhook (bildirim, durduramaz). Farklı uçlar, farklı amaç.events: ["table.closed"] + events:subscribe.customers:read + tenant consent (bu event'in temel data'sında müşteri yer almaz; PII genelde packet akışındadır).POST {webhookUrl}
Content-Type: application/json
X-Restomenum-Signature: t=<unixSec>,v1=<HMAC_SHA256(webhookSecret, "<t>.<rawBody>")>
X-Restomenum-Event: table.closed
X-Restomenum-Delivery: <deliveryId>"<t>.<rawBody>"), ±5 dk replay toleransı — bkz. imza şeması.X-Restomenum-Event: table.closed, X-Restomenum-Delivery: <id>.id ile dedup (at-least-once → aynı id tekrar gelebilir).2xx → tamam; 5xx/timeout → retry → tükenirse dead-letter.| Alan | Tip | Zorunlu | Açıklama |
|---|---|---|---|
| id | string | ✓ | Idempotency anahtarı (tableclosed_<serverId><saleId>). Aynı id tekrar gelebilir → dedup et. |
| type | string | ✓ | table.closed |
| version | number | ✓ | Envelope şema versiyonu (1). |
| tenantId | string | ✓ | Restoran (tenant) id. |
| occurredAt | number | ✓ | Kapanış zamanı (unix ms). |
| data | object | ✓ | Event'e özel gövde (aşağıda). |
| Alan | Tip | Zorunlu | Açıklama |
|---|---|---|---|
| tableId | string | ✓ | Masa id'si — tables/get?id= ile aynı. |
| tableName | string | ✓ | Masanın görünen adı (ör. "Masa 1"). |
| docNo | number | ✓ | Adisyon/belge no. |
| desing | string | – | Bölüm (salon/alan) adı (ör. "Bahçe") — tables/get'teki desing ile aynı. |
| location | string | – | Masanın görünen adı (ör. "Masa 1") — genelde tableName ile aynı. |
| personCount | number | – | Kişi sayısı (girilmemişse 0). |
| orders[] | array | ✓ | Adisyon satırları: id, title, quantity, options[], extra, discount, note, lineTotal. title = ürün adı; options = string array (seçenek adları); lineTotal'ı Restomenum hesaplar. |
| total | number | ✓ | Adisyon toplamı. |
| paid | number | ✓ | Ödenen tutar. |
| totalDiscount | number | – | Toplam indirim. |
| status | string | null | – | Masa kapanış durumu — masa satışlarında genelde null. |
| channel | string | ✓ | Kanonik kanal — masa kapanışında "TABLE". |
{
"id": "tableclosed_<serverId><saleId>",
"type": "table.closed",
"version": "1",
"tenantId": "<tenantId>",
"occurredAt": 1780884616000,
"data": {
"tableId": "e4356402-...",
"tableName": "Masa 1",
"docNo": 5,
"desing": "Bahçe",
"location": "Masa 1",
"personCount": 0,
"orders": [
{ "id": "masa-1-f308", "title": "Bellavista", "quantity": 1, "options": [], "extra": 0, "discount": 0, "note": "", "lineTotal": 13 },
{ "id": "masa-1-4724", "title": "dondurma", "quantity": 1, "options": ["çilek", "oreo"], "lineTotal": 4 }
],
"total": 17,
"paid": 17,
"totalDiscount": 0,
"status": null,
"channel": "TABLE"
}
}