{"openapi":"3.1.0","info":{"title":"DLAB E-com Açık API","version":"1.0.0","description":"Mağaza verisine (ürün, stok, fiyat, sipariş, müşteri) programatik erişim. DLAB ve diğer entegratörler bu API ile bağlanır.\n\n**Kimlik:** `Authorization: Bearer dlk_live_<önek>_<sır>` — anahtar mağaza panelinde (Ayarlar → API ve Webhook) oluşturulur, yalnız bir kez gösterilir.\n\n**Kurallar:** stok her zaman MUTLAK değer gönderilir (delta değil); eşleşme SKU veya barkod ile (mağaza içinde benzersiz); API anahtarına bağlı webhook uçlarına o anahtarın kendi değişiklikleri geri gönderilmez (döngü önleme, `source` alanı).\n\n**Hız sınırı:** anahtar başına 120 istek/dakika; `X-RateLimit-Limit`, `X-RateLimit-Remaining`, `X-RateLimit-Reset`, aşımda `Retry-After`.\n\n**Webhook imzası:** `X-DLAB-Signature: t=<unix>,v1=<hex(HMAC-SHA256(sır, t + \".\" + gövde))>`."},"servers":[{"url":"http://localhost:4100","description":"Yerel geliştirme"}],"security":[{"apiKey":[]}],"tags":[{"name":"Anahtar"},{"name":"Ürünler"},{"name":"Stok & Fiyat"},{"name":"Siparişler"},{"name":"Katalog & Müşteri"},{"name":"Webhook"},{"name":"İşler"}],"paths":{"/v1/me":{"get":{"tags":["Anahtar"],"summary":"Anahtar ve mağaza bilgisi (bağlantı testi)","security":[{"apiKey":[]}],"responses":{"200":{"description":"Başarılı","content":{"application/json":{"schema":{"type":"object","properties":{"key":{"type":"object","properties":{"prefix":{"type":"string"},"scopes":{"type":"array","items":{"type":"string"}}}},"site":{"type":"object"},"fieldOwners":{"type":"object","description":"Alan bazında ana kaynak: panel | integration"},"writableFields":{"type":"array","items":{"type":"string"},"description":"Bu bağlantının YAZABİLECEĞİ alanlar"}}}}}},"401":{"description":"API anahtarı eksik, geçersiz veya iptal edilmiş","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Anahtarda gerekli yetki (scope) yok","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Hız sınırı aşıldı (120 istek/dk)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/products":{"get":{"tags":["Ürünler"],"summary":"Ürün listesi (imleçli, updatedAt artan)","x-scope":"products:read","security":[{"apiKey":[]}],"parameters":[{"name":"cursor","in":"query","schema":{"type":"string"},"description":"Önceki yanıttaki nextCursor"},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":100,"default":50}},{"name":"updatedAfter","in":"query","schema":{"type":"string","format":"date-time"},"description":"Bu andan SONRA değişen kayıtlar (artımlı senkron)"},{"name":"status","in":"query","schema":{"enum":["DRAFT","ACTIVE","ARCHIVED"]}},{"name":"sku","in":"query","schema":{"type":"string"}},{"name":"barcode","in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"Başarılı","content":{"application/json":{"schema":{"type":"object","required":["data","hasMore","nextCursor"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Product"}},"hasMore":{"type":"boolean"},"nextCursor":{"type":["string","null"]}}}}}},"400":{"description":"Geçersiz imleç / tarih","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"API anahtarı eksik, geçersiz veya iptal edilmiş","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Anahtarda gerekli yetki (scope) yok","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Hız sınırı aşıldı (120 istek/dk)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["Ürünler"],"summary":"Ürün oluştur","x-scope":"products:write","security":[{"apiKey":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","maxLength":200},"description":"Aynı anahtar + aynı gövde → aynı yanıt (24 saat). Farklı gövde → 422."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProductInput"}}}},"responses":{"201":{"description":"Başarılı","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Product"}}}},"400":{"description":"Doğrulama hatası","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"API anahtarı eksik, geçersiz veya iptal edilmiş","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Anahtarda gerekli yetki (scope) yok","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"SKU/barkod başka üründe kullanılıyor (ürün adıyla)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Idempotency-Key farklı gövdeyle","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Hız sınırı aşıldı (120 istek/dk)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/products/{id}":{"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"get":{"tags":["Ürünler"],"summary":"Ürün detayı","x-scope":"products:read","security":[{"apiKey":[]}],"responses":{"200":{"description":"Başarılı","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Product"}}}},"401":{"description":"API anahtarı eksik, geçersiz veya iptal edilmiş","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Anahtarda gerekli yetki (scope) yok","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Bulunamadı (başka mağazanın ürünü de 404)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Hız sınırı aşıldı (120 istek/dk)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"tags":["Ürünler"],"summary":"Ürün güncelle (varyant listesi gönderilirse TAM liste kabul edilir; SKU ile eşleşen varyantın kimliği korunur)","x-scope":"products:write","security":[{"apiKey":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","maxLength":200},"description":"Aynı anahtar + aynı gövde → aynı yanıt (24 saat). Farklı gövde → 422."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProductInputPartial"}}}},"responses":{"200":{"description":"Başarılı","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Product"}}}},"400":{"description":"Doğrulama","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"API anahtarı eksik, geçersiz veya iptal edilmiş","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Anahtarda gerekli yetki (scope) yok","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Bulunamadı","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"SKU/barkod çakışması","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Hız sınırı aşıldı (120 istek/dk)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"tags":["Ürünler"],"summary":"Ürün sil","x-scope":"products:write","security":[{"apiKey":[]}],"responses":{"200":{"description":"Başarılı","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"}}}}}},"401":{"description":"API anahtarı eksik, geçersiz veya iptal edilmiş","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Anahtarda gerekli yetki (scope) yok","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Bulunamadı","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Hız sınırı aşıldı (120 istek/dk)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/products/match":{"post":{"tags":["Ürünler"],"summary":"Eşleştirme önizlemesi (YAZMAZ) — hangi ürün eşleşir, hangisi yeni açılır","description":"İlk bağlantıda çağırın ve sonucu kullanıcıya gösterin. Hiçbir kayıt oluşturulmaz ya da güncellenmez.","x-scope":"products:read","security":[{"apiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["items"],"properties":{"items":{"type":"array","maxItems":500,"description":"En fazla 500 satır","items":{"type":"object","properties":{"sku":{"type":"string","description":"Stok kodu"},"barcode":{"type":"string","description":"Barkod"},"title":{"type":"string","description":"Karşılaştırma için sizdeki ad (isteğe bağlı)"}}}}}},"example":{"items":[{"sku":"TSH-001-M","title":"Basic Tişört M"},{"barcode":"8690000000017","title":"Kupa"}]}}}},"responses":{"200":{"description":"Eşleşme özeti","content":{"application/json":{"schema":{"type":"object","properties":{"matched":{"type":"integer","description":"Eşleşen satır sayısı"},"toCreate":{"type":"integer","description":"Yeni açılacak satır sayısı"},"items":{"type":"array","items":{"type":"object","properties":{"sku":{"type":"string","nullable":true},"barcode":{"type":"string","nullable":true},"action":{"type":"string","enum":["update","create"]},"matchedBy":{"type":"string","nullable":true},"productId":{"type":"string","nullable":true},"variantId":{"type":"string","nullable":true},"currentTitle":{"type":"string","nullable":true},"incomingTitle":{"type":"string","nullable":true}}}}}}}}},"401":{"description":"API anahtarı eksik, geçersiz veya iptal edilmiş","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Anahtarda gerekli yetki (scope) yok","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/products/batch":{"post":{"tags":["Ürünler","İşler"],"summary":"Toplu ürün upsert (≤500, SKU ile eşleşir) — arka plan işi","x-scope":"products:write","security":[{"apiKey":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","maxLength":200},"description":"Aynı anahtar + aynı gövde → aynı yanıt (24 saat). Farklı gövde → 422."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["items"],"properties":{"items":{"type":"array","maxItems":500,"items":{"$ref":"#/components/schemas/ProductInput"}}}},"example":{"items":[{"title":"Basic Tişört","variants":[{"sku":"TSH-001-M","price":349.9,"stock":12}]}]}}}},"responses":{"202":{"description":"İş kuyruğa alındı","content":{"application/json":{"schema":{"type":"object","properties":{"jobId":{"type":"string","format":"uuid"},"status":{"type":"string"},"total":{"type":"integer"},"statusUrl":{"type":"string"}}}}}},"401":{"description":"API anahtarı eksik, geçersiz veya iptal edilmiş","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Anahtarda gerekli yetki (scope) yok","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Hız sınırı aşıldı (120 istek/dk)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/jobs/{id}":{"get":{"tags":["İşler"],"summary":"İş durumu ve satır satır sonuç","security":[{"apiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Başarılı","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Job"}}}},"401":{"description":"API anahtarı eksik, geçersiz veya iptal edilmiş","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Anahtarda gerekli yetki (scope) yok","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Bulunamadı","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Hız sınırı aşıldı (120 istek/dk)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/stock":{"put":{"tags":["Stok & Fiyat"],"summary":"Toplu MUTLAK stok (≤500, SKU veya barkod ile). Aynı değer değişiklik sayılmaz.","x-scope":"stock:write","security":[{"apiKey":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","maxLength":200},"description":"Aynı anahtar + aynı gövde → aynı yanıt (24 saat). Farklı gövde → 422."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["items"],"properties":{"items":{"type":"array","maxItems":500,"items":{"type":"object","required":["stock"],"properties":{"sku":{"type":"string","description":"Stok kodu — barkod verilmezse zorunlu"},"barcode":{"type":"string","description":"Barkod — SKU verilmezse kullanılır"},"stock":{"type":"integer","description":"MUTLAK stok adedi (\"stok = 42\"), fark değil"}}},"description":"En fazla 500 satır. Her satır SKU ya da barkodla eşleşir."}}},"example":{"items":[{"sku":"TSH-001-M","stock":42},{"barcode":"8690000000017","stock":0}]}}}},"responses":{"200":{"description":"Başarılı","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BatchResult"}}}},"401":{"description":"API anahtarı eksik, geçersiz veya iptal edilmiş","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Anahtarda yetki yok VEYA bu alan panelde yönetiliyor (alan sahipliği)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Hız sınırı aşıldı (120 istek/dk)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/prices":{"put":{"tags":["Stok & Fiyat"],"summary":"Toplu fiyat (≤500, SKU ile). compareAtPrice > price olmalı; null ile kaldırılır.","x-scope":"prices:write","security":[{"apiKey":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","maxLength":200},"description":"Aynı anahtar + aynı gövde → aynı yanıt (24 saat). Farklı gövde → 422."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["items"],"properties":{"items":{"type":"array","maxItems":500,"items":{"type":"object","required":["sku"],"properties":{"sku":{"type":"string","description":"Stok kodu"},"price":{"type":"number","description":"Satış fiyatı"},"compareAtPrice":{"type":["number","null"],"description":"Üstü çizili liste fiyatı — satış fiyatından büyük olmalı; null kaldırır"}}},"description":"En fazla 500 satır."}}},"example":{"items":[{"sku":"TSH-001-M","price":349.9,"compareAtPrice":499.9}]}}}},"responses":{"200":{"description":"Başarılı","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BatchResult"}}}},"401":{"description":"API anahtarı eksik, geçersiz veya iptal edilmiş","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Anahtarda yetki yok VEYA bu alan panelde yönetiliyor (alan sahipliği)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Hız sınırı aşıldı (120 istek/dk)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/orders":{"get":{"tags":["Siparişler"],"summary":"Sipariş listesi (imleçli, updatedAt artan)","x-scope":"orders:read","security":[{"apiKey":[]}],"parameters":[{"name":"cursor","in":"query","schema":{"type":"string"},"description":"Önceki yanıttaki nextCursor"},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":100,"default":50}},{"name":"updatedAfter","in":"query","schema":{"type":"string","format":"date-time"},"description":"Bu andan SONRA değişen kayıtlar (artımlı senkron)"},{"name":"status","in":"query","schema":{"type":"string"},"description":"Virgülle ayrılmış: PENDING_PAYMENT, AWAITING_APPROVAL, PROCESSING, SHIPPED, DELIVERED, CANCELLED, RETURNED"}],"responses":{"200":{"description":"Başarılı","content":{"application/json":{"schema":{"type":"object","required":["data","hasMore","nextCursor"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Order"}},"hasMore":{"type":"boolean"},"nextCursor":{"type":["string","null"]}}}}}},"401":{"description":"API anahtarı eksik, geçersiz veya iptal edilmiş","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Anahtarda gerekli yetki (scope) yok","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Hız sınırı aşıldı (120 istek/dk)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/orders/{id}":{"get":{"tags":["Siparişler"],"summary":"Sipariş detayı","x-scope":"orders:read","security":[{"apiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Başarılı","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Order"}}}},"401":{"description":"API anahtarı eksik, geçersiz veya iptal edilmiş","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Anahtarda gerekli yetki (scope) yok","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Bulunamadı","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Hız sınırı aşıldı (120 istek/dk)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/orders/{id}/status":{"post":{"tags":["Siparişler"],"summary":"Durum geçişi (durum makinesi kurallarıyla). SHIPPED’da kargo firması + takip no.","x-scope":"orders:write","security":[{"apiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","maxLength":200},"description":"Aynı anahtar + aynı gövde → aynı yanıt (24 saat). Farklı gövde → 422."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["status"],"properties":{"status":{"enum":["PROCESSING","SHIPPED","DELIVERED","CANCELLED"],"description":"Hedef durum — panelle aynı durum makinesi geçerlidir"},"carrier":{"type":"string","description":"Kargo firması kodu (SHIPPED için)"},"trackingNumber":{"type":"string","description":"Takip numarası (SHIPPED için)"},"note":{"type":"string","description":"Sipariş geçmişine düşecek not"}}},"example":{"status":"SHIPPED","carrier":"yurtici","trackingNumber":"1234567890","note":"Kargoya verildi"}}}},"responses":{"200":{"description":"Başarılı","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Order"}}}},"400":{"description":"Bu durumdan bu duruma geçilemez","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"API anahtarı eksik, geçersiz veya iptal edilmiş","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Anahtarda gerekli yetki (scope) yok","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Bulunamadı","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Hız sınırı aşıldı (120 istek/dk)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/categories":{"get":{"tags":["Katalog & Müşteri"],"summary":"Kategoriler (düz liste + yol)","x-scope":"categories:read","security":[{"apiKey":[]}],"responses":{"200":{"description":"Başarılı","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Category"}}}}}}},"401":{"description":"API anahtarı eksik, geçersiz veya iptal edilmiş","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Anahtarda gerekli yetki (scope) yok","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Hız sınırı aşıldı (120 istek/dk)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/customers":{"get":{"tags":["Katalog & Müşteri"],"summary":"Müşteriler (imleçli)","x-scope":"customers:read","security":[{"apiKey":[]}],"parameters":[{"name":"cursor","in":"query","schema":{"type":"string"},"description":"Önceki yanıttaki nextCursor"},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":100,"default":50}},{"name":"updatedAfter","in":"query","schema":{"type":"string","format":"date-time"},"description":"Bu andan SONRA değişen kayıtlar (artımlı senkron)"}],"responses":{"200":{"description":"Başarılı","content":{"application/json":{"schema":{"type":"object","required":["data","hasMore","nextCursor"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Customer"}},"hasMore":{"type":"boolean"},"nextCursor":{"type":["string","null"]}}}}}},"401":{"description":"API anahtarı eksik, geçersiz veya iptal edilmiş","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Anahtarda gerekli yetki (scope) yok","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Hız sınırı aşıldı (120 istek/dk)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/webhooks":{"get":{"tags":["Webhook"],"summary":"Bu anahtara bağlı webhook uçları","security":[{"apiKey":[]}],"responses":{"200":{"description":"Başarılı","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/WebhookEndpoint"}}}}}}},"401":{"description":"API anahtarı eksik, geçersiz veya iptal edilmiş","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Anahtarda gerekli yetki (scope) yok","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Hız sınırı aşıldı (120 istek/dk)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["Webhook"],"summary":"Webhook ucu oluştur (anahtara bağlanır → kendi değişiklikleriniz size geri gönderilmez). Sır YALNIZ bu yanıtta döner.","security":[{"apiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["url","events"],"properties":{"url":{"type":"string","format":"uri"},"events":{"type":"array","items":{"$ref":"#/components/schemas/WebhookEvent"}},"description":{"type":"string"}}},"example":{"url":"https://ornek.com/dlab/webhook","events":["order.created","stock.changed"],"description":"ERP köprüsü"}}}},"responses":{"201":{"description":"Başarılı","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/WebhookEndpoint"},{"type":"object","properties":{"secret":{"type":"string"}}}]}}}},"401":{"description":"API anahtarı eksik, geçersiz veya iptal edilmiş","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Anahtarda gerekli yetki (scope) yok","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Hız sınırı aşıldı (120 istek/dk)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/webhooks/{id}":{"delete":{"tags":["Webhook"],"summary":"Webhook ucunu sil","security":[{"apiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Başarılı","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"description":"API anahtarı eksik, geçersiz veya iptal edilmiş","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Anahtarda gerekli yetki (scope) yok","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Bulunamadı","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Hız sınırı aşıldı (120 istek/dk)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/openapi.json":{"get":{"tags":["Anahtar"],"summary":"Bu doküman","security":[],"responses":{"200":{"description":"OpenAPI 3.1"}}}}},"webhooks":{"order.created":{"post":{"summary":"order.created","parameters":[{"name":"X-DLAB-Signature","in":"header","required":true,"schema":{"type":"string"}},{"name":"X-DLAB-Event","in":"header","schema":{"type":"string"}},{"name":"X-DLAB-Delivery","in":"header","schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookPayload"}}}},"responses":{"200":{"description":"2xx dışı yanıt veya 10 sn zaman aşımı = başarısız; 1dk, 5dk, 30dk, 2sa, 6sa sonra yeniden denenir; art arda 10 başarısızlıkta uç kapatılır"}}}},"order.paid":{"post":{"summary":"order.paid","parameters":[{"name":"X-DLAB-Signature","in":"header","required":true,"schema":{"type":"string"}},{"name":"X-DLAB-Event","in":"header","schema":{"type":"string"}},{"name":"X-DLAB-Delivery","in":"header","schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookPayload"}}}},"responses":{"200":{"description":"2xx dışı yanıt veya 10 sn zaman aşımı = başarısız; 1dk, 5dk, 30dk, 2sa, 6sa sonra yeniden denenir; art arda 10 başarısızlıkta uç kapatılır"}}}},"order.status_changed":{"post":{"summary":"order.status_changed","parameters":[{"name":"X-DLAB-Signature","in":"header","required":true,"schema":{"type":"string"}},{"name":"X-DLAB-Event","in":"header","schema":{"type":"string"}},{"name":"X-DLAB-Delivery","in":"header","schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookPayload"}}}},"responses":{"200":{"description":"2xx dışı yanıt veya 10 sn zaman aşımı = başarısız; 1dk, 5dk, 30dk, 2sa, 6sa sonra yeniden denenir; art arda 10 başarısızlıkta uç kapatılır"}}}},"order.cancelled":{"post":{"summary":"order.cancelled","parameters":[{"name":"X-DLAB-Signature","in":"header","required":true,"schema":{"type":"string"}},{"name":"X-DLAB-Event","in":"header","schema":{"type":"string"}},{"name":"X-DLAB-Delivery","in":"header","schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookPayload"}}}},"responses":{"200":{"description":"2xx dışı yanıt veya 10 sn zaman aşımı = başarısız; 1dk, 5dk, 30dk, 2sa, 6sa sonra yeniden denenir; art arda 10 başarısızlıkta uç kapatılır"}}}},"product.created":{"post":{"summary":"product.created","parameters":[{"name":"X-DLAB-Signature","in":"header","required":true,"schema":{"type":"string"}},{"name":"X-DLAB-Event","in":"header","schema":{"type":"string"}},{"name":"X-DLAB-Delivery","in":"header","schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookPayload"}}}},"responses":{"200":{"description":"2xx dışı yanıt veya 10 sn zaman aşımı = başarısız; 1dk, 5dk, 30dk, 2sa, 6sa sonra yeniden denenir; art arda 10 başarısızlıkta uç kapatılır"}}}},"product.updated":{"post":{"summary":"product.updated","parameters":[{"name":"X-DLAB-Signature","in":"header","required":true,"schema":{"type":"string"}},{"name":"X-DLAB-Event","in":"header","schema":{"type":"string"}},{"name":"X-DLAB-Delivery","in":"header","schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookPayload"}}}},"responses":{"200":{"description":"2xx dışı yanıt veya 10 sn zaman aşımı = başarısız; 1dk, 5dk, 30dk, 2sa, 6sa sonra yeniden denenir; art arda 10 başarısızlıkta uç kapatılır"}}}},"product.deleted":{"post":{"summary":"product.deleted","parameters":[{"name":"X-DLAB-Signature","in":"header","required":true,"schema":{"type":"string"}},{"name":"X-DLAB-Event","in":"header","schema":{"type":"string"}},{"name":"X-DLAB-Delivery","in":"header","schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookPayload"}}}},"responses":{"200":{"description":"2xx dışı yanıt veya 10 sn zaman aşımı = başarısız; 1dk, 5dk, 30dk, 2sa, 6sa sonra yeniden denenir; art arda 10 başarısızlıkta uç kapatılır"}}}},"stock.changed":{"post":{"summary":"stock.changed","parameters":[{"name":"X-DLAB-Signature","in":"header","required":true,"schema":{"type":"string"}},{"name":"X-DLAB-Event","in":"header","schema":{"type":"string"}},{"name":"X-DLAB-Delivery","in":"header","schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookPayload"}}}},"responses":{"200":{"description":"2xx dışı yanıt veya 10 sn zaman aşımı = başarısız; 1dk, 5dk, 30dk, 2sa, 6sa sonra yeniden denenir; art arda 10 başarısızlıkta uç kapatılır"}}}},"customer.created":{"post":{"summary":"customer.created","parameters":[{"name":"X-DLAB-Signature","in":"header","required":true,"schema":{"type":"string"}},{"name":"X-DLAB-Event","in":"header","schema":{"type":"string"}},{"name":"X-DLAB-Delivery","in":"header","schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookPayload"}}}},"responses":{"200":{"description":"2xx dışı yanıt veya 10 sn zaman aşımı = başarısız; 1dk, 5dk, 30dk, 2sa, 6sa sonra yeniden denenir; art arda 10 başarısızlıkta uç kapatılır"}}}}},"components":{"securitySchemes":{"apiKey":{"type":"http","scheme":"bearer","bearerFormat":"dlk_live_<önek>_<sır>"}},"schemas":{"Error":{"type":"object","properties":{"statusCode":{"type":"integer"},"message":{"type":"string","description":"Türkçe açıklama"},"error":{"type":"string"}}},"Variant":{"type":"object","properties":{"id":{"type":"string"},"sku":{"type":"string"},"barcode":{"type":["string","null"]},"options":{"type":"object","additionalProperties":{"type":"string"}},"title":{"type":"string"},"price":{"type":"number"},"compareAtPrice":{"type":["number","null"]},"stock":{"type":"integer"},"isActive":{"type":"boolean"},"externalIds":{"type":"object"}}},"Product":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"},"slug":{"type":"string"},"status":{"enum":["DRAFT","ACTIVE","ARCHIVED"]},"brand":{"type":["object","null"]},"categoryIds":{"type":"array","items":{"type":"string"}},"vatRate":{"type":"integer"},"images":{"type":"array","items":{"type":"string"}},"externalIds":{"type":"object"},"variants":{"type":"array","items":{"$ref":"#/components/schemas/Variant"}},"updatedAt":{"type":"string","format":"date-time"}}},"VariantInput":{"type":"object","required":["sku","price"],"properties":{"id":{"type":"string"},"sku":{"type":"string","maxLength":80},"barcode":{"type":["string","null"],"maxLength":40},"options":{"type":"object","additionalProperties":{"type":"string"}},"price":{"type":"number"},"compareAtPrice":{"type":["number","null"]},"costPrice":{"type":["number","null"]},"stock":{"type":"integer","description":"MUTLAK stok"},"trackStock":{"type":"boolean"},"allowBackorder":{"type":"boolean"},"imageUrl":{"type":["string","null"]},"isActive":{"type":"boolean"}}},"ProductInput":{"type":"object","required":["title","variants"],"properties":{"title":{"type":"string"},"slug":{"type":"string"},"description":{"type":"string"},"shortDescription":{"type":"string"},"status":{"enum":["DRAFT","ACTIVE","ARCHIVED"]},"brandId":{"type":["string","null"]},"categoryIds":{"type":"array","items":{"type":"string"}},"tags":{"type":"array","items":{"type":"string"}},"attributes":{"type":"object"},"options":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"values":{"type":"array","items":{"type":"string"}}}}},"vatRate":{"enum":[0,1,10,20]},"desi":{"type":["number","null"]},"images":{"type":"array","items":{"type":"object","properties":{"url":{"type":"string"},"alt":{"type":"string"}}}},"variants":{"type":"array","minItems":1,"maxItems":500,"items":{"$ref":"#/components/schemas/VariantInput"}}}},"ProductInputPartial":{"allOf":[{"$ref":"#/components/schemas/ProductInput"}],"description":"Tüm alanlar isteğe bağlı"},"OrderItem":{"type":"object","properties":{"id":{"type":"string"},"productId":{"type":["string","null"]},"variantId":{"type":["string","null"]},"sku":{"type":"string"},"barcode":{"type":["string","null"]},"title":{"type":"string"},"variantTitle":{"type":"string"},"qty":{"type":"integer"},"unitPrice":{"type":"number"},"discount":{"type":"number"},"lineTotal":{"type":"number"},"vatRate":{"type":"integer"},"returnedQty":{"type":"integer"}}},"Order":{"type":"object","properties":{"id":{"type":"string"},"number":{"type":"integer"},"status":{"type":"string"},"paymentStatus":{"type":"string"},"paymentMethod":{"enum":["CARD","BANK_TRANSFER","COD_CASH","COD_CARD"]},"email":{"type":"string"},"phone":{"type":"string"},"currency":{"type":"string"},"subtotal":{"type":"number"},"discountTotal":{"type":"number"},"shippingTotal":{"type":"number"},"paymentFee":{"type":"number"},"grandTotal":{"type":"number"},"couponCode":{"type":["string","null"]},"shippingMethod":{"type":["string","null"]},"shippingAddress":{"type":"object"},"billingAddress":{"type":"object"},"items":{"type":"array","items":{"$ref":"#/components/schemas/OrderItem"}},"shipments":{"type":"array","items":{"type":"object"}},"placedAt":{"type":"string","format":"date-time"},"paidAt":{"type":["string","null"]},"updatedAt":{"type":"string","format":"date-time"}}},"Category":{"type":"object","properties":{"id":{"type":"string"},"parentId":{"type":["string","null"]},"name":{"type":"string"},"slug":{"type":"string"},"path":{"type":"string","example":"Kadın > Elbise"},"isActive":{"type":"boolean"},"sort":{"type":"integer"}}},"Customer":{"type":"object","properties":{"id":{"type":"string"},"email":{"type":"string"},"firstName":{"type":"string"},"lastName":{"type":"string"},"phone":{"type":["string","null"]},"isGuest":{"type":"boolean"},"acceptsMarketing":{"type":"boolean"},"groupId":{"type":["string","null"]},"createdAt":{"type":"string"}}},"BatchResult":{"type":"object","properties":{"updated":{"type":"integer"},"unchanged":{"type":"integer"},"failed":{"type":"integer"},"results":{"type":"array","items":{"type":"object","properties":{"sku":{"type":["string","null"]},"barcode":{"type":["string","null"]},"ok":{"type":"boolean"},"changed":{"type":"boolean"},"error":{"type":"string"}}}}}},"Job":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string"},"status":{"enum":["QUEUED","RUNNING","DONE","FAILED"]},"total":{"type":"integer"},"processed":{"type":"integer"},"succeeded":{"type":"integer"},"failed":{"type":"integer"},"results":{"type":"array","items":{"type":"object","properties":{"index":{"type":"integer"},"sku":{"type":"string"},"ok":{"type":"boolean"},"action":{"enum":["created","updated"]},"productId":{"type":"string"},"error":{"type":"string"}}}},"createdAt":{"type":"string"},"finishedAt":{"type":["string","null"]}}},"WebhookEvent":{"enum":["order.created","order.paid","order.status_changed","order.cancelled","product.created","product.updated","product.deleted","stock.changed","customer.created"]},"WebhookEndpoint":{"type":"object","properties":{"id":{"type":"string"},"url":{"type":"string"},"description":{"type":"string"},"events":{"type":"array","items":{"$ref":"#/components/schemas/WebhookEvent"}},"isActive":{"type":"boolean"},"failureCount":{"type":"integer"},"disabledReason":{"type":["string","null"]},"lastDeliveryAt":{"type":["string","null"]},"createdAt":{"type":"string"}}},"WebhookPayload":{"type":"object","properties":{"id":{"type":"string","example":"evt_..."},"event":{"$ref":"#/components/schemas/WebhookEvent"},"createdAt":{"type":"string"},"siteId":{"type":"string"},"source":{"type":"string","description":"panel | storefront | api:<anahtarÖneki> | system"},"data":{"type":"object","description":"order.* → Order (+previousStatus) · product.* → Product · stock.changed → { variantId, productId, sku, barcode, stock (MUTLAK), delta, reason, ref } · customer.created → Customer"}}}}}}