{"openapi":"3.0.3","info":{"title":"Ödecik API","version":"1.0.0","description":"Ödecik satıcı API'si. Mağazanın ürünlerini, siparişlerini, kuponlarını ve webhook'larını yönet; sunucudan ödeme oturumu aç.\n\nTüm tutarlar kuruş (minor unit) cinsinden tam sayıdır: 15000 = 150,00 TRY."},"servers":[{"url":"https://odecik.com/api/v1","description":"Canlı"}],"security":[{"bearerAuth":[]}],"tags":[{"name":"Mağaza"},{"name":"Ürünler"},{"name":"Siparişler"},{"name":"Ödeme oturumları"},{"name":"Müşteriler"},{"name":"Kuponlar"},{"name":"Webhook'lar"}],"paths":{"/store":{"get":{"tags":["Mağaza"],"operationId":"getStore","summary":"Mağaza bilgisi","description":"Anahtarın bağlı olduğu mağazayı döner. Kimlik doğrulamayı denemek için en kolay uç noktadır.","responses":{"200":{"description":"Başarılı","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Store"}}}},"400":{"description":"Geçersiz istek","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Geçersiz veya iptal edilmiş API anahtarı","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":"Kaynak bulunamadı","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Hız sınırı aşıldı","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/balance":{"get":{"tags":["Mağaza"],"operationId":"getBalance","summary":"Bakiye","responses":{"200":{"description":"Başarılı","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Balance"}}}},"400":{"description":"Geçersiz istek","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Geçersiz veya iptal edilmiş API anahtarı","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":"Kaynak bulunamadı","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Hız sınırı aşıldı","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/products":{"get":{"tags":["Ürünler"],"operationId":"listProducts","summary":"Ürünleri listele","parameters":[{"name":"status","in":"query","required":false,"description":"DRAFT | ACTIVE | ARCHIVED","schema":{"type":"string"}},{"name":"type","in":"query","required":false,"description":"PHYSICAL | DIGITAL | SERVICE","schema":{"type":"string"}},{"name":"limit","in":"query","required":false,"description":"Sayfa başına kayıt (1–100, varsayılan 25)","schema":{"type":"integer","minimum":1,"maximum":100}},{"name":"cursor","in":"query","required":false,"description":"Önceki yanıttaki nextCursor değeri","schema":{"type":"string"}}],"responses":{"200":{"description":"Başarılı","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/List"}],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Product"}}}}}}},"400":{"description":"Geçersiz istek","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Geçersiz veya iptal edilmiş API anahtarı","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":"Kaynak bulunamadı","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Hız sınırı aşıldı","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["Ürünler"],"operationId":"createProduct","summary":"Ürün oluştur","description":"`write` yetkisi gerekir.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProductInput"},"example":{"name":"Premium şablon paketi","type":"DIGITAL","priceKurus":14900,"description":"12 sayfalık UI kit"}}}},"responses":{"201":{"description":"Oluşturuldu","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Product"}}}},"400":{"description":"Geçersiz istek","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Geçersiz veya iptal edilmiş API anahtarı","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":"Kaynak bulunamadı","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Hız sınırı aşıldı","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/products/{id}":{"get":{"tags":["Ürünler"],"operationId":"getProduct","summary":"Ürün getir","description":"`id` olarak ürün kimliği veya slug kullanılabilir.","parameters":[{"name":"id","in":"path","required":true,"description":"","schema":{"type":"string"}}],"responses":{"200":{"description":"Başarılı","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Product"}}}},"400":{"description":"Geçersiz istek","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Geçersiz veya iptal edilmiş API anahtarı","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":"Kaynak bulunamadı","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Hız sınırı aşıldı","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"tags":["Ürünler"],"operationId":"updateProduct","summary":"Ürünü güncelle","description":"Kısmi güncelleme — yalnız gönderdiğin alanlar değişir. `write` yetkisi gerekir.","parameters":[{"name":"id","in":"path","required":true,"description":"","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProductInput"}}}},"responses":{"200":{"description":"Başarılı","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Product"}}}},"400":{"description":"Geçersiz istek","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Geçersiz veya iptal edilmiş API anahtarı","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":"Kaynak bulunamadı","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Hız sınırı aşıldı","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"tags":["Ürünler"],"operationId":"deleteProduct","summary":"Ürünü sil","description":"Siparişi olan ürün silinmez, arşivlenir (`archived: true`). `write` yetkisi gerekir.","parameters":[{"name":"id","in":"path","required":true,"description":"","schema":{"type":"string"}}],"responses":{"200":{"description":"Başarılı","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"deleted":{"type":"boolean"},"archived":{"type":"boolean"}}}}}},"400":{"description":"Geçersiz istek","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Geçersiz veya iptal edilmiş API anahtarı","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":"Kaynak bulunamadı","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Hız sınırı aşıldı","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/orders":{"get":{"tags":["Siparişler"],"operationId":"listOrders","summary":"Siparişleri listele","parameters":[{"name":"status","in":"query","required":false,"description":"PENDING | PAID | SHIPPED | COMPLETED | REFUNDED | CANCELLED","schema":{"type":"string"}},{"name":"email","in":"query","required":false,"description":"Alıcı e-postası","schema":{"type":"string"}},{"name":"created_gte","in":"query","required":false,"description":"Bu tarihten sonra (ISO 8601)","schema":{"type":"string"}},{"name":"created_lte","in":"query","required":false,"description":"Bu tarihten önce (ISO 8601)","schema":{"type":"string"}},{"name":"limit","in":"query","required":false,"description":"Sayfa başına kayıt (1–100, varsayılan 25)","schema":{"type":"integer","minimum":1,"maximum":100}},{"name":"cursor","in":"query","required":false,"description":"Önceki yanıttaki nextCursor değeri","schema":{"type":"string"}}],"responses":{"200":{"description":"Başarılı","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/List"}],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Order"}}}}}}},"400":{"description":"Geçersiz istek","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Geçersiz veya iptal edilmiş API anahtarı","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":"Kaynak bulunamadı","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Hız sınırı aşıldı","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/orders/{id}":{"get":{"tags":["Siparişler"],"operationId":"getOrder","summary":"Sipariş getir","description":"`id` olarak sipariş kimliği veya sipariş numarası (`ODC-…`) kullanılabilir.","parameters":[{"name":"id","in":"path","required":true,"description":"","schema":{"type":"string"}}],"responses":{"200":{"description":"Başarılı","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Order"}}}},"400":{"description":"Geçersiz istek","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Geçersiz veya iptal edilmiş API anahtarı","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":"Kaynak bulunamadı","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Hız sınırı aşıldı","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/orders/{id}/ship":{"post":{"tags":["Siparişler"],"operationId":"shipOrder","summary":"Siparişi kargola","description":"Siparişi `SHIPPED` yapar, alıcıya takip e-postası gönderir ve `order.shipped` webhook'unu tetikler. `write` yetkisi gerekir.","parameters":[{"name":"id","in":"path","required":true,"description":"","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["carrier","trackingNo"],"properties":{"carrier":{"type":"string","enum":["yurtici","aras","mng","ptt","surat","hepsijet","trendyol","ups","dhl","fedex","diger"]},"trackingNo":{"type":"string","minLength":3,"maxLength":60}}},"example":{"carrier":"yurtici","trackingNo":"123456789012"}}}},"responses":{"200":{"description":"Başarılı","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Order"}}}},"400":{"description":"Geçersiz istek","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Geçersiz veya iptal edilmiş API anahtarı","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":"Kaynak bulunamadı","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Hız sınırı aşıldı","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/orders/{id}/refund":{"post":{"tags":["Siparişler"],"operationId":"refundOrder","summary":"Siparişi iade et","description":"Net tutar satıcı bakiyesinden düşülür ve `order.refunded` webhook'u tetiklenir. Kart iadesi ödeme sağlayıcısı üzerinden ayrıca yapılır. Ödemesi IBAN'a aktarılmış siparişler `409 payout_completed` döner. `write` yetkisi gerekir.","parameters":[{"name":"id","in":"path","required":true,"description":"","schema":{"type":"string"}}],"responses":{"200":{"description":"Başarılı","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Order"}}}},"400":{"description":"Geçersiz istek","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Geçersiz veya iptal edilmiş API anahtarı","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":"Kaynak bulunamadı","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Hız sınırı aşıldı","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/checkout/sessions":{"post":{"tags":["Ödeme oturumları"],"operationId":"createCheckoutSession","summary":"Ödeme oturumu oluştur","description":"Sipariş `PENDING` olarak açılır ve alıcıyı yönlendireceğin `paymentUrl` döner. Ödeme tamamlanınca `order.paid` webhook'u gelir ve alıcı `successUrl`'ye döner. `write` yetkisi gerekir.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CheckoutSessionInput"},"example":{"product":"premium-sablon-paketi","quantity":1,"successUrl":"https://siteadresin.com/tesekkurler","buyer":{"name":"Ayşe Yılmaz","email":"ayse@example.com"}}}}},"responses":{"201":{"description":"Oluşturuldu","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CheckoutSession"}}}},"400":{"description":"Geçersiz istek","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Geçersiz veya iptal edilmiş API anahtarı","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":"Kaynak bulunamadı","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Hız sınırı aşıldı","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/customers":{"get":{"tags":["Müşteriler"],"operationId":"listCustomers","summary":"Müşterileri listele","description":"Ödeme yapmış alıcılar e-posta bazında toplanır, toplam harcamaya göre sıralanır.","parameters":[{"name":"limit","in":"query","required":false,"description":"1–100, varsayılan 50","schema":{"type":"integer"}}],"responses":{"200":{"description":"Başarılı","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/List"}],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Customer"}}}}}}},"400":{"description":"Geçersiz istek","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Geçersiz veya iptal edilmiş API anahtarı","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":"Kaynak bulunamadı","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Hız sınırı aşıldı","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/coupons":{"get":{"tags":["Kuponlar"],"operationId":"listCoupons","summary":"Kuponları listele","responses":{"200":{"description":"Başarılı","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/List"}],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Coupon"}}}}}}},"400":{"description":"Geçersiz istek","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Geçersiz veya iptal edilmiş API anahtarı","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":"Kaynak bulunamadı","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Hız sınırı aşıldı","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["Kuponlar"],"operationId":"createCoupon","summary":"Kupon oluştur","description":"`write` yetkisi gerekir.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["code","percent"],"properties":{"code":{"type":"string","pattern":"^[A-Z0-9_-]+$","minLength":3,"maxLength":30},"percent":{"type":"integer","minimum":1,"maximum":99}}},"example":{"code":"YAZ20","percent":20}}}},"responses":{"201":{"description":"Oluşturuldu","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Coupon"}}}},"400":{"description":"Geçersiz istek","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Geçersiz veya iptal edilmiş API anahtarı","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":"Kaynak bulunamadı","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Hız sınırı aşıldı","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/coupons/{code}":{"delete":{"tags":["Kuponlar"],"operationId":"deleteCoupon","summary":"Kuponu sil","description":"`write` yetkisi gerekir.","parameters":[{"name":"code","in":"path","required":true,"description":"","schema":{"type":"string"}}],"responses":{"200":{"description":"Başarılı","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"deleted":{"type":"boolean"}}}}}},"400":{"description":"Geçersiz istek","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Geçersiz veya iptal edilmiş API anahtarı","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":"Kaynak bulunamadı","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Hız sınırı aşıldı","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/webhooks":{"get":{"tags":["Webhook'lar"],"operationId":"listWebhooks","summary":"Webhook endpoint'lerini listele","responses":{"200":{"description":"Başarılı","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/List"}],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/WebhookEndpoint"}}}}}}},"400":{"description":"Geçersiz istek","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Geçersiz veya iptal edilmiş API anahtarı","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":"Kaynak bulunamadı","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Hız sınırı aşıldı","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["Webhook'lar"],"operationId":"createWebhook","summary":"Webhook endpoint'i ekle","description":"İmza sırrı (`secret`) yalnız bu yanıtta döner. URL bir Discord veya Slack webhook adresiyse olaylar o platformun biçiminde (imzasız) iletilir. `write` yetkisi gerekir.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["url","events"],"properties":{"url":{"type":"string","format":"uri","description":"https:// ile başlamalı"},"events":{"type":"array","minItems":1,"items":{"$ref":"#/components/schemas/EventType"}}}},"example":{"url":"https://siteadresin.com/odecik-webhook","events":["order.paid","order.shipped"]}}}},"responses":{"201":{"description":"Oluşturuldu","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEndpoint"}}}},"400":{"description":"Geçersiz istek","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Geçersiz veya iptal edilmiş API anahtarı","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":"Kaynak bulunamadı","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Hız sınırı aşıldı","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/webhooks/{id}":{"delete":{"tags":["Webhook'lar"],"operationId":"deleteWebhook","summary":"Webhook endpoint'ini sil","description":"`write` yetkisi gerekir.","parameters":[{"name":"id","in":"path","required":true,"description":"","schema":{"type":"string"}}],"responses":{"200":{"description":"Başarılı","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"deleted":{"type":"boolean"}}}}}},"400":{"description":"Geçersiz istek","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Geçersiz veya iptal edilmiş API anahtarı","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":"Kaynak bulunamadı","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Hız sınırı aşıldı","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/webhooks/{id}/test":{"post":{"tags":["Webhook'lar"],"operationId":"testWebhook","summary":"Test olayı gönder","description":"Örnek bir `order.paid` olayını endpoint'e tek denemeyle iletir ve sonucu döner. `write` yetkisi gerekir.","parameters":[{"name":"id","in":"path","required":true,"description":"","schema":{"type":"string"}}],"responses":{"200":{"description":"Başarılı","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"},"responseCode":{"type":"integer","nullable":true},"error":{"type":"string"}}}}}},"400":{"description":"Geçersiz istek","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Geçersiz veya iptal edilmiş API anahtarı","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":"Kaynak bulunamadı","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Hız sınırı aşıldı","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/webhooks/{id}/deliveries":{"get":{"tags":["Webhook'lar"],"operationId":"listWebhookDeliveries","summary":"Teslimat geçmişi","parameters":[{"name":"id","in":"path","required":true,"description":"","schema":{"type":"string"}},{"name":"limit","in":"query","required":false,"description":"Sayfa başına kayıt (1–100, varsayılan 25)","schema":{"type":"integer","minimum":1,"maximum":100}},{"name":"cursor","in":"query","required":false,"description":"Önceki yanıttaki nextCursor değeri","schema":{"type":"string"}}],"responses":{"200":{"description":"Başarılı","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/List"}],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/WebhookDelivery"}}}}}}},"400":{"description":"Geçersiz istek","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Geçersiz veya iptal edilmiş API anahtarı","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":"Kaynak bulunamadı","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Hız sınırı aşıldı","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}},"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","description":"Panel → Geliştirici bölümünden oluşturduğun `odecik_sk_…` anahtarı."}},"schemas":{"Error":{"type":"object","properties":{"error":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string","example":"invalid_request"},"message":{"type":"string"},"param":{"type":"string","description":"Hataya sebep olan alan"}}}}},"List":{"type":"object","properties":{"object":{"type":"string","example":"list"},"hasMore":{"type":"boolean"},"nextCursor":{"type":"string","nullable":true}}},"EventType":{"type":"string","enum":["order.created","order.paid","order.shipped","order.refunded","payout.completed"]},"Store":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"slug":{"type":"string"},"url":{"type":"string"},"isPublic":{"type":"boolean"},"description":{"type":"string","nullable":true},"logoUrl":{"type":"string","nullable":true},"createdAt":{"type":"string","format":"date-time"}}},"Balance":{"type":"object","properties":{"currency":{"type":"string","example":"TRY"},"availableKurus":{"type":"integer"},"pendingKurus":{"type":"integer"},"payoutRequestedKurus":{"type":"integer"}}},"Product":{"type":"object","properties":{"id":{"type":"string"},"slug":{"type":"string"},"name":{"type":"string"},"description":{"type":"string","nullable":true},"type":{"type":"string","enum":["PHYSICAL","DIGITAL","SERVICE"]},"status":{"type":"string","enum":["DRAFT","ACTIVE","ARCHIVED"]},"priceKurus":{"type":"integer"},"compareAtKurus":{"type":"integer","nullable":true},"currency":{"type":"string"},"imageUrl":{"type":"string","nullable":true},"images":{"type":"array","items":{"type":"string"}},"stock":{"type":"integer","nullable":true},"category":{"type":"string","nullable":true},"tags":{"type":"array","items":{"type":"string"}},"sku":{"type":"string","nullable":true},"brand":{"type":"string","nullable":true},"minOrderQty":{"type":"integer"},"url":{"type":"string","description":"Herkese açık ödeme sayfası"},"variants":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"options":{"type":"object"},"priceKurus":{"type":"integer","nullable":true},"stock":{"type":"integer","nullable":true},"sku":{"type":"string","nullable":true},"isActive":{"type":"boolean"}}}},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}}},"ProductInput":{"type":"object","required":["name","type","priceKurus"],"properties":{"name":{"type":"string","minLength":2,"maxLength":120},"description":{"type":"string","maxLength":2000},"type":{"type":"string","enum":["PHYSICAL","DIGITAL","SERVICE"]},"priceKurus":{"type":"integer","minimum":100},"compareAtKurus":{"type":"integer","nullable":true},"imageUrl":{"type":"string"},"images":{"type":"array","items":{"type":"string"},"maxItems":8},"digitalFileUrl":{"type":"string"},"stock":{"type":"integer","nullable":true},"status":{"type":"string","enum":["DRAFT","ACTIVE","ARCHIVED"],"default":"ACTIVE"},"category":{"type":"string"},"tags":{"type":"array","items":{"type":"string"}},"sku":{"type":"string"},"brand":{"type":"string"},"highlights":{"type":"array","items":{"type":"string"}},"weightGrams":{"type":"integer","nullable":true},"minOrderQty":{"type":"integer","default":1},"warrantyMonths":{"type":"integer","nullable":true},"shippingNote":{"type":"string"},"returnPolicy":{"type":"string"}}},"Order":{"type":"object","properties":{"id":{"type":"string"},"orderNo":{"type":"string","example":"ODC-M2K9X1-A4F2"},"status":{"type":"string","enum":["PENDING","PAID","SHIPPED","COMPLETED","REFUNDED","CANCELLED"]},"currency":{"type":"string"},"totalKurus":{"type":"integer"},"commissionKurus":{"type":"integer"},"netKurus":{"type":"integer"},"buyer":{"type":"object","properties":{"name":{"type":"string"},"email":{"type":"string"},"phone":{"type":"string","nullable":true},"address":{"type":"string","nullable":true}}},"items":{"type":"array","items":{"type":"object","properties":{"productId":{"type":"string","nullable":true},"name":{"type":"string"},"type":{"type":"string"},"variantId":{"type":"string","nullable":true},"variantName":{"type":"string","nullable":true},"quantity":{"type":"integer"},"priceKurus":{"type":"integer"}}}},"shipping":{"type":"object","nullable":true,"properties":{"carrier":{"type":"string"},"trackingNo":{"type":"string"},"trackingUrl":{"type":"string","nullable":true},"shippedAt":{"type":"string","format":"date-time","nullable":true}}},"createdAt":{"type":"string","format":"date-time"}}},"CheckoutSessionInput":{"type":"object","required":["product","buyer"],"properties":{"product":{"type":"string","description":"Ürün kimliği veya slug"},"quantity":{"type":"integer","default":1,"minimum":1,"maximum":99},"variantId":{"type":"string"},"couponCode":{"type":"string"},"successUrl":{"type":"string","format":"uri","description":"Ödeme sonrası dönülecek https adresi"},"buyer":{"type":"object","required":["name","email"],"properties":{"name":{"type":"string"},"email":{"type":"string","format":"email"},"phone":{"type":"string"},"address":{"type":"string","description":"Fiziksel ürünlerde zorunlu değil ama önerilir"},"ip":{"type":"string","description":"Alıcının IP'si; verilmezse isteği yapan sunucununki kullanılır"}}}}},"CheckoutSession":{"type":"object","properties":{"orderNo":{"type":"string"},"status":{"type":"string","enum":["PENDING","PAID"]},"totalKurus":{"type":"integer"},"currency":{"type":"string"},"paymentUrl":{"type":"string","nullable":true,"description":"Alıcıyı buraya yönlendir"},"testMode":{"type":"boolean"},"licenseKeys":{"type":"array","items":{"type":"string"}}}},"Customer":{"type":"object","properties":{"email":{"type":"string"},"orderCount":{"type":"integer"},"totalSpentKurus":{"type":"integer"},"firstOrderAt":{"type":"string","format":"date-time"},"lastOrderAt":{"type":"string","format":"date-time"}}},"Coupon":{"type":"object","properties":{"id":{"type":"string"},"code":{"type":"string"},"percent":{"type":"integer"},"isActive":{"type":"boolean"},"createdAt":{"type":"string","format":"date-time"}}},"WebhookEndpoint":{"type":"object","properties":{"id":{"type":"string"},"url":{"type":"string"},"target":{"type":"string","enum":["generic","discord","slack"]},"events":{"type":"array","items":{"$ref":"#/components/schemas/EventType"}},"isActive":{"type":"boolean"},"secret":{"type":"string","description":"Yalnız oluşturma yanıtında"},"createdAt":{"type":"string","format":"date-time"}}},"WebhookDelivery":{"type":"object","properties":{"id":{"type":"string"},"event":{"type":"string"},"status":{"type":"string","enum":["PENDING","SUCCESS","FAILED","RETRYING"]},"responseCode":{"type":"integer","nullable":true},"attempts":{"type":"integer"},"payload":{"type":"object"},"createdAt":{"type":"string","format":"date-time"},"deliveredAt":{"type":"string","format":"date-time","nullable":true}}}}}}