packet.created ✓ CanlıRestomenum'da yeni bir paket sipariş oluşunca eklentinin webhookUrl'ine imzalı POST edilir. Bu, paket/kurye eklentilerinin temel event'idir. Aşağıdaki şema canlı (authoritative) payload'ı tanımlar.
POST {webhookUrl}
Content-Type: application/json
X-Restomenum-Signature: t=<unixSec>,v1=<HMAC_SHA256(webhookSecret, "<t>.<rawBody>")>"<t>.<rawBody>"), ±5 dk replay toleransı. webhookSecret kurulumda (OAuth exchange) verilir — bkz. imza şeması ve token exchange.id tekrar gelebilir (retry) → idempotency için id'yi dedup et.| Alan | Tip | Zorunlu | Açıklama |
|---|---|---|---|
| id | string | ✓ | Idempotency anahtarı. Aynı id tekrar gelebilir → dedup et. |
| type | string | ✓ | packet.created |
| version | string | ✓ | Envelope şema versiyonu ("1"). |
| tenantId | string | ✓ | Restoran (tenant) id. |
| occurredAt | number | ✓ | Oluşma zamanı (unix ms). |
| data | object | ✓ | Event'e özel gövde (aşağıda). |
| Alan | Tip | Zorunlu | Açıklama |
|---|---|---|---|
| packetId | string | ✓ | Paket id (statü callback'lerinde kullanılır). |
| docNo | number | ✓ | Günlük sipariş no. |
| orderCode | string | – | Sipariş kodu (örn. "A12"). |
| total | number | ✓ | Paket toplamı. |
| paid | number | ✓ | Ödenen tutar. |
| totalDiscount | number | – | İndirim toplamı (türetilmiş). |
| paymentNote | string | – | Ödeme notu (örn. "Kapıda nakit"). |
| isScheduled | boolean | ✓ | İleri tarihli sipariş mi? |
| scheduledDate | number | null | – | İleri tarihliyse zaman, değilse null. |
| note | string | – | Müşteri/sipariş notu. |
| entegrasyon | string | – | Sipariş kanalı — string kod: packet (manuel/telefon), yemeksepeti, getir, trendyol … |
| orders[] | array | ✓ | Sipariş satırları (id, title, quantity, options[], extra, discount, note, lineTotal, product). title = ürün adı, kökten direkt oku; options = string array (seçenek adları); product tam ürün objesi de gelir. lineTotal'ı Restomenum hesaplar. |
| customer | object | – | ⚠️ PII alanları yalnız customers:read + consent ile DOLU gelir (aşağı bkz). |
| callbackUrls | object | – | ⚠️ Yalnız packets:status ile EKLENİR (aşağı bkz). |
{
"id": "evt_9f2a7c1b",
"type": "packet.created",
"version": "1",
"tenantId": "tnt_123",
"occurredAt": 1730000000000,
"data": {
"packetId": "1780633662954",
"docNo": 42,
"orderCode": "A12",
"total": 145,
"paid": 0,
"totalDiscount": 0,
"paymentNote": "Kapıda nakit",
"isScheduled": false,
"scheduledDate": null,
"note": "Zili çalma",
"entegrasyon": "packet",
"orders": [
{
"id": "ord_1",
"title": "Lahmacun",
"quantity": 2,
"options": [
"Acılı",
"Bol soğan"
],
"extra": 0,
"discount": 0,
"note": "",
"lineTotal": 60,
"product": {
"title": "Lahmacun"
}
}
],
"customer": {
"id": "cust_9",
"name": "Ahmet Yılmaz",
"phone": "05xxxxxxxxx",
"address": "Atatürk Cad. No:5",
"addressDescription": "2. kat",
"region": "Kadıköy",
"call": "05xxxxxxxxx"
},
"callbackUrls": {
"pickup": "https://plugins.restomenum.app/plugin-api/packets/{tenantId}/{pluginId}/{packetId}/pickup?token=…",
"delivered": "https://plugins.restomenum.app/plugin-api/packets/{tenantId}/{pluginId}/{packetId}/delivered?token=…",
"cancel": "https://plugins.restomenum.app/plugin-api/packets/{tenantId}/{pluginId}/{packetId}/cancel?token=…"
}
}
}| Scope | Etki |
|---|---|
| events:subscribe + packet.created | Webhook'u almak için zorunlu (manifest events[] + scope). |
| customers:read yoksa | customer objesindeki PII alanları silinir (name, phone, address, email, tckn, vergino). id / region / call / addressDescription kalır. |
| packets:status yoksa | callbackUrls hiç eklenmez. |
customers:read eklemek kurulumda re-consent tetikler. Bkz. customers:read.Paket durumunu Restomenum'a bildirmek için callbackUrls'ten ilgili URL'e POST at (token query string'te). Bu URL'leri sen üretmezsin — platform üretip payload'a ekler, sen uygun anda çağırırsın (örn. aksiyon butonu / actionUrl çalışınca).
# Statü bildirimi — token query string'te, gövde boş/serbest
POST https://plugins.restomenum.app/plugin-api/packets/{tenantId}/{pluginId}/{packetId}/pickup?token=…
POST …/{packetId}/delivered?token=…
POST …/{packetId}/cancel?token=…
# pickup → yolda · delivered → teslim edildi · cancel → iptal (terminal — sonrası değişmez)pickup → yolda delivered → teslim edildi cancel → iptal (terminal durum sonrası değişmez)