API Uçları — Genel Bakış

Eklentinin Restomenum'dan veri okuduğu / işlem yaptığı HTTP uçları. Etkileşimler (event, action, iframe) yalnızca bir id taşır; dolu veriyi bu API'lerden çekersiniz. Liste zamanla genişler.

Ortak kurallar

GET {RESTOMENUM_BASE}/plugin-api/<kaynak>/<aksiyon>
Authorization: Bearer <apiKey>     // kurulumdaki (OAuth exchange) install API key

{RESTOMENUM_BASE} ortama göre değişir — geliştirmede sandbox, canlıda production:

OrtamBase URL
Dev / Sandboxhttps://sandbox.plugins.restomenum.app
Productionhttps://plugins.restomenum.app
  • Base: tüm uçlar {RESTOMENUM_BASE}/plugin-api/… altında (yukarıdaki tablo).
  • Auth: Authorization: Bearer <apiKey>token exchange'te alınan install API key.
  • Scope: her uç kendi scope'unu ister; eksikse plugin.scope.denied.
  • PII: customer alanları customers:read + consent ile dolu gelir; yoksa webhook ile aynı kuralla kırpılır.

Yanıt zarfı

// başarı
{ "success": true, "data": { … } }

// hata
{ "success": false, "message": "<kod>" }

Ortak hata kodları: plugin.scope.denied (gerekli scope yok), plugin.<kaynak>.notFound (kayıt yok). Uça özel kodlar ilgili sayfada listelenir.

Uçlar

MethodAçıklamaScope
GET/plugin-api/packets/getPaket detayı (dolu order: ürünler, müşteri, adres, toplam)orders:read
GET/plugin-api/packets/openAçık paket/delivery hesapları (özet): packetId, kanal, tutar, ürün adedi. Detay: packets/get?packetId=.orders:read
POST/plugin-api/packets/createYeni paket/sipariş oluştur (yazma ucu). Sepet ürün id'leriyle; fiyat Restomenum kaydından. idempotencyKey ile retry-güvenli. Ayrı write limit (20/dk).orders:write
POST/plugin-api/packets/updatePaketin sınırlı alanlarını güncelle (allowlist: status[label]/note/paymentNote/invoice*/customer.address|phone). Kapanış/iptal tetiklemez.orders:write
POST/plugin-api/packets/update-ordersPaket kalemlerini (cart) DEĞİŞTİR (full replace). total ürün kaydından yeniden hesaplanır. paid > yeni total → reddedilir (success:false).orders:write
POST/plugin-api/packets/update-paymentsPaket ödemelerini DEĞİŞTİR (full replace). paid yeniden hesaplanır (price>0). paid > total → reddedilir (success:false). update-orders ile eş zamanlı çağırma.orders:write
GET/plugin-api/tables/getMasa detayı (dolu order — packets/get ile aynı kanonik şekil). table.close gate target.id ile çekilir.orders:read
GET/plugin-api/tables/layoutMasa yerleşimi (floor plan): bölümler + masa adları. Ücret/grid alanları dönmez. Masa = bölüm+ad.orders:read
GET/plugin-api/tables/openAçık masa hesapları (özet): tableId, tutar (total/paid/indirim), ürün adedi. Detay: tables/get?id=.orders:read
POST/plugin-api/tables/update-ordersMasa kalemlerini DEĞİŞTİR (full replace). total kuver dahil yeniden hesap; timer ürün desteklenmez. (yakında)orders:write
POST/plugin-api/tables/update-paymentsMasa ödemelerini DEĞİŞTİR (full replace). Ödeme doğrulaması packets ile birebir (unknown_payment_method). (yakında)orders:write
GET/plugin-api/products/getÜrün detayı (id ile). fiyat, KDV, görsel, barkod, stok, seçenek/choice ağacı. cost/recete dönmez.products:read
GET/plugin-api/products/listTüm ürün kataloğu (aktif+pasif). Max 2000 (aşılırsa truncated+total). cost/recete dönmez.products:read
GET/plugin-api/categories/listTüm ürün kategorileri (aktif+pasif). id, title, image, color, rank. Ürün category ile eşleşir. Max 500.products:read
GET/plugin-api/categories/get?id=Tek kategori detayı (id ile). Şekil categories/list öğesiyle aynı. category.* event id'sini zenginleştir.products:read
GET/plugin-api/payment-methods/listTanımlı ödeme yöntemleri (Nakit/Kredi Kartı…): id, title, description, cash, noreport. users dönmez.payment_methods:read
GET/plugin-api/ingredients/listMalzeme/stok kataloğu (envanter): id, title, unit, stock, alert, tax. ort(maliyet)/stocks/storages dönmez.ingredients:read
GET/plugin-api/customers/get?customerId=Müşteri detayı (PII). Detay sayfası yakında eklenecek.customers:read
GET/plugin-api/users/getPersonel (kullanıcı) listesi [{ id, name }] — name yalnız PII consent ile. Max 200, cache'le. pincode/yetki/e-posta/mesai dönmez.users:read
POST/plugin-api/products/{create,update,delete}Ürün katalog yazma. Sahiplik: yalnız kendi oluşturduğunu düzenler/siler. category var olmalı; cost/stock/image yazılamaz.products:write
POST/plugin-api/categories/{create,update,delete}Kategori katalog yazma (products:write; ayrı scope yok). delete: kategori boş olmalı (categoryNotEmpty).products:write
POST/plugin-api/payment-methods/{create,update,delete}Ödeme yöntemi tanımı yazma. Sahiplik kontrollü. Personel ataması panelden (API'de yazılamaz).payment_methods:write
POST/plugin-api/ingredients/{create,update,delete}Malzeme/stok kartı yazma. Sahiplik kontrollü. stock/ort yazılamaz; yeni kart stok 0.ingredients:write
Bu liste büyür — yeni uçlar zamanla eklenir; her uç kendi detay sayfasıyla burada listelenir.