{
    "openapi": "3.0.3",
    "info": {
        "title": "Etibas API",
        "version": "2.1",
        "description": "Etibas panelindeki ürün, stok, fiyat, kategori, marka ve sipariş verisine dış yazılımlardan erişim; ürün/stok/fiyat yazma, sipariş yönetimi ve webhook.\n\nKimlik: `Authorization: Bearer {token}` — token panelde **Ayarlar › API Hesapları** ekranından üretilir.\n\nBelge ve deneme konsolu: https://api.etibas.com/dokumantasyon.php",
        "contact": {
            "name": "Etibas Destek",
            "url": "https://yardim.etibas.com",
            "email": "destek@etibas.com"
        }
    },
    "servers": [
        {
            "url": "https://api.etibas.com/v2",
            "description": "Canlı (her hesap) ve sandbox (demo hesabının token'ı)"
        }
    ],
    "security": [
        {
            "bearer": []
        }
    ],
    "tags": [
        {
            "name": "Hesap",
            "description": "Token'ın bağlı olduğu hesap, kapsam ve yetkiler."
        },
        {
            "name": "Ürünler",
            "description": "Katalog okuma; ürün açma, güncelleme, pasife alma, görseller."
        },
        {
            "name": "Stok & Fiyat",
            "description": "Hafif stok/fiyat listesi; tekil ve toplu stok/fiyat yazma."
        },
        {
            "name": "Kategori · Marka · Özellik",
            "description": "Referans listeleri ve yoksa açma."
        },
        {
            "name": "Siparişler",
            "description": "Sipariş açma, listeleme, iptal, kargo, durum, not, adres."
        },
        {
            "name": "Referans Listeleri",
            "description": "Kargo firmaları, sipariş durumları, satış kanalları, depolar."
        },
        {
            "name": "Webhook & Olaylar",
            "description": "Anında bildirim adresi, imza, deneme, gönderim günlüğü."
        }
    ],
    "paths": {
        "/ben": {
            "get": {
                "operationId": "ben",
                "tags": [
                    "Hesap"
                ],
                "summary": "Token'ın hesabı ve yetkileri",
                "description": "Token'ın hangi hesaba bağlı olduğunu, sipariş görünürlüğünü, özel fiyatın açık olup olmadığını ve yazma yetkilerini döner.\n\nEntegrasyonun ilk çağrısı bu olmalı: token doğruysa `200`, değilse `401`. `yetkiler` dizisi hangi uçları kullanabileceğinizi söyler; `sandbox: true` ise demo hesabındasınız (yazdıklarınız günlük temizlenir).\n\n**Yetki:** Okuma — Her token kullanabilir.",
                "parameters": [],
                "responses": {
                    "200": {
                        "description": "Başarılı",
                        "content": {
                            "application/json": {
                                "example": {
                                    "hesap": "firma-hesabi",
                                    "api_hesabi": {
                                        "id": "b7237…",
                                        "isim": "Bayi Sitesi"
                                    },
                                    "fiyat_yonetimi": true,
                                    "siparis_kapsam": "kendi",
                                    "etibas_agi": false,
                                    "teslimat": "musteri",
                                    "webhook": true,
                                    "yetkiler": [
                                        "okuma",
                                        "siparis_ac",
                                        "urun_yaz"
                                    ],
                                    "ip_kisiti": false,
                                    "sandbox": false,
                                    "hiz_siniri": {
                                        "dakika": 600
                                    },
                                    "surum": "2.1",
                                    "belge": "https://api.etibas.com/dokumantasyon.php"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "TOKEN_GECERSIZ: Token tanımsız / pasif.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Hata"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "HIZ_SINIRI — dakikada 600 istek",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Hata"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/urunler": {
            "get": {
                "operationId": "urunler-liste",
                "tags": [
                    "Ürünler"
                ],
                "summary": "Ürün listesi",
                "description": "API hesabına açık ürünler, imleçli sayfalama ile. Barkod, kod ya da serbest metinle süzülebilir.\n\nHer satırda liste fiyatı `psf` (KDV dahil TL) gelir. Tedarikçi bu hesaba özel fiyat tanımladıysa `alis` de gelir; yoksa kendi iskontonuzu `psf` üzerinden uygularsınız.\n\n`stok`, API hesabının stok kuralına göre hesaplanır (satışa kapalı tedarikçiler ve kapalı firmalar sayılmaz, depo kuralı uygulanır). Pasif ürünler listede yer almaz.\n\nTam eşitleme için `size=1000` ile `sonraki_imlec` null olana dek dolaşın; dakikalık eşitleme için `/stoklar`, anlık bildirim için webhook kullanın.\n\n**Yetki:** Okuma — Her token kullanabilir.",
                "parameters": [
                    {
                        "name": "size",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "integer",
                            "default": 1000
                        },
                        "description": "Sayfa boyu (en çok 1000)."
                    },
                    {
                        "name": "imlec",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Önceki yanıttaki `sonraki_imlec`; `null` gelince liste bitmiştir."
                    },
                    {
                        "name": "ids",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Virgülle ürün kimlikleri (en çok 1000). Verilirse sayfalama yok."
                    },
                    {
                        "name": "barkod",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Virgülle barkodlar (en çok 1000) — birebir eşleşme."
                    },
                    {
                        "name": "kod",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Virgülle stok kodları (en çok 1000) — birebir eşleşme."
                    },
                    {
                        "name": "ara",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Serbest metin: ad, barkod, kod içinde kelime kelime (büyük/küçük ve Türkçe harf farkı yok)."
                    },
                    {
                        "name": "sadece_stok",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "integer",
                            "default": 0
                        },
                        "description": "`1` → yalnız stoğu olanlar."
                    },
                    {
                        "name": "tanitim",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "integer",
                            "default": 0
                        },
                        "description": "`1` → her satıra açıklama HTML'i (`tanitim`) eklenir. Yanıt büyür; ilk aktarımda kullanın."
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Başarılı",
                        "content": {
                            "application/json": {
                                "example": {
                                    "veri": [
                                        {
                                            "id": "URN001",
                                            "isim": "Casio G-Shock GA-2100-1A1ER Erkek Kol Saati",
                                            "barkod": "4549526241383",
                                            "kod": "GA-2100-1A1ER",
                                            "kategori": {
                                                "_id": "KAT12",
                                                "isim": "Saat / Erkek Kol Saati"
                                            },
                                            "marka": {
                                                "_id": "MRK01",
                                                "isim": "Casio"
                                            },
                                            "psf": 4299,
                                            "alis": 3009.3,
                                            "kdv_deger": 20,
                                            "stok": 12,
                                            "desi": 1,
                                            "on_siparis": false,
                                            "resim": "https://d2bz7gbm1sig6o.cloudfront.net/hesap/resimler/abc.jpg",
                                            "resimler": [
                                                "https://d2bz7gbm1sig6o.cloudfront.net/hesap/resimler/abc.jpg",
                                                "https://d2bz7gbm1sig6o.cloudfront.net/hesap/resimler/abd.jpg"
                                            ],
                                            "ozellikler": [
                                                {
                                                    "suzgec": "Kasa Çapı",
                                                    "filtre": "45 mm"
                                                },
                                                {
                                                    "suzgec": "Kordon",
                                                    "filtre": "Reçine"
                                                }
                                            ]
                                        }
                                    ],
                                    "sonraki_imlec": "Q2FzaW8gRy1TaG9jaw==",
                                    "toplam": 1842
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "TOKEN_GECERSIZ: Token tanımsız / pasif.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Hata"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "HIZ_SINIRI: Dakikada 600 istek aşıldı.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Hata"
                                }
                            }
                        }
                    }
                }
            },
            "post": {
                "operationId": "urunler-ekle",
                "tags": [
                    "Ürünler"
                ],
                "summary": "Ürün aç",
                "description": "Kataloğa yeni ürün açar: ad, barkod, marka, kategori, fiyat, görseller, açıklama, özellikler ve isteğe bağlı ilk stok tek istekte.\n\nPanelin **Ürün Ekle** penceresiyle birebir aynı kurallar işler: barkod katalogda tekildir (aynı barkod → `409 BARKOD_VAR`), aynı `kod` ile açılan ürünler varyant ailesi kurar (kategori varyant grubu tanımlıysa `varyant_secim` zorunlu olur), web sitesi ve B2B kataloğuna kendiliğinden eklenir, görseller o anda indirilir.\n\nMarka ve kategori **adla** verilebilir: katalogda yoksa `marka_ac` / `kategori_ac` (varsayılan `true`) ile açılır. Kategori yolu `\"Saat / Erkek Kol Saati\"` biçiminde verilirse zincir üstten alta kurulur.\n\n`ozellikler` ad çiftleriyle verilir ve **var olan** özellik grubu/değerine eşlenir (`GET /ozellikler`); eşleşmeyenler `uyarilar` dizisine düşer, ürün yine açılır.\n\n`stok` verilirse ürün açılır açılmaz kendi deponuza o adet yazılır (bkz. `PUT /urunler/{id}/stok`).\n\n**Yetki:** Ürün yazma — API Hesapları › Genel › Yazma yetkileri › Ürün yazma işaretli olmalı.",
                "parameters": [],
                "responses": {
                    "201": {
                        "description": "Başarılı",
                        "content": {
                            "application/json": {
                                "example": {
                                    "veri": {
                                        "id": "URN001",
                                        "isim": "Casio G-Shock GA-2100-1A1ER Erkek Kol Saati",
                                        "barkod": "4549526241383",
                                        "kod": "GA-2100-1A1ER",
                                        "kategori": {
                                            "_id": "KAT12",
                                            "isim": "Saat / Erkek Kol Saati"
                                        },
                                        "marka": {
                                            "_id": "MRK01",
                                            "isim": "Casio"
                                        },
                                        "psf": 4299,
                                        "alis": 3009.3,
                                        "kdv_deger": 20,
                                        "stok": 12,
                                        "desi": 1,
                                        "on_siparis": false,
                                        "resim": "https://d2bz7gbm1sig6o.cloudfront.net/hesap/resimler/abc.jpg",
                                        "resimler": [
                                            "https://d2bz7gbm1sig6o.cloudfront.net/hesap/resimler/abc.jpg",
                                            "https://d2bz7gbm1sig6o.cloudfront.net/hesap/resimler/abd.jpg"
                                        ],
                                        "ozellikler": [
                                            {
                                                "suzgec": "Kasa Çapı",
                                                "filtre": "45 mm"
                                            },
                                            {
                                                "suzgec": "Kordon",
                                                "filtre": "Reçine"
                                            }
                                        ],
                                        "tanitim": "<p>Karbon korumalı kasa, 200 m su geçirmezlik.</p>"
                                    },
                                    "stok": {
                                        "depo_id": "DEP01",
                                        "adet": 12
                                    },
                                    "uyarilar": [
                                        "Özellik değeri bulunamadı: Kordon / Reçine (GET /ozellikler ile değerleri görün)"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "YETKI_YOK: Ürün yazma yetkisi kapalı.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Hata"
                                }
                            }
                        }
                    },
                    "409": {
                        "description": "BARKOD_VAR: Barkod kayıtlı; `alanlar.urun_id` ile güncelleyin.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Hata"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "GECERSIZ_ALAN: isim / marka eksik, psf sayısal değil… · MARKA_YOK: `marka_ac=false` ve marka tanımsız. · KATEGORI_YOK: `kategori_ac=false` ve kategori tanımsız. · PANEL_RED: Panel kuralı reddetti (varyant değeri eksik, paket ürün sınırı…).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Hata"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "TOKEN_YOK / TOKEN_GECERSIZ",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Hata"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "HIZ_SINIRI — dakikada 600 istek",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Hata"
                                }
                            }
                        }
                    }
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "isim": {
                                        "type": "string",
                                        "description": "Ürün adı (en çok 300 karakter)."
                                    },
                                    "barkod": {
                                        "type": "string",
                                        "description": "Tekil barkod/GTIN. Boşsa `ETB-…` üretilir (ön sipariş ürününde boş kalabilir)."
                                    },
                                    "kod": {
                                        "type": "string",
                                        "description": "Stok / model kodu. Boşsa barkod. Aynı kodlu ürünler varyant ailesidir."
                                    },
                                    "marka": {
                                        "type": "string",
                                        "description": "Marka adı ya da kimliği. Yoksa ve `marka_ac` true ise açılır."
                                    },
                                    "marka_ac": {
                                        "type": "boolean",
                                        "description": "Varsayılan `true`. `false` → tanımsız marka `422 MARKA_YOK`."
                                    },
                                    "kategoriler": {
                                        "type": "array",
                                        "items": {
                                            "type": "object"
                                        },
                                        "description": "Kategori kimliği, adı ya da `\"Üst / Alt\"` yolu (en çok 5; ilki ana kategori). `kategori` tekil de kabul edilir."
                                    },
                                    "kategori_ac": {
                                        "type": "boolean",
                                        "description": "Varsayılan `true`. `false` → tanımsız kategori `422 KATEGORI_YOK`."
                                    },
                                    "psf": {
                                        "type": "number",
                                        "description": "Liste (piyasa satış) fiyatı, KDV dahil TL. Kanal fiyatları fiyat stratejisine göre bundan hesaplanır."
                                    },
                                    "sabit_satis_fiyati": {
                                        "type": "number",
                                        "description": "Verilirse tüm kanallarda bu fiyat kullanılır (strateji devre dışı)."
                                    },
                                    "kdv": {
                                        "type": "integer",
                                        "description": "0 · 1 · 10 · 20 (varsayılan 20)."
                                    },
                                    "resimler": {
                                        "type": "array",
                                        "items": {
                                            "type": "object"
                                        },
                                        "description": "Görsel adresleri (http/https, en çok 20); ilki ana görsel. İndirilemeyen adres `uyarilar`a düşer."
                                    },
                                    "tanitim": {
                                        "type": "string",
                                        "description": "Açıklama (HTML: p, br, ul, li, b, h2…)."
                                    },
                                    "ozellikler": {
                                        "type": "array",
                                        "items": {
                                            "type": "object"
                                        },
                                        "description": "Özellik grubu adı/kimliği ve değer adı/kimliği (en çok 100)."
                                    },
                                    "desi": {
                                        "type": "integer",
                                        "description": "Kargo desisi."
                                    },
                                    "stok": {
                                        "type": "integer",
                                        "description": "İlk stok (kendi deponuza)."
                                    },
                                    "on_siparis": {
                                        "type": "boolean",
                                        "description": "Ön sipariş ürünü (web sitesinde \"Yakında stokta\")."
                                    },
                                    "varyant_secim": {
                                        "type": "object",
                                        "description": "Varyant değerleri (Renk, Beden…); kategori varyant grubu tanımlıysa aynı kodlu ikinci üründe zorunlu."
                                    },
                                    "entegrasyon_no": {
                                        "type": "string",
                                        "description": "Kendi sisteminizdeki kayıt numarası (serbest metin)."
                                    }
                                },
                                "required": [
                                    "isim",
                                    "marka"
                                ]
                            },
                            "example": {
                                "isim": "Casio G-Shock GA-2100-1A1ER Erkek Kol Saati",
                                "barkod": "4549526241383",
                                "kod": "GA-2100-1A1ER",
                                "marka": "Casio",
                                "kategoriler": [
                                    "Saat / Erkek Kol Saati"
                                ],
                                "psf": 4299,
                                "kdv": 20,
                                "desi": 1,
                                "resimler": [
                                    "https://ornek.com/r/ga2100-1.jpg",
                                    "https://ornek.com/r/ga2100-2.jpg"
                                ],
                                "tanitim": "<p>Karbon korumalı kasa, 200 m su geçirmezlik.</p>",
                                "ozellikler": [
                                    {
                                        "suzgec": "Kasa Çapı",
                                        "filtre": "45 mm"
                                    },
                                    {
                                        "suzgec": "Kordon",
                                        "filtre": "Reçine"
                                    }
                                ],
                                "stok": 12
                            }
                        }
                    }
                }
            }
        },
        "/urunler/{id}": {
            "get": {
                "operationId": "urunler-tek",
                "tags": [
                    "Ürünler"
                ],
                "summary": "Tek ürün",
                "description": "Kimliği verilen ürünün tüm alanları (`?tanitim=1` ile açıklama HTML'i).\n\n\n\n**Yetki:** Okuma — Her token kullanabilir.",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Ürün kimliği (`/urunler` listesindeki `id`)."
                    },
                    {
                        "name": "tanitim",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "integer",
                            "default": 0
                        },
                        "description": "`1` → açıklama HTML'i eklenir."
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Başarılı",
                        "content": {
                            "application/json": {
                                "example": {
                                    "veri": {
                                        "id": "URN001",
                                        "isim": "Casio G-Shock GA-2100-1A1ER Erkek Kol Saati",
                                        "barkod": "4549526241383",
                                        "kod": "GA-2100-1A1ER",
                                        "kategori": {
                                            "_id": "KAT12",
                                            "isim": "Saat / Erkek Kol Saati"
                                        },
                                        "marka": {
                                            "_id": "MRK01",
                                            "isim": "Casio"
                                        },
                                        "psf": 4299,
                                        "alis": 3009.3,
                                        "kdv_deger": 20,
                                        "stok": 12,
                                        "desi": 1,
                                        "on_siparis": false,
                                        "resim": "https://d2bz7gbm1sig6o.cloudfront.net/hesap/resimler/abc.jpg",
                                        "resimler": [
                                            "https://d2bz7gbm1sig6o.cloudfront.net/hesap/resimler/abc.jpg",
                                            "https://d2bz7gbm1sig6o.cloudfront.net/hesap/resimler/abd.jpg"
                                        ],
                                        "ozellikler": [
                                            {
                                                "suzgec": "Kasa Çapı",
                                                "filtre": "45 mm"
                                            },
                                            {
                                                "suzgec": "Kordon",
                                                "filtre": "Reçine"
                                            }
                                        ],
                                        "tanitim": "<p>Karbon korumalı kasa…</p>"
                                    }
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "URUN_YOK: Ürün yok ya da hesaba kapalı.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Hata"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "TOKEN_YOK / TOKEN_GECERSIZ",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Hata"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "HIZ_SINIRI — dakikada 600 istek",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Hata"
                                }
                            }
                        }
                    }
                }
            },
            "put": {
                "operationId": "urunler-guncelle",
                "tags": [
                    "Ürünler"
                ],
                "summary": "Ürün güncelle (kısmi)",
                "description": "Yalnız gönderdiğiniz alanlar değişir; gönderilmeyen alanlara dokunulmaz. Panelin Genel sekmesiyle aynı kurallar.\n\nAlanlar `POST /urunler` ile aynıdır; ek olarak `is_pasif` ile ürün pasife alınır / geri açılır. `resimler` varsayılan olarak **ekler**; `resimler_degistir: true` listeyi verilenle değiştirir (olmayanlar silinir).\n\nFiyat değişimi kanal fiyatlarını stratejiye göre yeniden hesaplatır; marka/kategori değişimi e-ticaret sitesi eşleşmelerini güncelleme kuyruğuna alır (panelle aynı).\n\n**Yetki:** Ürün yazma — API Hesapları › Genel › Yazma yetkileri › Ürün yazma işaretli olmalı.",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Ürün kimliği (`/urunler` listesindeki `id`)."
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Başarılı",
                        "content": {
                            "application/json": {
                                "example": {
                                    "veri": {
                                        "id": "URN001",
                                        "isim": "Casio G-Shock GA-2100-1A1ER Erkek Kol Saati",
                                        "barkod": "4549526241383",
                                        "kod": "GA-2100-1A1ER",
                                        "kategori": {
                                            "_id": "KAT12",
                                            "isim": "Saat / Erkek Kol Saati"
                                        },
                                        "marka": {
                                            "_id": "MRK01",
                                            "isim": "Casio"
                                        },
                                        "psf": 4299,
                                        "alis": 3009.3,
                                        "kdv_deger": 20,
                                        "stok": 12,
                                        "desi": 1,
                                        "on_siparis": false,
                                        "resim": "https://d2bz7gbm1sig6o.cloudfront.net/hesap/resimler/abc.jpg",
                                        "resimler": [
                                            "https://d2bz7gbm1sig6o.cloudfront.net/hesap/resimler/abc.jpg",
                                            "https://d2bz7gbm1sig6o.cloudfront.net/hesap/resimler/abd.jpg"
                                        ],
                                        "ozellikler": [
                                            {
                                                "suzgec": "Kasa Çapı",
                                                "filtre": "45 mm"
                                            },
                                            {
                                                "suzgec": "Kordon",
                                                "filtre": "Reçine"
                                            }
                                        ]
                                    },
                                    "stok": {
                                        "depo_id": "DEP01",
                                        "adet": 20
                                    }
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "URUN_YOK: Ürün yok ya da kapsam dışı.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Hata"
                                }
                            }
                        }
                    },
                    "409": {
                        "description": "BARKOD_VAR: Yeni barkod başka üründe. · YONLENDIRILMIS: Ürün başka ürüne birleştirilmiş; ana ürünü güncelleyin.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Hata"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "PANEL_RED: Panel kuralı reddetti.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Hata"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "TOKEN_YOK / TOKEN_GECERSIZ",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Hata"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "HIZ_SINIRI — dakikada 600 istek",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Hata"
                                }
                            }
                        }
                    }
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "isim": {
                                        "type": "string",
                                        "description": "`POST /urunler` ile aynı anlam; yalnız gönderilenler değişir."
                                    },
                                    "barkod": {
                                        "type": "string",
                                        "description": "`POST /urunler` ile aynı anlam; yalnız gönderilenler değişir."
                                    },
                                    "kod": {
                                        "type": "string",
                                        "description": "`POST /urunler` ile aynı anlam; yalnız gönderilenler değişir."
                                    },
                                    "marka": {
                                        "type": "string",
                                        "description": "`POST /urunler` ile aynı anlam; yalnız gönderilenler değişir."
                                    },
                                    "kategoriler": {
                                        "type": "string",
                                        "description": "`POST /urunler` ile aynı anlam; yalnız gönderilenler değişir."
                                    },
                                    "psf": {
                                        "type": "string",
                                        "description": "`POST /urunler` ile aynı anlam; yalnız gönderilenler değişir."
                                    },
                                    "sabit_satis_fiyati": {
                                        "type": "string",
                                        "description": "`POST /urunler` ile aynı anlam; yalnız gönderilenler değişir."
                                    },
                                    "kdv": {
                                        "type": "string",
                                        "description": "`POST /urunler` ile aynı anlam; yalnız gönderilenler değişir."
                                    },
                                    "tanitim": {
                                        "type": "string",
                                        "description": "`POST /urunler` ile aynı anlam; yalnız gönderilenler değişir."
                                    },
                                    "ozellikler": {
                                        "type": "string",
                                        "description": "`POST /urunler` ile aynı anlam; yalnız gönderilenler değişir."
                                    },
                                    "desi": {
                                        "type": "string",
                                        "description": "`POST /urunler` ile aynı anlam; yalnız gönderilenler değişir."
                                    },
                                    "on_siparis": {
                                        "type": "string",
                                        "description": "`POST /urunler` ile aynı anlam; yalnız gönderilenler değişir."
                                    },
                                    "entegrasyon_no": {
                                        "type": "string",
                                        "description": "`POST /urunler` ile aynı anlam; yalnız gönderilenler değişir."
                                    },
                                    "is_pasif": {
                                        "type": "boolean",
                                        "description": "`true` pasife alır (kanallara stok 0 gider), `false` geri açar."
                                    },
                                    "resimler": {
                                        "type": "array",
                                        "items": {
                                            "type": "object"
                                        },
                                        "description": "Eklenecek görsel adresleri; mevcutlar kalır."
                                    },
                                    "resimler_degistir": {
                                        "type": "boolean",
                                        "description": "`true` → `resimler` listesi mevcut listenin YERİNE geçer."
                                    },
                                    "stok": {
                                        "type": "integer",
                                        "description": "Kendi deponuzdaki hedef adet."
                                    }
                                }
                            },
                            "example": {
                                "psf": 4499,
                                "tanitim": "<p>Yeni sezon.</p>",
                                "stok": 20
                            }
                        }
                    }
                }
            },
            "delete": {
                "operationId": "urunler-pasif",
                "tags": [
                    "Ürünler"
                ],
                "summary": "Ürünü pasife al",
                "description": "Ürün silinmez, pasife alınır: listelerden düşer, kanallara stok 0 gider. `PUT {\"is_pasif\": false}` geri açar.\n\n\n\n**Yetki:** Ürün yazma — API Hesapları › Genel › Yazma yetkileri › Ürün yazma işaretli olmalı.",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Ürün kimliği (`/urunler` listesindeki `id`)."
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Başarılı",
                        "content": {
                            "application/json": {
                                "example": {
                                    "veri": {
                                        "id": "URN001",
                                        "is_pasif": true,
                                        "not": "Ürün pasife alındı (kanallara stok 0 gider). Geri açmak için PUT /urunler/{id} {\"is_pasif\": false}."
                                    }
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "URUN_YOK: Ürün yok.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Hata"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "TOKEN_YOK / TOKEN_GECERSIZ",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Hata"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "HIZ_SINIRI — dakikada 600 istek",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Hata"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/urunler/{id}/resimler": {
            "post": {
                "operationId": "urunler-resim",
                "tags": [
                    "Ürünler"
                ],
                "summary": "Görsel ekle / listeyi değiştir",
                "description": "`POST` adresleri mevcut görsellere ekler; `PUT` listeyi verilenle değiştirir. Görseller o anda indirilir.\n\nAynı adres ikinci kez eklenmez. `PUT` ile gönderilmeyen görseller üründen çıkar; ana görsel listedeki ilk indirilmiş görsel olur.\n\n**Yetki:** Ürün yazma — API Hesapları › Genel › Yazma yetkileri › Ürün yazma işaretli olmalı.",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Ürün kimliği (`/urunler` listesindeki `id`)."
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Başarılı",
                        "content": {
                            "application/json": {
                                "example": {
                                    "veri": {
                                        "id": "URN001",
                                        "isim": "Casio G-Shock GA-2100-1A1ER Erkek Kol Saati",
                                        "barkod": "4549526241383",
                                        "kod": "GA-2100-1A1ER",
                                        "kategori": {
                                            "_id": "KAT12",
                                            "isim": "Saat / Erkek Kol Saati"
                                        },
                                        "marka": {
                                            "_id": "MRK01",
                                            "isim": "Casio"
                                        },
                                        "psf": 4299,
                                        "alis": 3009.3,
                                        "kdv_deger": 20,
                                        "stok": 12,
                                        "desi": 1,
                                        "on_siparis": false,
                                        "resim": "https://d2bz7gbm1sig6o.cloudfront.net/hesap/resimler/abc.jpg",
                                        "resimler": [
                                            "https://d2bz7gbm1sig6o.cloudfront.net/hesap/resimler/abc.jpg",
                                            "https://d2bz7gbm1sig6o.cloudfront.net/hesap/resimler/abd.jpg"
                                        ],
                                        "ozellikler": [
                                            {
                                                "suzgec": "Kasa Çapı",
                                                "filtre": "45 mm"
                                            },
                                            {
                                                "suzgec": "Kordon",
                                                "filtre": "Reçine"
                                            }
                                        ]
                                    },
                                    "indirilen": 1
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "URUN_YOK: Ürün yok.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Hata"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "GECERSIZ_ALAN: Adres listesi boş.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Hata"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "TOKEN_YOK / TOKEN_GECERSIZ",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Hata"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "HIZ_SINIRI — dakikada 600 istek",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Hata"
                                }
                            }
                        }
                    }
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "resimler": {
                                        "type": "array",
                                        "items": {
                                            "type": "object"
                                        },
                                        "description": "http/https görsel adresleri (en çok 20)."
                                    }
                                },
                                "required": [
                                    "resimler"
                                ]
                            },
                            "example": {
                                "resimler": [
                                    "https://ornek.com/r/ga2100-3.jpg"
                                ]
                            }
                        }
                    }
                }
            },
            "put": {
                "operationId": "urunler-resim-put",
                "tags": [
                    "Ürünler"
                ],
                "summary": "Görsel ekle / listeyi değiştir",
                "description": "`POST` adresleri mevcut görsellere ekler; `PUT` listeyi verilenle değiştirir. Görseller o anda indirilir.\n\nAynı adres ikinci kez eklenmez. `PUT` ile gönderilmeyen görseller üründen çıkar; ana görsel listedeki ilk indirilmiş görsel olur.\n\n**Yetki:** Ürün yazma — API Hesapları › Genel › Yazma yetkileri › Ürün yazma işaretli olmalı.",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Ürün kimliği (`/urunler` listesindeki `id`)."
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Başarılı",
                        "content": {
                            "application/json": {
                                "example": {
                                    "veri": {
                                        "id": "URN001",
                                        "isim": "Casio G-Shock GA-2100-1A1ER Erkek Kol Saati",
                                        "barkod": "4549526241383",
                                        "kod": "GA-2100-1A1ER",
                                        "kategori": {
                                            "_id": "KAT12",
                                            "isim": "Saat / Erkek Kol Saati"
                                        },
                                        "marka": {
                                            "_id": "MRK01",
                                            "isim": "Casio"
                                        },
                                        "psf": 4299,
                                        "alis": 3009.3,
                                        "kdv_deger": 20,
                                        "stok": 12,
                                        "desi": 1,
                                        "on_siparis": false,
                                        "resim": "https://d2bz7gbm1sig6o.cloudfront.net/hesap/resimler/abc.jpg",
                                        "resimler": [
                                            "https://d2bz7gbm1sig6o.cloudfront.net/hesap/resimler/abc.jpg",
                                            "https://d2bz7gbm1sig6o.cloudfront.net/hesap/resimler/abd.jpg"
                                        ],
                                        "ozellikler": [
                                            {
                                                "suzgec": "Kasa Çapı",
                                                "filtre": "45 mm"
                                            },
                                            {
                                                "suzgec": "Kordon",
                                                "filtre": "Reçine"
                                            }
                                        ]
                                    },
                                    "indirilen": 1
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "URUN_YOK: Ürün yok.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Hata"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "GECERSIZ_ALAN: Adres listesi boş.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Hata"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "TOKEN_YOK / TOKEN_GECERSIZ",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Hata"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "HIZ_SINIRI — dakikada 600 istek",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Hata"
                                }
                            }
                        }
                    }
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "resimler": {
                                        "type": "array",
                                        "items": {
                                            "type": "object"
                                        },
                                        "description": "http/https görsel adresleri (en çok 20)."
                                    }
                                },
                                "required": [
                                    "resimler"
                                ]
                            },
                            "example": {
                                "resimler": [
                                    "https://ornek.com/r/ga2100-3.jpg"
                                ]
                            }
                        }
                    }
                }
            }
        },
        "/stoklar": {
            "get": {
                "operationId": "stoklar",
                "tags": [
                    "Stok & Fiyat"
                ],
                "summary": "Hafif stok / fiyat listesi",
                "description": "Yalnız `id, barkod, stok, psf, alis` — sayfa başına 5000. Dakikalık eşitleme bu uçla yapılır.\n\nÜrün listesiyle aynı kapsam ve stok kuralı; görsel/özellik taşımadığı için 10 kat hızlıdır. `ids` ya da `barkod` ile belirli ürünler sorgulanır (webhook `urun.degisti` yükündeki kimliklerle).\n\n**Yetki:** Okuma — Her token kullanabilir.",
                "parameters": [
                    {
                        "name": "size",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "integer",
                            "default": 5000
                        },
                        "description": "Sayfa boyu (en çok 5000)."
                    },
                    {
                        "name": "imlec",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Önceki yanıttaki `sonraki_imlec`; `null` gelince liste bitmiştir."
                    },
                    {
                        "name": "ids",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Virgülle ürün kimlikleri (en çok 1000)."
                    },
                    {
                        "name": "barkod",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Virgülle barkodlar (en çok 1000)."
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Başarılı",
                        "content": {
                            "application/json": {
                                "example": {
                                    "veri": [
                                        {
                                            "id": "URN001",
                                            "barkod": "4549526241383",
                                            "stok": 12,
                                            "psf": 4299,
                                            "alis": 3009.3
                                        }
                                    ],
                                    "sonraki_imlec": null,
                                    "toplam": 1
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "TOKEN_YOK / TOKEN_GECERSIZ",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Hata"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "HIZ_SINIRI — dakikada 600 istek",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Hata"
                                }
                            }
                        }
                    }
                }
            },
            "post": {
                "operationId": "toplu-stok",
                "tags": [
                    "Stok & Fiyat"
                ],
                "summary": "Toplu stok yaz",
                "description": "Bir istekte en çok 500 ürünün stoğunu hedef adede getirir; ürün kimlik ya da barkodla tanınır.\n\nHer satır bağımsız işlenir; yanıttaki `sonuclar` satır satır sonucu verir. Bir satır başarısızsa ötekiler yine yazılır (`ok: false` olan satırları düzeltip yeniden gönderin).\n\n**Yetki:** Ürün yazma — API Hesapları › Genel › Yazma yetkileri › Ürün yazma işaretli olmalı.",
                "parameters": [],
                "responses": {
                    "200": {
                        "description": "Başarılı",
                        "content": {
                            "application/json": {
                                "example": {
                                    "ok": true,
                                    "islenen": 2,
                                    "toplam": 2,
                                    "sonuclar": [
                                        {
                                            "id": "URN001",
                                            "barkod": "4549526241383",
                                            "ok": true,
                                            "onceki": 7,
                                            "adet": 10,
                                            "depo_id": "DEP01"
                                        },
                                        {
                                            "id": "URN002",
                                            "barkod": "8690000000002",
                                            "ok": true,
                                            "onceki": 3,
                                            "adet": 0,
                                            "depo_id": "DEP01"
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "GECERSIZ_ALAN: Liste boş ya da 500'den uzun.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Hata"
                                }
                            }
                        }
                    },
                    "409": {
                        "description": "DEPO_YOK: Kendi deposu yok (işlem durur).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Hata"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "TOKEN_YOK / TOKEN_GECERSIZ",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Hata"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "HIZ_SINIRI — dakikada 600 istek",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Hata"
                                }
                            }
                        }
                    }
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "stoklar": {
                                        "type": "array",
                                        "items": {
                                            "type": "object"
                                        },
                                        "description": "En çok 500 satır."
                                    }
                                },
                                "required": [
                                    "stoklar"
                                ]
                            },
                            "example": {
                                "stoklar": [
                                    {
                                        "barkod": "4549526241383",
                                        "adet": 10
                                    },
                                    {
                                        "id": "URN002",
                                        "adet": 0
                                    }
                                ]
                            }
                        }
                    }
                }
            }
        },
        "/urunler/{id}/stok": {
            "put": {
                "operationId": "urun-stok",
                "tags": [
                    "Stok & Fiyat"
                ],
                "summary": "Stok yaz (hedef adet)",
                "description": "Kendi deponuzdaki stoğu verilen adede getirir. Fark kadar giriş/çıkış hareketi yazılır; ürün ve satış kanalları saniyeler içinde güncellenir.\n\nAdet **mutlak** değerdir (artış/azalış değil): depoda 7 varken `adet: 10` gönderirseniz 3 giriş yazılır. Depo belirtilmezse varsayılan (yoksa ilk) kendi deponuz kullanılır; `GET /depolar` hangi depoların API ile yazılabildiğini söyler.\n\nStok Hareketleri ekranında \"API ile stok güncellendi\" açıklamasıyla görünür. Stoğu bir ERP/tedarikçi dosyasından gelen depolara API ile yazılamaz (`409 DEPO_YOK`).\n\n**Yetki:** Ürün yazma — API Hesapları › Genel › Yazma yetkileri › Ürün yazma işaretli olmalı.",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Ürün kimliği (`/urunler` listesindeki `id`)."
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Başarılı",
                        "content": {
                            "application/json": {
                                "example": {
                                    "veri": {
                                        "id": "URN001",
                                        "depo_id": "DEP01",
                                        "depo": "Merkez Depo",
                                        "onceki": 7,
                                        "adet": 10,
                                        "degisti": true
                                    }
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "URUN_YOK: Ürün yok.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Hata"
                                }
                            }
                        }
                    },
                    "409": {
                        "description": "DEPO_YOK: Kendi deposu yok / depo_id yanlış. · RAF_YOK: Depoda raf yok. · SET_URUN: Set ürünün stoğu içindekilerden hesaplanır.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Hata"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "TOKEN_YOK / TOKEN_GECERSIZ",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Hata"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "HIZ_SINIRI — dakikada 600 istek",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Hata"
                                }
                            }
                        }
                    }
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "adet": {
                                        "type": "integer",
                                        "description": "Depodaki hedef adet (≥ 0)."
                                    },
                                    "depo_id": {
                                        "type": "string",
                                        "description": "Kendi deponuzun kimliği (`GET /depolar`)."
                                    }
                                },
                                "required": [
                                    "adet"
                                ]
                            },
                            "example": {
                                "adet": 10
                            }
                        }
                    }
                }
            }
        },
        "/urunler/{id}/fiyat": {
            "put": {
                "operationId": "urun-fiyat",
                "tags": [
                    "Stok & Fiyat"
                ],
                "summary": "Fiyat yaz",
                "description": "Liste fiyatını (`psf`) ve isteğe bağlı sabit satış fiyatını yazar; Fiyat Geçmişi'ne \"api\" kaynağıyla düşer.\n\nKanal satış fiyatları fiyat stratejisine göre dakikalar içinde yeniden hesaplanır ve pazaryerlerine gönderilir. `sabit_satis_fiyati: 0` sabit fiyatı kaldırır.\n\n**Yetki:** Ürün yazma — API Hesapları › Genel › Yazma yetkileri › Ürün yazma işaretli olmalı.",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Ürün kimliği (`/urunler` listesindeki `id`)."
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Başarılı",
                        "content": {
                            "application/json": {
                                "example": {
                                    "veri": {
                                        "id": "URN001",
                                        "psf": 4499,
                                        "onceki_psf": 4299,
                                        "degisti": true,
                                        "not": "Kanal satış fiyatları fiyat stratejisine göre dakikalar içinde yeniden hesaplanır."
                                    }
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "URUN_YOK: Ürün yok.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Hata"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "FIYAT_YAZILAMADI: Fiyat 0 ya da ürün yönlendirilmiş.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Hata"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "TOKEN_YOK / TOKEN_GECERSIZ",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Hata"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "HIZ_SINIRI — dakikada 600 istek",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Hata"
                                }
                            }
                        }
                    }
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "psf": {
                                        "type": "number",
                                        "description": "Liste fiyatı (KDV dahil TL, > 0)."
                                    },
                                    "sabit_satis_fiyati": {
                                        "type": "number",
                                        "description": "Tüm kanallara sabit fiyat; `0` kaldırır."
                                    }
                                }
                            },
                            "example": {
                                "psf": 4499
                            }
                        }
                    }
                }
            }
        },
        "/fiyatlar": {
            "post": {
                "operationId": "toplu-fiyat",
                "tags": [
                    "Stok & Fiyat"
                ],
                "summary": "Toplu fiyat yaz",
                "description": "Bir istekte en çok 500 ürünün liste fiyatı; kimlik ya da barkodla.\n\n\n\n**Yetki:** Ürün yazma — API Hesapları › Genel › Yazma yetkileri › Ürün yazma işaretli olmalı.",
                "parameters": [],
                "responses": {
                    "200": {
                        "description": "Başarılı",
                        "content": {
                            "application/json": {
                                "example": {
                                    "ok": true,
                                    "islenen": 2,
                                    "toplam": 2,
                                    "sonuclar": [
                                        {
                                            "id": "URN001",
                                            "barkod": "4549526241383",
                                            "ok": true,
                                            "onceki_psf": 4299,
                                            "psf": 4499,
                                            "degisti": true
                                        },
                                        {
                                            "id": "URN002",
                                            "barkod": "8690000000002",
                                            "ok": true,
                                            "onceki_psf": 1299.9,
                                            "psf": 1299.9,
                                            "degisti": false
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "GECERSIZ_ALAN: Liste boş ya da 500'den uzun.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Hata"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "TOKEN_YOK / TOKEN_GECERSIZ",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Hata"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "HIZ_SINIRI — dakikada 600 istek",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Hata"
                                }
                            }
                        }
                    }
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "fiyatlar": {
                                        "type": "array",
                                        "items": {
                                            "type": "object"
                                        },
                                        "description": "En çok 500 satır."
                                    }
                                },
                                "required": [
                                    "fiyatlar"
                                ]
                            },
                            "example": {
                                "fiyatlar": [
                                    {
                                        "barkod": "4549526241383",
                                        "psf": 4499
                                    },
                                    {
                                        "id": "URN002",
                                        "psf": 1299.9
                                    }
                                ]
                            }
                        }
                    }
                }
            }
        },
        "/kategoriler": {
            "get": {
                "operationId": "kategoriler",
                "tags": [
                    "Kategori · Marka · Özellik"
                ],
                "summary": "Kategoriler",
                "description": "Kategori ağacı: `ust_id` ile üst kategori, `yol` ile tam yol (\"Saat / Erkek Kol Saati\").\n\n\n\n**Yetki:** Okuma — Her token kullanabilir.",
                "parameters": [
                    {
                        "name": "size",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "integer",
                            "default": 1000
                        },
                        "description": "Sayfa boyu (en çok 1000)."
                    },
                    {
                        "name": "imlec",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Önceki yanıttaki `sonraki_imlec`; `null` gelince liste bitmiştir."
                    },
                    {
                        "name": "ara",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Ad ya da yolda kelime araması."
                    },
                    {
                        "name": "ust_id",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Yalnız bu kategorinin altındakiler (`\"\"` → kök kategoriler)."
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Başarılı",
                        "content": {
                            "application/json": {
                                "example": {
                                    "veri": [
                                        {
                                            "id": "KAT01",
                                            "isim": "Saat",
                                            "ust_id": "",
                                            "yol": "Saat"
                                        },
                                        {
                                            "id": "KAT12",
                                            "isim": "Erkek Kol Saati",
                                            "ust_id": "KAT01",
                                            "yol": "Saat / Erkek Kol Saati"
                                        }
                                    ],
                                    "sonraki_imlec": null,
                                    "toplam": 2
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "TOKEN_YOK / TOKEN_GECERSIZ",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Hata"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "HIZ_SINIRI — dakikada 600 istek",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Hata"
                                }
                            }
                        }
                    }
                }
            },
            "post": {
                "operationId": "kategori-ekle",
                "tags": [
                    "Kategori · Marka · Özellik"
                ],
                "summary": "Kategori aç",
                "description": "Verilen üstün altında kategori açar; aynı ad zaten varsa var olanı döner (`yeni: false`). `yol` ile zincir açılır.\n\nPanelin Kategori Ekle ucuyla aynı: yol metni, adres (slug) ve pazaryeri kategori eşlemesi (ada göre) kendiliğinden kurulur.\n\n**Yetki:** Ürün yazma — API Hesapları › Genel › Yazma yetkileri › Ürün yazma işaretli olmalı.",
                "parameters": [],
                "responses": {
                    "201": {
                        "description": "Başarılı",
                        "content": {
                            "application/json": {
                                "example": {
                                    "veri": {
                                        "id": "KAT12",
                                        "isim": "Erkek Kol Saati",
                                        "ust_id": "KAT01",
                                        "yol": "Saat / Erkek Kol Saati"
                                    },
                                    "yeni": true
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "GECERSIZ_ALAN: isim boş. · KATEGORI_YOK: ust_id bulunamadı.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Hata"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "TOKEN_YOK / TOKEN_GECERSIZ",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Hata"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "HIZ_SINIRI — dakikada 600 istek",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Hata"
                                }
                            }
                        }
                    }
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "isim": {
                                        "type": "string",
                                        "description": "Kategori adı (ya da `yol` verin)."
                                    },
                                    "ust_id": {
                                        "type": "string",
                                        "description": "Üst kategori kimliği; boş → kök."
                                    },
                                    "yol": {
                                        "type": "string",
                                        "description": "`\"Saat / Erkek Kol Saati\"` — her düzey yoksa açılır."
                                    }
                                },
                                "required": [
                                    "isim"
                                ]
                            },
                            "example": {
                                "isim": "Erkek Kol Saati",
                                "ust_id": "KAT01"
                            }
                        }
                    }
                }
            }
        },
        "/markalar": {
            "get": {
                "operationId": "markalar",
                "tags": [
                    "Kategori · Marka · Özellik"
                ],
                "summary": "Markalar",
                "description": "API hesabına açık markalar (marka kısıtı varsa yalnız onlar).\n\n\n\n**Yetki:** Okuma — Her token kullanabilir.",
                "parameters": [
                    {
                        "name": "size",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "integer",
                            "default": 1000
                        },
                        "description": "Sayfa boyu (en çok 1000)."
                    },
                    {
                        "name": "imlec",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Önceki yanıttaki `sonraki_imlec`; `null` gelince liste bitmiştir."
                    },
                    {
                        "name": "ara",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Adda kelime araması."
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Başarılı",
                        "content": {
                            "application/json": {
                                "example": {
                                    "veri": [
                                        {
                                            "id": "MRK01",
                                            "isim": "Casio"
                                        }
                                    ],
                                    "sonraki_imlec": null,
                                    "toplam": 1
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "TOKEN_YOK / TOKEN_GECERSIZ",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Hata"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "HIZ_SINIRI — dakikada 600 istek",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Hata"
                                }
                            }
                        }
                    }
                }
            },
            "post": {
                "operationId": "marka-ekle",
                "tags": [
                    "Kategori · Marka · Özellik"
                ],
                "summary": "Marka aç",
                "description": "Marka açar; aynı ad (büyük/küçük, Türkçe harf farkı gözetilmez) varsa var olanı döner.\n\n\n\n**Yetki:** Ürün yazma — API Hesapları › Genel › Yazma yetkileri › Ürün yazma işaretli olmalı.",
                "parameters": [],
                "responses": {
                    "201": {
                        "description": "Başarılı",
                        "content": {
                            "application/json": {
                                "example": {
                                    "veri": {
                                        "id": "MRK01",
                                        "isim": "Casio"
                                    },
                                    "yeni": false
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "GECERSIZ_ALAN: isim boş.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Hata"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "TOKEN_YOK / TOKEN_GECERSIZ",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Hata"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "HIZ_SINIRI — dakikada 600 istek",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Hata"
                                }
                            }
                        }
                    }
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "isim": {
                                        "type": "string",
                                        "description": "Marka adı."
                                    }
                                },
                                "required": [
                                    "isim"
                                ]
                            },
                            "example": {
                                "isim": "Casio"
                            }
                        }
                    }
                }
            }
        },
        "/ozellikler": {
            "get": {
                "operationId": "ozellikler",
                "tags": [
                    "Kategori · Marka · Özellik"
                ],
                "summary": "Özellik grupları ve değerleri",
                "description": "Hesabın özellik sözlüğü: grup (süzgeç) → değerler (filtre). Ürün eklerken `ozellikler` buradaki adlarla eşlenir.\n\n\n\n**Yetki:** Okuma — Her token kullanabilir.",
                "parameters": [],
                "responses": {
                    "200": {
                        "description": "Başarılı",
                        "content": {
                            "application/json": {
                                "example": {
                                    "veri": [
                                        {
                                            "id": "SZG01",
                                            "isim": "Kasa Çapı",
                                            "filtreler": [
                                                {
                                                    "id": "FLT01",
                                                    "isim": "40 mm"
                                                },
                                                {
                                                    "id": "FLT02",
                                                    "isim": "45 mm"
                                                }
                                            ]
                                        }
                                    ],
                                    "toplam": 1
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "TOKEN_YOK / TOKEN_GECERSIZ",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Hata"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "HIZ_SINIRI — dakikada 600 istek",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Hata"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/siparisler": {
            "get": {
                "operationId": "siparisler-liste",
                "tags": [
                    "Siparişler"
                ],
                "summary": "Sipariş listesi",
                "description": "Sipariş listesi; artımlı çekim için `guncellenme_gte`. Görünürlük API hesabının ayarına bağlı.\n\n**Sipariş görünürlüğü:** API hesabı \"yalnız bu hesabın açtığı siparişler\" (bayi) ise sadece sizin açtıklarınız; \"tüm siparişlerim\" (muhasebe programı / kendi yazılımınız) ise hesabın tüm kanallardaki siparişleri gelir.\n\nArtımlı eşitleme: her turda son turun başlangıç zamanını `guncellenme_gte` olarak gönderin; durumu/kargosu değişen siparişler gelir.\n\n**Yetki:** Okuma — Her token kullanabilir.",
                "parameters": [
                    {
                        "name": "size",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "integer",
                            "default": 100
                        },
                        "description": "Sayfa boyu (en çok 100)."
                    },
                    {
                        "name": "imlec",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Önceki yanıttaki `sonraki_imlec`; `null` gelince liste bitmiştir."
                    },
                    {
                        "name": "siparis_kodu",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Birebir sipariş kodu (sizin numaranız)."
                    },
                    {
                        "name": "durum",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "string"
                        },
                        "description": "`GET /durumlar` kodları: onayda, onaylandi, kargoda, teslim-edildi, iptal, iade…"
                    },
                    {
                        "name": "platform",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Satış kanalı kodu (`GET /platformlar`): ty, hb, n11, eb, api…"
                    },
                    {
                        "name": "baslangic_tarihi",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "string"
                        },
                        "description": "`yyyy-MM-dd HH:mm:ss` — sipariş tarihi ≥."
                    },
                    {
                        "name": "bitis_tarihi",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Sipariş tarihi ≤."
                    },
                    {
                        "name": "guncellenme_gte",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Bu andan sonra değişen siparişler (artımlı)."
                    },
                    {
                        "name": "ara",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Sipariş kodu / paket kodu / müşteri adı."
                    },
                    {
                        "name": "is_pasifler",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "string"
                        },
                        "description": "`true` → iptal/pasif siparişler de gelsin."
                    },
                    {
                        "name": "sort",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "default": "eklenme_tarihi"
                        },
                        "description": "eklenme_tarihi · gunceleme_tarihi · siparis_kodu"
                    },
                    {
                        "name": "order",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "default": "desc"
                        },
                        "description": "asc · desc"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Başarılı",
                        "content": {
                            "application/json": {
                                "example": {
                                    "veri": [
                                        {
                                            "id": "3f1c…",
                                            "platform": "api",
                                            "merchant_id": "b7237…",
                                            "eklenme_tarihi": "2026-10-29 10:12:44",
                                            "guncellenme_tarihi": "2026-10-29 10:12:44",
                                            "isim": "Ayşe Yılmaz",
                                            "siparis_kodu": "WEB-10234",
                                            "paket_kodu": "WEB-10234",
                                            "is_pasif": false,
                                            "kanal": "Trendyol",
                                            "not": "",
                                            "bilgiler": {
                                                "fatura_isim": "Ayşe Yılmaz",
                                                "fatura_adres": "Örnek Mah. 1. Sk. No:3",
                                                "fatura_il_isim": "İstanbul",
                                                "fatura_ilce_isim": "Kadıköy",
                                                "fatura_telefon": "5321112233",
                                                "fatura_vn": "",
                                                "fatura_vd": "",
                                                "teslimat_isim": "Ayşe Yılmaz",
                                                "teslimat_adres": "Örnek Mah. 1. Sk. No:3",
                                                "teslimat_il_isim": "İstanbul",
                                                "teslimat_ilce_isim": "Kadıköy",
                                                "teslimat_telefon": "5321112233"
                                            },
                                            "kargo": {
                                                "_id": "yurtici",
                                                "isim": "Yurtiçi Kargo",
                                                "barkod": "",
                                                "takip_no": ""
                                            },
                                            "durum": {
                                                "_id": "onayda",
                                                "isim": "Onay Bekliyor"
                                            },
                                            "odemeler": [
                                                {
                                                    "_id": "api",
                                                    "isim": "Dış Satış (Bayi Sitesi)"
                                                }
                                            ],
                                            "urunler": [
                                                {
                                                    "_id": "k1",
                                                    "urun_id": "URN001",
                                                    "urun_barkod": "4549526241383",
                                                    "urun_adi": "Casio G-Shock GA-2100-1A1ER",
                                                    "urun_fiyat": 3009.3,
                                                    "urun_adet": 1,
                                                    "urun_toplam_fiyat": 3009.3,
                                                    "kdv_deger": 20,
                                                    "resim": "https://…/abc.jpg",
                                                    "tedarikci": null,
                                                    "is_iade_sepeti": false
                                                }
                                            ],
                                            "toplam_tutar": 3009.3,
                                            "toplam_adet": 1
                                        }
                                    ],
                                    "sonraki_imlec": null
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "TOKEN_YOK / TOKEN_GECERSIZ",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Hata"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "HIZ_SINIRI — dakikada 600 istek",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Hata"
                                }
                            }
                        }
                    }
                }
            },
            "post": {
                "operationId": "siparis-ac",
                "tags": [
                    "Siparişler"
                ],
                "summary": "Sipariş aç",
                "description": "Tedarikçinin panelinde \"Onay Bekliyor\" durumunda sipariş açar; ürünler o anda rezerve edilir, stok kanallara yansır.\n\n`siparis_kodu` sizin numaranızdır ve tekildir: aynı kodla ikinci istek `409 SIPARIS_VAR` döner (ağ hatasında güvenle yeniden deneyebilirsiniz).\n\nFatura ve teslimat adresleri ayrıdır: dropship'te fatura size, teslimat müşterinize kesilir. `kargo.barkod` verilirse tedarikçi hazır etiketi (pazaryeri etiketi) basar. `kanal` siparişin satıldığı pazaryerini taşır; tedarikçinin etiketinde görünür.\n\nÜrün kimlikleri `/urunler` listesindeki `id`. Kapsam dışı ya da pasif ürün → `422 URUN_YOK`.\n\n**Yetki:** Sipariş açma — Her token kullanabilir (API hesabının kapsamındaki ürünlerle).",
                "parameters": [],
                "responses": {
                    "201": {
                        "description": "Başarılı",
                        "content": {
                            "application/json": {
                                "example": {
                                    "veri": {
                                        "id": "3f1c…",
                                        "platform": "api",
                                        "merchant_id": "b7237…",
                                        "eklenme_tarihi": "2026-10-29 10:12:44",
                                        "guncellenme_tarihi": "2026-10-29 10:12:44",
                                        "isim": "Ayşe Yılmaz",
                                        "siparis_kodu": "WEB-10234",
                                        "paket_kodu": "WEB-10234",
                                        "is_pasif": false,
                                        "kanal": "Trendyol",
                                        "not": "",
                                        "bilgiler": {
                                            "fatura_isim": "Ayşe Yılmaz",
                                            "fatura_adres": "Örnek Mah. 1. Sk. No:3",
                                            "fatura_il_isim": "İstanbul",
                                            "fatura_ilce_isim": "Kadıköy",
                                            "fatura_telefon": "5321112233",
                                            "fatura_vn": "",
                                            "fatura_vd": "",
                                            "teslimat_isim": "Ayşe Yılmaz",
                                            "teslimat_adres": "Örnek Mah. 1. Sk. No:3",
                                            "teslimat_il_isim": "İstanbul",
                                            "teslimat_ilce_isim": "Kadıköy",
                                            "teslimat_telefon": "5321112233"
                                        },
                                        "kargo": {
                                            "_id": "yurtici",
                                            "isim": "Yurtiçi Kargo",
                                            "barkod": "",
                                            "takip_no": ""
                                        },
                                        "durum": {
                                            "_id": "onayda",
                                            "isim": "Onay Bekliyor"
                                        },
                                        "odemeler": [
                                            {
                                                "_id": "api",
                                                "isim": "Dış Satış (Bayi Sitesi)"
                                            }
                                        ],
                                        "urunler": [
                                            {
                                                "_id": "k1",
                                                "urun_id": "URN001",
                                                "urun_barkod": "4549526241383",
                                                "urun_adi": "Casio G-Shock GA-2100-1A1ER",
                                                "urun_fiyat": 3009.3,
                                                "urun_adet": 1,
                                                "urun_toplam_fiyat": 3009.3,
                                                "kdv_deger": 20,
                                                "resim": "https://…/abc.jpg",
                                                "tedarikci": null,
                                                "is_iade_sepeti": false
                                            }
                                        ],
                                        "toplam_tutar": 3009.3,
                                        "toplam_adet": 1
                                    }
                                }
                            }
                        }
                    },
                    "409": {
                        "description": "SIPARIS_VAR: Aynı siparis_kodu daha önce açıldı.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Hata"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "GECERSIZ_ALAN: Zorunlu alan eksik; `alanlar` hangi alan olduğunu söyler. · URUN_YOK: Kimlik yok ya da kapsam dışı; `alanlar.urunler` listeler.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Hata"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "TOKEN_YOK / TOKEN_GECERSIZ",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Hata"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "HIZ_SINIRI — dakikada 600 istek",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Hata"
                                }
                            }
                        }
                    }
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "siparis_kodu": {
                                        "type": "string",
                                        "description": "Sizin sipariş numaranız (tekil, en çok 100)."
                                    },
                                    "isim": {
                                        "type": "string",
                                        "description": "Müşteri adı."
                                    },
                                    "mail": {
                                        "type": "string",
                                        "description": "E-posta (geçerli biçim)."
                                    },
                                    "telefon": {
                                        "type": "string",
                                        "description": "Telefon."
                                    },
                                    "kanal": {
                                        "type": "string",
                                        "description": "Satıldığı kanal (Trendyol, N11, Web Sitesi…)."
                                    },
                                    "not": {
                                        "type": "string",
                                        "description": "Sipariş notu (en çok 1000)."
                                    },
                                    "bilgiler": {
                                        "type": "object",
                                        "properties": {
                                            "fatura_isim": {
                                                "type": "string",
                                                "description": "Fatura bilgileri."
                                            },
                                            "fatura_vn": {
                                                "type": "string",
                                                "description": "Vergi no, vergi dairesi, telefon."
                                            },
                                            "teslimat_isim": {
                                                "type": "string",
                                                "description": "Teslimat bilgileri."
                                            },
                                            "teslimat_telefon": {
                                                "type": "string",
                                                "description": ""
                                            }
                                        },
                                        "required": [
                                            "fatura_isim",
                                            "teslimat_isim"
                                        ]
                                    },
                                    "fatura_adres": {
                                        "type": "string",
                                        "description": "Fatura bilgileri."
                                    },
                                    "fatura_il_isim": {
                                        "type": "string",
                                        "description": "Fatura bilgileri."
                                    },
                                    "fatura_ilce_isim": {
                                        "type": "string",
                                        "description": "Fatura bilgileri."
                                    },
                                    "fatura_vd": {
                                        "type": "string",
                                        "description": "Vergi no, vergi dairesi, telefon."
                                    },
                                    "fatura_telefon": {
                                        "type": "string",
                                        "description": "Vergi no, vergi dairesi, telefon."
                                    },
                                    "teslimat_adres": {
                                        "type": "string",
                                        "description": "Teslimat bilgileri."
                                    },
                                    "teslimat_il_isim": {
                                        "type": "string",
                                        "description": "Teslimat bilgileri."
                                    },
                                    "teslimat_ilce_isim": {
                                        "type": "string",
                                        "description": "Teslimat bilgileri."
                                    },
                                    "kargo": {
                                        "type": "object",
                                        "properties": {
                                            "_id": {
                                                "type": "string",
                                                "description": "Kargo firması (`GET /kargolar`)."
                                            },
                                            "isim": {
                                                "type": "string",
                                                "description": "Kargo firması (`GET /kargolar`)."
                                            },
                                            "barkod": {
                                                "type": "string",
                                                "description": "Hazır etiket barkodu (pazaryeri etiketi)."
                                            }
                                        },
                                        "required": [
                                            "_id",
                                            "isim"
                                        ]
                                    },
                                    "urunler": {
                                        "type": "array",
                                        "items": {
                                            "type": "object",
                                            "properties": {
                                                "_id": {
                                                    "type": "string",
                                                    "description": "Ürün kimliği, KDV dahil birim fiyat, adet (≥1)."
                                                }
                                            },
                                            "required": [
                                                "_id"
                                            ]
                                        }
                                    },
                                    "fiyat": {
                                        "type": "integer",
                                        "description": "Ürün kimliği, KDV dahil birim fiyat, adet (≥1)."
                                    },
                                    "adet": {
                                        "type": "integer",
                                        "description": "Ürün kimliği, KDV dahil birim fiyat, adet (≥1)."
                                    }
                                },
                                "required": [
                                    "siparis_kodu",
                                    "isim",
                                    "mail",
                                    "bilgiler",
                                    "fatura_adres",
                                    "fatura_il_isim",
                                    "fatura_ilce_isim",
                                    "teslimat_adres",
                                    "teslimat_il_isim",
                                    "teslimat_ilce_isim",
                                    "kargo",
                                    "urunler",
                                    "fiyat",
                                    "adet"
                                ]
                            },
                            "example": {
                                "siparis_kodu": "WEB-10234",
                                "isim": "Ayşe Yılmaz",
                                "mail": "ayse@ornek.com",
                                "telefon": "5321112233",
                                "kanal": "Trendyol",
                                "not": "Kapıda zil çalışmıyor, arayın.",
                                "bilgiler": {
                                    "fatura_isim": "Ayşe Yılmaz",
                                    "fatura_adres": "Örnek Mah. 1. Sk. No:3",
                                    "fatura_il_isim": "İstanbul",
                                    "fatura_ilce_isim": "Kadıköy",
                                    "fatura_vn": "",
                                    "fatura_vd": "",
                                    "teslimat_isim": "Ayşe Yılmaz",
                                    "teslimat_adres": "Örnek Mah. 1. Sk. No:3",
                                    "teslimat_il_isim": "İstanbul",
                                    "teslimat_ilce_isim": "Kadıköy",
                                    "teslimat_telefon": "5321112233"
                                },
                                "kargo": {
                                    "_id": "yurtici",
                                    "isim": "Yurtiçi Kargo",
                                    "barkod": ""
                                },
                                "urunler": [
                                    {
                                        "_id": "URN001",
                                        "fiyat": 3009.3,
                                        "adet": 1
                                    }
                                ]
                            }
                        }
                    }
                }
            }
        },
        "/siparisler/{id}": {
            "get": {
                "operationId": "siparis-tek",
                "tags": [
                    "Siparişler"
                ],
                "summary": "Tek sipariş",
                "description": "Sipariş ayrıntısı (kalemler, adresler, kargo, durum).\n\n\n\n**Yetki:** Okuma — Her token kullanabilir.",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Sipariş kimliği (listedeki `id`; POST yanıtındaki `veri.id`)."
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Başarılı",
                        "content": {
                            "application/json": {
                                "example": {
                                    "veri": {
                                        "id": "3f1c…",
                                        "platform": "api",
                                        "merchant_id": "b7237…",
                                        "eklenme_tarihi": "2026-10-29 10:12:44",
                                        "guncellenme_tarihi": "2026-10-29 10:12:44",
                                        "isim": "Ayşe Yılmaz",
                                        "siparis_kodu": "WEB-10234",
                                        "paket_kodu": "WEB-10234",
                                        "is_pasif": false,
                                        "kanal": "Trendyol",
                                        "not": "",
                                        "bilgiler": {
                                            "fatura_isim": "Ayşe Yılmaz",
                                            "fatura_adres": "Örnek Mah. 1. Sk. No:3",
                                            "fatura_il_isim": "İstanbul",
                                            "fatura_ilce_isim": "Kadıköy",
                                            "fatura_telefon": "5321112233",
                                            "fatura_vn": "",
                                            "fatura_vd": "",
                                            "teslimat_isim": "Ayşe Yılmaz",
                                            "teslimat_adres": "Örnek Mah. 1. Sk. No:3",
                                            "teslimat_il_isim": "İstanbul",
                                            "teslimat_ilce_isim": "Kadıköy",
                                            "teslimat_telefon": "5321112233"
                                        },
                                        "kargo": {
                                            "_id": "yurtici",
                                            "isim": "Yurtiçi Kargo",
                                            "barkod": "",
                                            "takip_no": ""
                                        },
                                        "durum": {
                                            "_id": "onayda",
                                            "isim": "Onay Bekliyor"
                                        },
                                        "odemeler": [
                                            {
                                                "_id": "api",
                                                "isim": "Dış Satış (Bayi Sitesi)"
                                            }
                                        ],
                                        "urunler": [
                                            {
                                                "_id": "k1",
                                                "urun_id": "URN001",
                                                "urun_barkod": "4549526241383",
                                                "urun_adi": "Casio G-Shock GA-2100-1A1ER",
                                                "urun_fiyat": 3009.3,
                                                "urun_adet": 1,
                                                "urun_toplam_fiyat": 3009.3,
                                                "kdv_deger": 20,
                                                "resim": "https://…/abc.jpg",
                                                "tedarikci": null,
                                                "is_iade_sepeti": false
                                            }
                                        ],
                                        "toplam_tutar": 3009.3,
                                        "toplam_adet": 1
                                    }
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "SIPARIS_YOK: Yok ya da kapsam dışı.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Hata"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "TOKEN_YOK / TOKEN_GECERSIZ",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Hata"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "HIZ_SINIRI — dakikada 600 istek",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Hata"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/siparisler/{id}/iptal": {
            "post": {
                "operationId": "siparis-iptal",
                "tags": [
                    "Siparişler"
                ],
                "summary": "Siparişi iptal et",
                "description": "API ile açılmış, henüz kargoya verilmemiş siparişi iptal eder (pasife alır); rezerve stok geri döner.\n\nKargolanmış sipariş iptal edilemez (`409 KARGOLANDI`); tedarikçiyle görüşün. \"Tüm siparişler\" görünürlüğündeki token yalnız API kanalındaki siparişleri iptal edebilir; öteki kanallar için `POST …/durum {\"durum\": \"iptal\"}` (sipariş yönetimi yetkisi).\n\n**Yetki:** Sipariş açma — Her token kullanabilir (API hesabının kapsamındaki ürünlerle).",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Sipariş kimliği."
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Başarılı",
                        "content": {
                            "application/json": {
                                "example": {
                                    "veri": {
                                        "id": "3f1c…",
                                        "durum": "iptal"
                                    }
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "YETKI: API ile açılmamış sipariş.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Hata"
                                }
                            }
                        }
                    },
                    "409": {
                        "description": "KARGOLANDI: Kargoya verilmiş.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Hata"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "TOKEN_YOK / TOKEN_GECERSIZ",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Hata"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "HIZ_SINIRI — dakikada 600 istek",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Hata"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/siparisler/{id}/kargo": {
            "post": {
                "operationId": "siparis-kargo",
                "tags": [
                    "Siparişler"
                ],
                "summary": "Kargo bildir",
                "description": "Kendi deponuzdan gönderdiğiniz siparişe kargo firması ve takip numarası yazar; durum \"Kargoda\" olur.\n\n\n\n**Yetki:** Sipariş açma — Her token kullanabilir (API hesabının kapsamındaki ürünlerle).",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Sipariş kimliği."
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Başarılı",
                        "content": {
                            "application/json": {
                                "example": {
                                    "veri": {
                                        "id": "3f1c…",
                                        "durum": "kargoda",
                                        "takip_no": "1234567890123"
                                    }
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "GECERSIZ_ALAN: takip_no boş.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Hata"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "TOKEN_YOK / TOKEN_GECERSIZ",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Hata"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "HIZ_SINIRI — dakikada 600 istek",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Hata"
                                }
                            }
                        }
                    }
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "kargo_firma": {
                                        "type": "string",
                                        "description": "Kargo firması adı."
                                    },
                                    "takip_no": {
                                        "type": "string",
                                        "description": "Takip numarası."
                                    }
                                },
                                "required": [
                                    "takip_no"
                                ]
                            },
                            "example": {
                                "kargo_firma": "Yurtiçi Kargo",
                                "takip_no": "1234567890123"
                            }
                        }
                    }
                }
            }
        },
        "/siparisler/{id}/durum": {
            "post": {
                "operationId": "siparis-durum",
                "tags": [
                    "Siparişler"
                ],
                "summary": "Sipariş durumunu değiştir",
                "description": "Siparişi verilen duruma alır (onayla, faturalandı, kargo hazır, teslim edildi, iptal, iade…). Panelin durum kutusuyla aynı kurallar.\n\nİptal'e geçişte rezerve stok rafa döner, iptalden çıkışta yeniden düşülür; kargoya hazır/kargoda durumlarında kargo firmasına otomatik gönderim (açıksa) tetiklenir. Pazaryerine durum **gönderilmez** (pazaryeri siparişlerinin durumu pazaryerinden okunur).\n\nGeçerli kodlar: `GET /durumlar`.\n\n**Yetki:** Sipariş yönetimi — API Hesapları › Genel › Yazma yetkileri › Sipariş yönetimi işaretli olmalı (sipariş görünürlüğü \"Tüm siparişlerim\" olan hesaplar için).",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Sipariş kimliği."
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Başarılı",
                        "content": {
                            "application/json": {
                                "example": {
                                    "veri": {
                                        "id": "3f1c…",
                                        "durum": "onaylandi",
                                        "durum_adi": "Onaylandı",
                                        "onceki": "onayda",
                                        "degisti": true
                                    }
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "YETKI_YOK: Sipariş yönetimi yetkisi kapalı.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Hata"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "SIPARIS_YOK: Yok / kapsam dışı.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Hata"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "GECERSIZ_ALAN: Durum kodu geçersiz.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Hata"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "TOKEN_YOK / TOKEN_GECERSIZ",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Hata"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "HIZ_SINIRI — dakikada 600 istek",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Hata"
                                }
                            }
                        }
                    }
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "durum": {
                                        "type": "string",
                                        "description": "onayda · onaylandi · faturalandi · kargo-hazir · kargoda · teslim-edildi · iade · iptal · odeme-bekleniyor"
                                    },
                                    "not": {
                                        "type": "string",
                                        "description": "Siparişe düşülecek not."
                                    }
                                },
                                "required": [
                                    "durum"
                                ]
                            },
                            "example": {
                                "durum": "onaylandi",
                                "not": "ERP onayı #4411"
                            }
                        }
                    }
                }
            }
        },
        "/siparisler/{id}/not": {
            "post": {
                "operationId": "siparis-not",
                "tags": [
                    "Siparişler"
                ],
                "summary": "Siparişe not ekle",
                "description": "Siparişin Notlar sekmesine satır ekler (panelde kim/ne zaman ile görünür).\n\n\n\n**Yetki:** Sipariş açma — Her token kullanabilir (API hesabının kapsamındaki ürünlerle).",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Sipariş kimliği."
                    }
                ],
                "responses": {
                    "201": {
                        "description": "Başarılı",
                        "content": {
                            "application/json": {
                                "example": {
                                    "veri": {
                                        "id": "3f1c…",
                                        "not": "Müşteri teslimatı cumartesiye istedi.",
                                        "tarih": "2026-10-29 11:02:10"
                                    }
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "SIPARIS_YOK: Yok / kapsam dışı.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Hata"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "TOKEN_YOK / TOKEN_GECERSIZ",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Hata"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "HIZ_SINIRI — dakikada 600 istek",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Hata"
                                }
                            }
                        }
                    }
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "metin": {
                                        "type": "string",
                                        "description": "Not (en çok 1000)."
                                    }
                                },
                                "required": [
                                    "metin"
                                ]
                            },
                            "example": {
                                "metin": "Müşteri teslimatı cumartesiye istedi."
                            }
                        }
                    }
                }
            }
        },
        "/siparisler/{id}/fatura-bilgisi": {
            "put": {
                "operationId": "siparis-fatura",
                "tags": [
                    "Siparişler"
                ],
                "summary": "Fatura bilgisini güncelle",
                "description": "Fatura adı/adresi/il/ilçe/telefon/vergi bilgilerini günceller; gönderilmeyen alanlar korunur.\n\nKendi açtığınız siparişte serbest; \"tüm siparişler\" görünürlüğündeki token için sipariş yönetimi yetkisi gerekir.\n\n**Yetki:** Sipariş açma — Her token kullanabilir (API hesabının kapsamındaki ürünlerle).",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Sipariş kimliği."
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Başarılı",
                        "content": {
                            "application/json": {
                                "example": {
                                    "veri": {
                                        "id": "3f1c…",
                                        "fatura_isim": "Örnek Saat Ltd. Şti.",
                                        "fatura_adres": "Örnek Mah. 1. Sk. No:3",
                                        "fatura_il_isim": "İstanbul",
                                        "fatura_ilce_isim": "Kadıköy",
                                        "fatura_telefon": "5321112233",
                                        "fatura_vn": "1234567890",
                                        "fatura_vd": "Kadıköy"
                                    }
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "SIPARIS_YOK: Yok / kapsam dışı.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Hata"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "GECERSIZ_ALAN: Ad / adres boş.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Hata"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "TOKEN_YOK / TOKEN_GECERSIZ",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Hata"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "HIZ_SINIRI — dakikada 600 istek",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Hata"
                                }
                            }
                        }
                    }
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "fatura_isim": {
                                        "type": "string",
                                        "description": "Yalnız gönderilenler değişir; ad ve adres boşaltılamaz."
                                    },
                                    "fatura_adres": {
                                        "type": "string",
                                        "description": "Yalnız gönderilenler değişir; ad ve adres boşaltılamaz."
                                    },
                                    "fatura_il_isim": {
                                        "type": "string",
                                        "description": "Yalnız gönderilenler değişir; ad ve adres boşaltılamaz."
                                    },
                                    "fatura_ilce_isim": {
                                        "type": "string",
                                        "description": "Yalnız gönderilenler değişir; ad ve adres boşaltılamaz."
                                    },
                                    "fatura_telefon": {
                                        "type": "string",
                                        "description": "Yalnız gönderilenler değişir; ad ve adres boşaltılamaz."
                                    },
                                    "fatura_vn": {
                                        "type": "string",
                                        "description": "Yalnız gönderilenler değişir; ad ve adres boşaltılamaz."
                                    },
                                    "fatura_vd": {
                                        "type": "string",
                                        "description": "Yalnız gönderilenler değişir; ad ve adres boşaltılamaz."
                                    }
                                }
                            },
                            "example": {
                                "fatura_isim": "Örnek Saat Ltd. Şti.",
                                "fatura_vn": "1234567890",
                                "fatura_vd": "Kadıköy"
                            }
                        }
                    }
                }
            }
        },
        "/siparisler/{id}/teslimat": {
            "put": {
                "operationId": "siparis-teslimat",
                "tags": [
                    "Siparişler"
                ],
                "summary": "Teslimat adresini güncelle",
                "description": "Kargolanmamış siparişin teslimat adını/adresini/il-ilçesini/telefonunu günceller.\n\n\n\n**Yetki:** Sipariş açma — Her token kullanabilir (API hesabının kapsamındaki ürünlerle).",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Sipariş kimliği."
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Başarılı",
                        "content": {
                            "application/json": {
                                "example": {
                                    "veri": {
                                        "id": "3f1c…",
                                        "teslimat_isim": "Ayşe Yılmaz",
                                        "teslimat_adres": "Yeni Mah. 5. Cd. No:12 D:3",
                                        "teslimat_il_isim": "İstanbul",
                                        "teslimat_ilce_isim": "Üsküdar",
                                        "teslimat_telefon": "5321112233"
                                    }
                                }
                            }
                        }
                    },
                    "409": {
                        "description": "KARGOLANDI: Kargoya verilmiş.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Hata"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "SIPARIS_YOK: Yok / kapsam dışı.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Hata"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "TOKEN_YOK / TOKEN_GECERSIZ",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Hata"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "HIZ_SINIRI — dakikada 600 istek",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Hata"
                                }
                            }
                        }
                    }
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "teslimat_isim": {
                                        "type": "string",
                                        "description": "Yalnız gönderilenler değişir."
                                    },
                                    "teslimat_adres": {
                                        "type": "string",
                                        "description": "Yalnız gönderilenler değişir."
                                    },
                                    "teslimat_il_isim": {
                                        "type": "string",
                                        "description": "Yalnız gönderilenler değişir."
                                    },
                                    "teslimat_ilce_isim": {
                                        "type": "string",
                                        "description": "Yalnız gönderilenler değişir."
                                    },
                                    "teslimat_telefon": {
                                        "type": "string",
                                        "description": "Yalnız gönderilenler değişir."
                                    }
                                }
                            },
                            "example": {
                                "teslimat_adres": "Yeni Mah. 5. Cd. No:12 D:3",
                                "teslimat_ilce_isim": "Üsküdar"
                            }
                        }
                    }
                }
            }
        },
        "/kargolar": {
            "get": {
                "operationId": "kargolar",
                "tags": [
                    "Referans Listeleri"
                ],
                "summary": "Kargo firmaları",
                "description": "`POST /siparisler` gövdesindeki `kargo._id` / `kargo.isim` için tanımlı firmalar.\n\n\n\n**Yetki:** Okuma — Her token kullanabilir.",
                "parameters": [],
                "responses": {
                    "200": {
                        "description": "Başarılı",
                        "content": {
                            "application/json": {
                                "example": {
                                    "veri": [
                                        {
                                            "id": "yurtici",
                                            "isim": "Yurtiçi Kargo"
                                        },
                                        {
                                            "id": "aras",
                                            "isim": "Aras Kargo"
                                        },
                                        {
                                            "id": "mng",
                                            "isim": "Mng Kargo"
                                        },
                                        {
                                            "id": "surat",
                                            "isim": "Sürat Kargo"
                                        },
                                        {
                                            "id": "ptt",
                                            "isim": "Ptt Kargo"
                                        },
                                        {
                                            "id": "hepsijet",
                                            "isim": "HepsiJet"
                                        },
                                        {
                                            "id": "tex",
                                            "isim": "Trendyol Express"
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "TOKEN_YOK / TOKEN_GECERSIZ",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Hata"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "HIZ_SINIRI — dakikada 600 istek",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Hata"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/durumlar": {
            "get": {
                "operationId": "durumlar",
                "tags": [
                    "Referans Listeleri"
                ],
                "summary": "Sipariş durumları",
                "description": "Sipariş durum kodları ve adları (`durum` süzgeci ve `POST …/durum` için).\n\n\n\n**Yetki:** Okuma — Her token kullanabilir.",
                "parameters": [],
                "responses": {
                    "200": {
                        "description": "Başarılı",
                        "content": {
                            "application/json": {
                                "example": {
                                    "veri": [
                                        {
                                            "id": "odeme-bekleniyor",
                                            "isim": "Ödeme Bekleniyor"
                                        },
                                        {
                                            "id": "onayda",
                                            "isim": "Onayda"
                                        },
                                        {
                                            "id": "onaylandi",
                                            "isim": "Onaylandı"
                                        },
                                        {
                                            "id": "faturalandi",
                                            "isim": "Faturalandı"
                                        },
                                        {
                                            "id": "kargo-hazir",
                                            "isim": "Kargo Hazır"
                                        },
                                        {
                                            "id": "kargoda",
                                            "isim": "Kargoda"
                                        },
                                        {
                                            "id": "teslim-edildi",
                                            "isim": "Teslim Edildi"
                                        },
                                        {
                                            "id": "iade",
                                            "isim": "İade"
                                        },
                                        {
                                            "id": "iptal",
                                            "isim": "İptal"
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "TOKEN_YOK / TOKEN_GECERSIZ",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Hata"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "HIZ_SINIRI — dakikada 600 istek",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Hata"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/platformlar": {
            "get": {
                "operationId": "platformlar",
                "tags": [
                    "Referans Listeleri"
                ],
                "summary": "Satış kanalları",
                "description": "Hesabın bağlı satış kanalları ve mağazaları; `GET /siparisler?platform=` kodları.\n\n\n\n**Yetki:** Okuma — Her token kullanabilir.",
                "parameters": [],
                "responses": {
                    "200": {
                        "description": "Başarılı",
                        "content": {
                            "application/json": {
                                "example": {
                                    "veri": [
                                        {
                                            "id": "ty",
                                            "isim": "Trendyol",
                                            "magazalar": [
                                                {
                                                    "merchant_id": "12345",
                                                    "isim": "Örnek Saat"
                                                }
                                            ]
                                        },
                                        {
                                            "id": "api",
                                            "isim": "Dış Satış",
                                            "magazalar": [
                                                {
                                                    "merchant_id": "b7237…",
                                                    "isim": "Bayi Sitesi"
                                                }
                                            ]
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "TOKEN_YOK / TOKEN_GECERSIZ",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Hata"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "HIZ_SINIRI — dakikada 600 istek",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Hata"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/depolar": {
            "get": {
                "operationId": "depolar",
                "tags": [
                    "Referans Listeleri"
                ],
                "summary": "Depolar",
                "description": "Hesabın depoları; `api_ile_yazilabilir` olanlara stok yazılır.\n\n\n\n**Yetki:** Okuma — Her token kullanabilir.",
                "parameters": [],
                "responses": {
                    "200": {
                        "description": "Başarılı",
                        "content": {
                            "application/json": {
                                "example": {
                                    "veri": [
                                        {
                                            "id": "DEP01",
                                            "isim": "Merkez Depo",
                                            "kod": "MRK",
                                            "varsayilan": true,
                                            "api_ile_yazilabilir": true,
                                            "raf_sayisi": 3
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "TOKEN_YOK / TOKEN_GECERSIZ",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Hata"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "HIZ_SINIRI — dakikada 600 istek",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Hata"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/webhook": {
            "get": {
                "operationId": "webhook-oku",
                "tags": [
                    "Webhook & Olaylar"
                ],
                "summary": "Webhook ayarı",
                "description": "Tanımlı adres, abone olunan olaylar ve gizli anahtarın var olup olmadığı.\n\n\n\n**Yetki:** Okuma — Her token kullanabilir.",
                "parameters": [],
                "responses": {
                    "200": {
                        "description": "Başarılı",
                        "content": {
                            "application/json": {
                                "example": {
                                    "veri": {
                                        "aktif": true,
                                        "url": "https://ornek.com/etibas-webhook",
                                        "olaylar": [
                                            "urun.degisti",
                                            "siparis.durum"
                                        ],
                                        "gizli_var": true
                                    },
                                    "olay_turleri": {
                                        "urun.degisti": "…",
                                        "siparis.olustu": "…",
                                        "siparis.durum": "…"
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "TOKEN_YOK / TOKEN_GECERSIZ",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Hata"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "HIZ_SINIRI — dakikada 600 istek",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Hata"
                                }
                            }
                        }
                    }
                }
            },
            "put": {
                "operationId": "webhook-kaydet",
                "tags": [
                    "Webhook & Olaylar"
                ],
                "summary": "Webhook kaydet",
                "description": "Bildirim adresini ve olayları kaydeder; yanıtta gizli anahtar **yalnız bu kez** tam gösterilir.\n\nAdres `https://` olmalı. Her gönderimde `X-Etibas-Imza` = HMAC-SHA256(gövde, gizli) hex gelir; doğrulayın. `gizli_yenile: true` yeni anahtar üretir.\n\n**Yetki:** Okuma — Her token kullanabilir.",
                "parameters": [],
                "responses": {
                    "200": {
                        "description": "Başarılı",
                        "content": {
                            "application/json": {
                                "example": {
                                    "veri": {
                                        "aktif": true,
                                        "url": "https://ornek.com/etibas-webhook",
                                        "olaylar": [
                                            "urun.degisti",
                                            "siparis.durum"
                                        ],
                                        "gizli": "9f3a…48 hex…",
                                        "not": "gizli anahtar yalnız bu yanıtta tam gösterilir; X-Etibas-Imza = HMAC-SHA256(gövde, gizli)"
                                    }
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "GECERSIZ_ALAN: url https değil.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Hata"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "TOKEN_YOK / TOKEN_GECERSIZ",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Hata"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "HIZ_SINIRI — dakikada 600 istek",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Hata"
                                }
                            }
                        }
                    }
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "url": {
                                        "type": "string",
                                        "description": "https adres."
                                    },
                                    "olaylar": {
                                        "type": "array",
                                        "items": {
                                            "type": "object"
                                        },
                                        "description": "Abone olunan türler; boş → hepsi."
                                    },
                                    "aktif": {
                                        "type": "boolean",
                                        "description": "Varsayılan true."
                                    },
                                    "gizli_yenile": {
                                        "type": "boolean",
                                        "description": "Yeni gizli anahtar üret."
                                    }
                                },
                                "required": [
                                    "url"
                                ]
                            },
                            "example": {
                                "url": "https://ornek.com/etibas-webhook",
                                "olaylar": [
                                    "urun.degisti",
                                    "siparis.durum"
                                ],
                                "aktif": true
                            }
                        }
                    }
                }
            },
            "delete": {
                "operationId": "webhook-sil",
                "tags": [
                    "Webhook & Olaylar"
                ],
                "summary": "Webhook'u kaldır",
                "description": "Bildirimleri kapatır, adresi ve gizli anahtarı siler.\n\n\n\n**Yetki:** Okuma — Her token kullanabilir.",
                "parameters": [],
                "responses": {
                    "200": {
                        "description": "Başarılı",
                        "content": {
                            "application/json": {
                                "example": {
                                    "veri": null
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "TOKEN_YOK / TOKEN_GECERSIZ",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Hata"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "HIZ_SINIRI — dakikada 600 istek",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Hata"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/webhook/test": {
            "post": {
                "operationId": "webhook-test",
                "tags": [
                    "Webhook & Olaylar"
                ],
                "summary": "Deneme olayı gönder",
                "description": "Adresinize gerçek imzalı bir `webhook.test` olayı kuyruğa alınır (en geç 1 dk içinde POST edilir).\n\nSonucu `GET /olaylar?tur=webhook.test` ile izleyin: `gonderildi` ya da `basarisiz` + HTTP kodu.\n\n**Yetki:** Okuma — Her token kullanabilir.",
                "parameters": [],
                "responses": {
                    "202": {
                        "description": "Başarılı",
                        "content": {
                            "application/json": {
                                "example": {
                                    "veri": {
                                        "olay_id": "c0ffee…",
                                        "durum": "bekliyor",
                                        "not": "En geç 1 dakika içinde adresinize POST edilir; sonucu GET /olaylar ile izleyin."
                                    }
                                }
                            }
                        }
                    },
                    "409": {
                        "description": "WEBHOOK_KAPALI: Önce PUT /webhook.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Hata"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "TOKEN_YOK / TOKEN_GECERSIZ",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Hata"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "HIZ_SINIRI — dakikada 600 istek",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Hata"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/olaylar": {
            "get": {
                "operationId": "olaylar",
                "tags": [
                    "Webhook & Olaylar"
                ],
                "summary": "Olay günlüğü",
                "description": "Son olaylar ve webhook gönderim sonuçları (30 gün saklanır).\n\n`durum`: bekliyor · gonderildi · basarisiz · bilgi (yalnız günlük). `deneme` ve `http_kod` karşı tarafın yanıtını gösterir.\n\n**Yetki:** Okuma — Her token kullanabilir.",
                "parameters": [
                    {
                        "name": "size",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "integer",
                            "default": 100
                        },
                        "description": "En çok 500."
                    },
                    {
                        "name": "tur",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Olay türü süzgeci."
                    },
                    {
                        "name": "durum",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "string"
                        },
                        "description": "bekliyor · gonderildi · basarisiz · bilgi"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Başarılı",
                        "content": {
                            "application/json": {
                                "example": {
                                    "veri": [
                                        {
                                            "id": "c0ffee…",
                                            "tur": "urun.degisti",
                                            "durum": "gonderildi",
                                            "tarih": "2026-10-29T10:15:00+03:00",
                                            "deneme": 1,
                                            "http_kod": 200,
                                            "ozet": "",
                                            "yuk": {
                                                "urun_idler": [
                                                    "URN001"
                                                ]
                                            }
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "TOKEN_YOK / TOKEN_GECERSIZ",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Hata"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "HIZ_SINIRI — dakikada 600 istek",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Hata"
                                }
                            }
                        }
                    }
                }
            }
        }
    },
    "components": {
        "securitySchemes": {
            "bearer": {
                "type": "http",
                "scheme": "bearer",
                "description": "API Hesapları ekranındaki token"
            }
        },
        "schemas": {
            "Hata": {
                "type": "object",
                "properties": {
                    "hata": {
                        "type": "object",
                        "properties": {
                            "kod": {
                                "type": "string",
                                "example": "URUN_YOK"
                            },
                            "mesaj": {
                                "type": "string"
                            },
                            "alanlar": {
                                "type": "object",
                                "nullable": true,
                                "additionalProperties": true
                            }
                        }
                    }
                }
            }
        }
    }
}