packet.closed ✓ CanlıBir paket / delivery siparişi kapatıldığında (ödendi/teslim/finalize) eklentinin webhookUrl'ine async imzalı POST edilir. Manuel telefon paketleri VE entegrasyon teslimatları (Getir, Yemeksepeti, Trendyol, Migros, Fuudy, WebStore) kapandığında tetiklenir.
packet.closed ≠ packet.created. packet.created paket oluşturulduğunda; packet.closed paket kapandığında gelir — farklı yaşam-döngüsü anları. Dine-in masa kapanışı ise ayrı event: table.closed.events: ["packet.closed"] + events:subscribe.data boş ({}) gelir.customers:read + tenant consent — yoksa customer hiç gönderilmez.POST {webhookUrl}
Content-Type: application/json
X-Restomenum-Signature: t=<unixSec>,v1=<HMAC_SHA256(webhookSecret, "<t>.<rawBody>")>
X-Restomenum-Event: packet.closed
X-Restomenum-Delivery: <deliveryId>"<t>.<rawBody>"), ±5 dk replay — bkz. imza şeması.X-Restomenum-Event: packet.closed, X-Restomenum-Delivery: <id>.id tekildir (at-least-once → aynı id'yi dedup et, 200 dön).2xx → işlendi. 5xx/timeout → retry (backoff) → dead-letter. 4xx → kalıcı (retry yok).| Alan | Tip | Zorunlu | Açıklama |
|---|---|---|---|
| id | string | ✓ | Olay id'si — idempotency anahtarı (packetclosed_<serverId><packetId>). |
| type | string | ✓ | packet.closed |
| version | number | ✓ | Envelope şema sürümü (1). |
| tenantId | string | ✓ | Tenant kimliği. |
| occurredAt | number | ✓ | Kapanış zamanı (epoch ms). |
| data | object | ✓ | Paket kanonik verisi — orders:read yoksa {}. |
| Alan | Tip | Zorunlu | Açıklama |
|---|---|---|---|
| packetId | string | ✓ | Paket id'si (packets/get?packetId=). |
| docNo | number | ✓ | Adisyon/belge no. |
| channel | string | ✓ | Kanonik kanal — PACKET (manuel) / GETIR / YEMEKSEPETI / TRENDYOL / MIGROS / FUUDY / WEBSTORE. |
| entegrasyon | string | – | Entegrasyon anahtarı (küçük harf: packet/getir/deliveryhero/…). |
| status | string | null | – | Sipariş durumu — Delivered / Rejected / … İptal/red'i kendin filtrele (platform tüm kapanışları gönderir). |
| orderCode | string | – | Platform sipariş kodu (entegrasyon siparişlerinde; varsa). |
| isScheduled | boolean | – | İleri tarihli sipariş mi (varsa). |
| scheduledDate | number | – | Planlanan teslim zamanı (varsa). |
| note / paymentNote | string | – | Sipariş / ödeme notu. |
| total / paid / totalDiscount | number | ✓ | Tutarlar. |
| orders[] | array | ✓ | Adisyon satırları: id, title, quantity, options[], extra, discount, note, lineTotal. title = ürün adı (ham product objesi gönderilmez); options = string array. |
| customer | object | – | Müşteri + adres — PII; customers:read + consent yoksa gönderilmez. |
{
"id": "packetclosed_<serverId><packetId>",
"type": "packet.closed",
"version": "1",
"tenantId": "<tenantId>",
"occurredAt": 1780885101009,
"data": {
"packetId": "YJyvBuxjDA31kdc7E3KQ",
"docNo": 3,
"channel": "PACKET",
"entegrasyon": "packet",
"status": "Delivered",
"note": "Sipariş Notu",
"paymentNote": "nakit",
"total": 17,
"paid": 17,
"totalDiscount": 0,
"orders": [
{ "id": "1780875078783-32e1", "title": "Bellavista", "quantity": 1, "options": [], "extra": 0, "discount": 0, "note": "", "lineTotal": 13 },
{ "id": "1780875078783-4e12", "title": "dondurma", "quantity": 1, "options": ["çilek"], "extra": 0, "discount": 0, "note": "", "lineTotal": 4 }
],
"customer": {
"id": "123456", "name": "Ahmet Bayrak", "region": null,
"address": "Adres", "addressDescription": null,
"phone": "123456", "call": "123456", "latitude": null, "longitude": null
}
}
}Entegrasyon teslimatında channel "GETIR"/"YEMEKSEPETI"/"TRENDYOL"/… olur; entegrasyon siparişinde orderCode, planlıda isScheduled+scheduledDate dolu gelir (boşsa alan yer almaz).
status ile filtrele: platform tüm kapanışları gönderir (Rejected/iptal dahil). "Tamamlanmış satış" istiyorsan status'a göre kendin filtrele.product objesi gönderilmez (yalnız title + lineTotal);customer yalnız customers:read + consent ile; data yalnız orders:read onaylıysa dolu.