Ürün Detayı — GET /plugin-api/products/get ✓ Canlı

Bir ürünün tam detayını (fiyat, KDV, görsel, barkod, stok, çok dilli alanlar ve seçenek/choice ağacı) id ile çekersin. Menü/katalog senkronu yapan eklentilerin temel ucudur.

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

İstek

GET {RESTOMENUM_BASE}/plugin-api/products/get?id=<productId>
Authorization: Bearer {serverId}.{pluginId}.{secret}     // install API key (token exchange)
  • Base ({RESTOMENUM_BASE}): ortama göre — Sandbox https://sandbox.plugins.restomenum.app, Production https://plugins.restomenum.app (tüm liste: API Uçları).
  • Parametre: id — ürün id'si (zorunlu; yoksa plugin.products.missingParams).
  • Auth: Authorization: Bearer <apiKey>token exchange'te aldığın install API key (biçim: serverId.pluginId.secret).
  • Scope: products:read zorunlu (yoksa plugin.scope.denied).

Yanıt

Gerçek 200 örneği
{
  "success": true,
  "data": {
    "id": "djzPF5wjaNMZ81oeIc3v-1649969203832",
    "title": "Coleslaw Chicken Burger",
    "category": "demo-1",
    "price": 509.9,
    "tax": 0,
    "active": true,
    "image": "https://restomenum.s3.eu-central-1.amazonaws.com/server/.../original.jpeg",
    "barcode": "owDow",
    "barcodeType": "Product",
    "stock": -804,
    "languages": {},
    "options": [
      {
        "id": "CUMSaEfDbQcDiKBZVFPd",
        "title": "Patates Tercihi",
        "min": "1",
        "max": "1",
        "multiple": false,
        "choices": [
          { "id": 1675088821974, "title": "Sade", "price": 0 },
          { "id": 1675088821975, "title": "Baharatlı", "price": 5 }
        ]
      }
    ]
  }
}

options[] her biri bir seçenek grubudur (min/max/multiple ile seçim kuralı); choices[] o grubun şıklarıdır (price = ek ücret).

Tip incelikleri (gerçek örneklerden — dayanıklı parse et): price sayı, ₺ (tam veya ondalıklı; kuruş değil) · options[].min/max string veya number gelebilir (örneklerde ikisi de görüldü) · choices[].id number · stock negatif olabilir · options[].id ve languages bazı üründe bulunmayabilir (opsiyonel).

Dönmeyen alanlar (ticari sır)

cost (maliyet) ve recete (reçete / BOM) kasıtlı olarak DÖNMEZ. Bunlar restoranın ticari sırrıdır; eklenti bu alanlara erişemez. Yanıtta hiç yer almazlar.

Hatalar

DurumYanıt
Scope yok{ success:false, message:"plugin.scope.denied" }
id verilmedi{ success:false, message:"plugin.products.missingParams" }
Ürün bulunamadı{ success:false, message:"plugin.products.notFound" }
Geçersiz/eksik keyunauthorized (HTTP 401)