Ürün Kataloğu — GET /plugin-api/products/list ✓ Canlı

Mağazanın tüm ürün kataloğunu döndürür (menü senkronu için). Aktif VE pasif ürünlerin hepsi gelir; eklenti active alanına göre kendisi filtreler. Tek ürünü id ile çekmek için products/get.

← API Uçları · ortak kurallar (base, auth, hata zarfı) orada.

İstek

GET {RESTOMENUM_BASE}/plugin-api/products/list
Authorization: Bearer {serverId}.{pluginId}.{secret}     // install API key (token exchange)
  • Base: Sandbox https://sandbox.plugins.restomenum.app, Production https://plugins.restomenum.app (API Uçları).
  • Parametre yok — aktif + pasif tüm ürünler döner.
  • Auth: Authorization: Bearer <apiKey>token exchange'teki install API key (serverId.pluginId.secret).
  • Scope: products:read (yoksa plugin.scope.denied).

Yanıt

data ürün dizisidir; her öğe products/get ile aynı kanonik şekildir.

Gerçek örnek — opsiyonlu
// opsiyonlu ürün
{
  "id": "3b5d-f6d0",
  "title": "Menemen",
  "category": "a0-62",
  "price": 19,
  "tax": 0,
  "active": true,
  "image": "https://d37x2wx7jj7xm7.cloudfront.net/server/SM9M.../original.jpeg",
  "barcode": "",
  "barcodeType": "Product",
  "stock": 59,
  "options": [
    {
      "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 }
      ]
    }
  ]
}
Gerçek örnek — opsiyonsuz
// opsiyonsuz ürün (options:[], farklı host'taki görsel olduğu gibi kalır)
{
  "id": "3b5d-54fc",
  "title": "Kahvaltı Tabağı",
  "category": "a0-62",
  "price": 37.5,
  "tax": 0,
  "active": true,
  "image": "https://res.cloudinary.com/.../ezhdzw5n5y8rl8r8jbup.jpg",
  "options": []
}
Tam yanıt zarfı
{ "success": true, "data": [ /* yukarıdaki ürün objeleri */ ] }
Tip incelikleri: price sayı, ₺ (tam/ondalık) · tax KDV/vergi oranı (%) · image CDN URL'i veya null · stock negatif olabilir · options[].min/max bazı kayıtlarda string gelebilir (ikisine de hazır ol) · choices[].id number · languages obje (yoksa alan gelmeyebilir). Dayanıklı parse et.
Eski (legacy) kayıtlarda alan tümden düşebilir: bazı ürünlerde tax, barcode, barcodeType hiç gelmez; options[] objesi id/title/min/max taşımayabilir ve choices[].id olmayabilir (yalnız title+price). Bu alanları her zaman var sayma?. / varsayılan ile oku (ör. tax ?? 0, choice.id ?? choice.title).

Alanlar

AlanTipAçıklama
idstringÜrün id'si (products/get?id= ile aynı)
titlestringÜrün adı
categorystringKategori id'si (görünen ad değil)
pricenumberBirim fiyat (₺)
taxnumberKDV/vergi oranı (%)
activebooleanSatışta mı
imagestring | nullGörsel CDN URL'i; yoksa null
barcodestringBarkod (boş olabilir)
barcodeTypestringBarkod tipi
stocknumberStok adedi (negatif olabilir)
languagesobjectDil çevirileri (yoksa dönmeyebilir)
options[]array{ title, min, max, multiple, choices[]{id,title,price} }

Truncation (büyük katalog)

Güvenlik için yanıt en fazla 2000 ürün taşır. Aşılırsa truncated: true + total: N eklenir. truncated yoksa liste eksiksizdir. (Restoran ölçeğinde pratikte bu sınıra ulaşılmaz.)
{ "success": true, "data": [ /* 2000 ürün */ ], "truncated": true, "total": 2143 }

Dönmeyen alanlar (ticari sır)

cost (maliyet) ve recete (reçete / BOM) ASLA dönmez — restoranın ticari sırrıdır; eklenti erişemez.

Görsel: Restomenum S3 → CDN'e çevrilir; başka host'taki görseller (ör. cloudinary) olduğu gibi kalır. Öneri: katalog seyrek değişir → listeyi kendi tarafında cache'le, her event'te çağırma.

Hatalar

messageAnlam
plugin.scope.deniedproducts:read onaylı değil
unauthorized (HTTP 401)Geçersiz/eksik install key