product.created · updated · deleted ✓ CanlıÜrün kataloğu değiştiğinde eklentinin webhookUrl'ine async imzalı POST edilir. Menü/stok senkronu yapan eklentilerin delta kaynağıdır: ilk yükleme products/list, sonrası bu event'ler.
| Event | Tetik | data |
|---|---|---|
| product.created | Yeni ürün eklendiğinde | Yeni ürün |
| product.updated | Ürün düzenlendiğinde | Ürünün güncel hâli |
| product.deleted | Ürün silindiğinde | Silinen ürünün son hâli |
Üçü de async webhook (fire-and-forget; yanıtın işlemi etkilemez). Şekil aynı, yalnız type farklı.
events: ["product.created", "product.updated", "product.deleted"] + events:subscribe.data boş ({}) gelir.POST {webhookUrl}
Content-Type: application/json
X-Restomenum-Signature: t=<unixSec>,v1=<HMAC_SHA256(webhookSecret, "<t>.<rawBody>")>
X-Restomenum-Event: product.created | product.updated | product.deleted
X-Restomenum-Delivery: <deliveryId>"<t>.<rawBody>"), ±5 dk replay — bkz. imza şeması.X-Restomenum-Event: <type>, X-Restomenum-Delivery: <id>.id tekildir (at-least-once → dedup, 200 dön).2xx → işlendi. 5xx/timeout → retry → dead-letter.{
"id": "evt_<uuid>",
"type": "product.created",
"version": "1",
"tenantId": "<tenantId>",
"occurredAt": 1781000000000,
"data": {
"id": "3b5d-f6d0",
"title": "Menemen",
"category": "a0-62",
"price": 19,
"tax": 0,
"active": true,
"image": "https://d37x2wx7jj7xm7.cloudfront.net/server/SM9M.../products/.../original.jpeg",
"barcode": "",
"barcodeType": "Product",
"stock": 59,
"languages": { "US": { "title": "Menemen", "description": "" } },
"options": [
{
"id": 1780871104983, "title": "", "min": 0, "max": 99, "multiple": true,
"choices": [
{ "id": 1661781517624, "title": "Sade", "price": 0 },
{ "id": 1661781517374, "title": "Peynir", "price": 1 },
{ "id": 1661781517278, "title": "Kavurma", "price": 5 },
{ "id": 1661781517482, "title": "Sucuk", "price": 2 }
]
}
]
}
}product.updated aynı şekilde güncel ürünü; product.deleted silinen ürünün son hâlini taşır — yalnız type farklı.
| Alan | Tip | Zorunlu | Açıklama |
|---|---|---|---|
| id | string | ✓ | Ürün id'si (products/get?id= ile aynı). |
| title | string | ✓ | Ürün adı. |
| category | string | ✓ | Kategori id'si (categories/list'teki id). |
| price | number | ✓ | Birim fiyat (₺). |
| tax | number | ✓ | KDV/vergi oranı (%). |
| active | boolean | ✓ | Satışta mı. |
| image | string | null | – | Görsel CDN URL'i; yoksa null. |
| barcode / barcodeType | string | – | Barkod / tipi. |
| stock | number | ✓ | Stok adedi (negatif olabilir). |
| languages | object | – | Dil çevirileri (yoksa dönmeyebilir). |
| options[] | array | – | { id, title, min, max, multiple, choices[] }; choices[]: { id, title, price }. |
cost (maliyet) ve recete (reçete/BOM) ASLA dönmez — ticari sır.data yalnız products:read onaylıysa dolu; yoksa {}.