{
 "openapi": "3.1.0",
 "info": {
  "title": "PazarOMatik API",
  "version": "2.0.0",
  "description": "PazarOMatik Express'e kendi yazılımınızı bağlayın: ürün / stok, pazaryeri siparişleri, cariler, belgeler, finans ve raporlar. Okumalar buluttaki kopyadan anında gelir; yazmalar istek olarak programa gider ve program kendi kurallarıyla işler (202). Rehber: https://pazaromatik.com.tr/site/gelistirici/",
  "contact": {
   "name": "PazarOMatik",
   "email": "info@pazaromatik.com.tr",
   "url": "https://pazaromatik.com.tr/site/gelistirici/"
  }
 },
 "servers": [
  {
   "url": "https://pazaromatik.com.tr/site/api",
   "description": "Canlı"
  }
 ],
 "security": [
  {
   "bearer": []
  }
 ],
 "tags": [
  {
   "name": "Genel"
  },
  {
   "name": "Ürünler"
  },
  {
   "name": "Siparişler"
  },
  {
   "name": "Cariler"
  },
  {
   "name": "Belgeler"
  },
  {
   "name": "Finans"
  },
  {
   "name": "Raporlar"
  },
  {
   "name": "Genel kayıt uçları"
  },
  {
   "name": "İstekler"
  },
  {
   "name": "Webhook"
  }
 ],
 "paths": {
  "/v2/me": {
   "get": {
    "tags": [
     "Genel"
    ],
    "summary": "Anahtar ve firma bilgisi",
    "parameters": [],
    "description": "Anahtarın adı, yetkileri, bulut aboneliği ve son eşitleme zamanı.",
    "responses": {
     "200": {
      "description": "Başarılı",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Single"
        }
       }
      }
     },
     "401": {
      "description": "Anahtar yok / geçersiz / iptal",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "Yetki yok ya da bulut aboneliği etkin değil",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "Kayıt / uç bulunamadı",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "422": {
      "description": "Doğrulama hatası",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Dakikalık sınır aşıldı (Retry-After)",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   }
  },
  "/v2/products": {
   "get": {
    "tags": [
     "Ürünler"
    ],
    "summary": "Ürünleri listele",
    "parameters": [
     {
      "name": "limit",
      "in": "query",
      "schema": {
       "type": "integer",
       "default": 100,
       "maximum": 500
      },
      "description": "Sayfa başına kayıt (en çok 500)."
     },
     {
      "name": "cursor",
      "in": "query",
      "schema": {
       "type": "string"
      },
      "description": "Önceki yanıttaki meta.pagination.next_cursor değeri. next_cursor null ise liste bitmiştir."
     },
     {
      "name": "q",
      "in": "query",
      "schema": {
       "type": "string"
      },
      "description": "Ad / stok kodu / barkodda arama"
     },
     {
      "name": "sku",
      "in": "query",
      "schema": {
       "type": "string"
      },
      "description": "Stok kodu (tam)"
     },
     {
      "name": "barcode",
      "in": "query",
      "schema": {
       "type": "string"
      },
      "description": "Barkod (tam)"
     },
     {
      "name": "category",
      "in": "query",
      "schema": {
       "type": "string"
      },
      "description": "Kategori"
     },
     {
      "name": "brand",
      "in": "query",
      "schema": {
       "type": "string"
      },
      "description": "Marka"
     },
     {
      "name": "active",
      "in": "query",
      "schema": {
       "type": "string"
      },
      "description": "1: aktif, 0: pasif"
     },
     {
      "name": "parent_id",
      "in": "query",
      "schema": {
       "type": "integer"
      },
      "description": "Varyantlar: ana ürün id"
     }
    ],
    "description": "**Gereken yetki:** `products:read`\n\nHer üründe toplam stok (stock) gelir.",
    "responses": {
     "200": {
      "description": "Başarılı",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/List"
        }
       }
      }
     },
     "401": {
      "description": "Anahtar yok / geçersiz / iptal",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "Yetki yok ya da bulut aboneliği etkin değil",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "Kayıt / uç bulunamadı",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "422": {
      "description": "Doğrulama hatası",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Dakikalık sınır aşıldı (Retry-After)",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   },
   "post": {
    "tags": [
     "Ürünler"
    ],
    "summary": "Ürün oluştur (istek)",
    "parameters": [
     {
      "name": "Idempotency-Key",
      "in": "header",
      "schema": {
       "type": "string",
       "minLength": 8,
       "maxLength": 64
      },
      "description": "Aynı anahtarla tekrar gönderilen istek ikinci kez işlenmez (aynı request_id döner)."
     }
    ],
    "description": "**Gereken yetki:** `products:write`\n\nAlanlar: GET /schema → product. Program açıkken işlenir (202).",
    "responses": {
     "202": {
      "description": "İstek alındı; program açıkken işlenir.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Queued"
        }
       }
      }
     },
     "401": {
      "description": "Anahtar yok / geçersiz / iptal",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "Yetki yok ya da bulut aboneliği etkin değil",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "Kayıt / uç bulunamadı",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "422": {
      "description": "Doğrulama hatası",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Dakikalık sınır aşıldı (Retry-After)",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object"
       },
       "example": {
        "sku": "TS-001",
        "name": "Pamuklu Tişört",
        "barcode": "8680000000012",
        "sale_price": 199.9,
        "vat_rate": "20",
        "currency": "TRY",
        "unit": "Adet",
        "opening_qty": 50
       }
      }
     }
    }
   }
  },
  "/v2/products/{id}": {
   "get": {
    "tags": [
     "Ürünler"
    ],
    "summary": "Ürün getir",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      }
     }
    ],
    "description": "**Gereken yetki:** `products:read`\n\nDepo bazında stok (stock_by_warehouse) ve her pazaryerindeki ilanı (listings: fiyat, stok, durum) ile.",
    "responses": {
     "200": {
      "description": "Başarılı",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Single"
        }
       }
      }
     },
     "401": {
      "description": "Anahtar yok / geçersiz / iptal",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "Yetki yok ya da bulut aboneliği etkin değil",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "Kayıt / uç bulunamadı",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "422": {
      "description": "Doğrulama hatası",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Dakikalık sınır aşıldı (Retry-After)",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   },
   "patch": {
    "tags": [
     "Ürünler"
    ],
    "summary": "Ürün güncelle (istek)",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      }
     },
     {
      "name": "Idempotency-Key",
      "in": "header",
      "schema": {
       "type": "string",
       "minLength": 8,
       "maxLength": 64
      },
      "description": "Aynı anahtarla tekrar gönderilen istek ikinci kez işlenmez (aynı request_id döner)."
     }
    ],
    "description": "**Gereken yetki:** `products:write`\n\nYalnız gönderilen alanlar değişir. 'orig' verilirse: alan bu arada programda değiştiyse istek reddedilir (çakışma).",
    "responses": {
     "202": {
      "description": "İstek alındı; program açıkken işlenir.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Queued"
        }
       }
      }
     },
     "401": {
      "description": "Anahtar yok / geçersiz / iptal",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "Yetki yok ya da bulut aboneliği etkin değil",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "Kayıt / uç bulunamadı",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "422": {
      "description": "Doğrulama hatası",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Dakikalık sınır aşıldı (Retry-After)",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object"
       },
       "example": {
        "sale_price": 189.9,
        "orig": {
         "sale_price": 199.9
        }
       }
      }
     }
    }
   },
   "delete": {
    "tags": [
     "Ürünler"
    ],
    "summary": "Ürün sil (istek)",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      }
     },
     {
      "name": "Idempotency-Key",
      "in": "header",
      "schema": {
       "type": "string",
       "minLength": 8,
       "maxLength": 64
      },
      "description": "Aynı anahtarla tekrar gönderilen istek ikinci kez işlenmez (aynı request_id döner)."
     }
    ],
    "description": "**Gereken yetki:** `products:write`\n\nProgramda geri dönüşüm kutusuna gider.",
    "responses": {
     "202": {
      "description": "İstek alındı; program açıkken işlenir.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Queued"
        }
       }
      }
     },
     "401": {
      "description": "Anahtar yok / geçersiz / iptal",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "Yetki yok ya da bulut aboneliği etkin değil",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "Kayıt / uç bulunamadı",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "422": {
      "description": "Doğrulama hatası",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Dakikalık sınır aşıldı (Retry-After)",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   }
  },
  "/v2/products/{id}/stock-movements": {
   "get": {
    "tags": [
     "Ürünler"
    ],
    "summary": "Stok hareketleri",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      }
     },
     {
      "name": "limit",
      "in": "query",
      "schema": {
       "type": "integer",
       "default": 100,
       "maximum": 500
      },
      "description": "Sayfa başına kayıt (en çok 500)."
     },
     {
      "name": "cursor",
      "in": "query",
      "schema": {
       "type": "string"
      },
      "description": "Önceki yanıttaki meta.pagination.next_cursor değeri. next_cursor null ise liste bitmiştir."
     }
    ],
    "description": "**Gereken yetki:** `products:read`\n\nYeniden eskiye.",
    "responses": {
     "200": {
      "description": "Başarılı",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/List"
        }
       }
      }
     },
     "401": {
      "description": "Anahtar yok / geçersiz / iptal",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "Yetki yok ya da bulut aboneliği etkin değil",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "Kayıt / uç bulunamadı",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "422": {
      "description": "Doğrulama hatası",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Dakikalık sınır aşıldı (Retry-After)",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   },
   "post": {
    "tags": [
     "Ürünler"
    ],
    "summary": "Stok girişi / çıkışı (istek)",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      }
     },
     {
      "name": "Idempotency-Key",
      "in": "header",
      "schema": {
       "type": "string",
       "minLength": 8,
       "maxLength": 64
      },
      "description": "Aynı anahtarla tekrar gönderilen istek ikinci kez işlenmez (aynı request_id döner)."
     }
    ],
    "description": "**Gereken yetki:** `products:write`\n\nmode: in (giriş) | out (çıkış) | transfer (target_id ile). mode verilmezse qty'nin işaretine göre. Otomatik stok eşitleme açıksa yeni stok tüm kanallara gider.",
    "responses": {
     "202": {
      "description": "İstek alındı; program açıkken işlenir.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Queued"
        }
       }
      }
     },
     "401": {
      "description": "Anahtar yok / geçersiz / iptal",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "Yetki yok ya da bulut aboneliği etkin değil",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "Kayıt / uç bulunamadı",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "422": {
      "description": "Doğrulama hatası",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Dakikalık sınır aşıldı (Retry-After)",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object"
       },
       "example": {
        "mode": "in",
        "qty": 25,
        "warehouse_id": 1,
        "note": "Tedarikçiden gelen"
       }
      }
     }
    }
   }
  },
  "/v2/listings": {
   "get": {
    "tags": [
     "Ürünler"
    ],
    "summary": "Pazaryeri ilanları",
    "parameters": [
     {
      "name": "limit",
      "in": "query",
      "schema": {
       "type": "integer",
       "default": 100,
       "maximum": 500
      },
      "description": "Sayfa başına kayıt (en çok 500)."
     },
     {
      "name": "cursor",
      "in": "query",
      "schema": {
       "type": "string"
      },
      "description": "Önceki yanıttaki meta.pagination.next_cursor değeri. next_cursor null ise liste bitmiştir."
     },
     {
      "name": "channel",
      "in": "query",
      "schema": {
       "type": "string"
      },
      "description": "Kanal anahtarı (trendyol, hepsiburada, n11, woocommerce...)"
     },
     {
      "name": "sku",
      "in": "query",
      "schema": {
       "type": "string"
      },
      "description": "Stok kodu"
     },
     {
      "name": "barcode",
      "in": "query",
      "schema": {
       "type": "string"
      },
      "description": "Barkod"
     },
     {
      "name": "status",
      "in": "query",
      "schema": {
       "type": "string"
      },
      "description": "Durum"
     },
     {
      "name": "product_id",
      "in": "query",
      "schema": {
       "type": "integer"
      },
      "description": "Programdaki ürün"
     },
     {
      "name": "matched",
      "in": "query",
      "schema": {
       "type": "string"
      },
      "description": "1: eşleşmiş, 0: eşleşmemiş"
     }
    ],
    "description": "**Gereken yetki:** `products:read`\n\nHer kanaldaki ilan: fiyat, stok, satışta mı, komisyon, eşleştiği ürün.",
    "responses": {
     "200": {
      "description": "Başarılı",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/List"
        }
       }
      }
     },
     "401": {
      "description": "Anahtar yok / geçersiz / iptal",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "Yetki yok ya da bulut aboneliği etkin değil",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "Kayıt / uç bulunamadı",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "422": {
      "description": "Doğrulama hatası",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Dakikalık sınır aşıldı (Retry-After)",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   }
  },
  "/v2/listings/{id}": {
   "get": {
    "tags": [
     "Ürünler"
    ],
    "summary": "İlan getir",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      }
     }
    ],
    "description": "**Gereken yetki:** `products:read`",
    "responses": {
     "200": {
      "description": "Başarılı",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Single"
        }
       }
      }
     },
     "401": {
      "description": "Anahtar yok / geçersiz / iptal",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "Yetki yok ya da bulut aboneliği etkin değil",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "Kayıt / uç bulunamadı",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "422": {
      "description": "Doğrulama hatası",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Dakikalık sınır aşıldı (Retry-After)",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   }
  },
  "/v2/listings/{id}/actions/link": {
   "post": {
    "tags": [
     "Ürünler"
    ],
    "summary": "İlanı ürüne bağla (istek)",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      }
     },
     {
      "name": "Idempotency-Key",
      "in": "header",
      "schema": {
       "type": "string",
       "minLength": 8,
       "maxLength": 64
      },
      "description": "Aynı anahtarla tekrar gönderilen istek ikinci kez işlenmez (aynı request_id döner)."
     }
    ],
    "description": "**Gereken yetki:** `products:write`\n\nDiğer işlemler: unlink, confirm, ignore.",
    "responses": {
     "202": {
      "description": "İstek alındı; program açıkken işlenir.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Queued"
        }
       }
      }
     },
     "401": {
      "description": "Anahtar yok / geçersiz / iptal",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "Yetki yok ya da bulut aboneliği etkin değil",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "Kayıt / uç bulunamadı",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "422": {
      "description": "Doğrulama hatası",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Dakikalık sınır aşıldı (Retry-After)",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object"
       },
       "example": {
        "product_id": 12,
        "multiplier": 1
       }
      }
     }
    }
   }
  },
  "/v2/warehouses": {
   "get": {
    "tags": [
     "Ürünler"
    ],
    "summary": "Depolar",
    "parameters": [],
    "description": "**Gereken yetki:** `products:read`",
    "responses": {
     "200": {
      "description": "Başarılı",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Single"
        }
       }
      }
     },
     "401": {
      "description": "Anahtar yok / geçersiz / iptal",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "Yetki yok ya da bulut aboneliği etkin değil",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "Kayıt / uç bulunamadı",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "422": {
      "description": "Doğrulama hatası",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Dakikalık sınır aşıldı (Retry-After)",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   }
  },
  "/v2/categories": {
   "get": {
    "tags": [
     "Ürünler"
    ],
    "summary": "Kategoriler",
    "parameters": [],
    "description": "**Gereken yetki:** `products:read`\n\nÜrünlerde kullanılan kategoriler ve ürün sayısı.",
    "responses": {
     "200": {
      "description": "Başarılı",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Single"
        }
       }
      }
     },
     "401": {
      "description": "Anahtar yok / geçersiz / iptal",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "Yetki yok ya da bulut aboneliği etkin değil",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "Kayıt / uç bulunamadı",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "422": {
      "description": "Doğrulama hatası",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Dakikalık sınır aşıldı (Retry-After)",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   }
  },
  "/v2/orders": {
   "get": {
    "tags": [
     "Siparişler"
    ],
    "summary": "Pazaryeri / e-ticaret siparişleri",
    "parameters": [
     {
      "name": "limit",
      "in": "query",
      "schema": {
       "type": "integer",
       "default": 100,
       "maximum": 500
      },
      "description": "Sayfa başına kayıt (en çok 500)."
     },
     {
      "name": "cursor",
      "in": "query",
      "schema": {
       "type": "string"
      },
      "description": "Önceki yanıttaki meta.pagination.next_cursor değeri. next_cursor null ise liste bitmiştir."
     },
     {
      "name": "channel",
      "in": "query",
      "schema": {
       "type": "string"
      },
      "description": "Kanal"
     },
     {
      "name": "status",
      "in": "query",
      "schema": {
       "type": "string"
      },
      "description": "Durum"
     },
     {
      "name": "number",
      "in": "query",
      "schema": {
       "type": "string"
      },
      "description": "Sipariş no"
     },
     {
      "name": "from",
      "in": "query",
      "schema": {
       "type": "string"
      },
      "description": "Sipariş tarihi ≥ (YYYY-AA-GG)"
     },
     {
      "name": "to",
      "in": "query",
      "schema": {
       "type": "string"
      },
      "description": "Sipariş tarihi ≤"
     },
     {
      "name": "updated_since",
      "in": "query",
      "schema": {
       "type": "string"
      },
      "description": "Pazaryerinde değişme zamanı ≥"
     },
     {
      "name": "order",
      "in": "query",
      "schema": {
       "type": "string"
      },
      "description": "desc (varsayılan) | asc"
     }
    ],
    "description": "**Gereken yetki:** `orders:read`\n\nMüşteri, adres, kalemler (lines), kargo (cargo) ve fatura bağlantısıyla.",
    "responses": {
     "200": {
      "description": "Başarılı",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/List"
        }
       }
      }
     },
     "401": {
      "description": "Anahtar yok / geçersiz / iptal",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "Yetki yok ya da bulut aboneliği etkin değil",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "Kayıt / uç bulunamadı",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "422": {
      "description": "Doğrulama hatası",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Dakikalık sınır aşıldı (Retry-After)",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   }
  },
  "/v2/orders/{id}": {
   "get": {
    "tags": [
     "Siparişler"
    ],
    "summary": "Sipariş getir",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      }
     }
    ],
    "description": "**Gereken yetki:** `orders:read`",
    "responses": {
     "200": {
      "description": "Başarılı",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Single"
        }
       }
      }
     },
     "401": {
      "description": "Anahtar yok / geçersiz / iptal",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "Yetki yok ya da bulut aboneliği etkin değil",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "Kayıt / uç bulunamadı",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "422": {
      "description": "Doğrulama hatası",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Dakikalık sınır aşıldı (Retry-After)",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   }
  },
  "/v2/orders/{id}/actions/{action}": {
   "post": {
    "tags": [
     "Siparişler"
    ],
    "summary": "Sipariş işlemi (istek)",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      }
     },
     {
      "name": "action",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "enum": [
        "stock",
        "unstock",
        "import",
        "status",
        "labels",
        "picking",
        "assign",
        "merge",
        "tag"
       ]
      }
     },
     {
      "name": "Idempotency-Key",
      "in": "header",
      "schema": {
       "type": "string",
       "minLength": 8,
       "maxLength": 64
      },
      "description": "Aynı anahtarla tekrar gönderilen istek ikinci kez işlenmez (aynı request_id döner)."
     }
    ],
    "description": "**Gereken yetki:** `orders:write`\n\nstock: stoktan düş · unstock: geri al · import: programa satış siparişi olarak al · status: durumu sitede değiştir ({status}) · assign: personele ata ({assignee}) · tag: renkli etiket ({tag}). Alanlar: GET /schema → corder.",
    "responses": {
     "202": {
      "description": "İstek alındı; program açıkken işlenir.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Queued"
        }
       }
      }
     },
     "401": {
      "description": "Anahtar yok / geçersiz / iptal",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "Yetki yok ya da bulut aboneliği etkin değil",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "Kayıt / uç bulunamadı",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "422": {
      "description": "Doğrulama hatası",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Dakikalık sınır aşıldı (Retry-After)",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object"
       },
       "example": {
        "status": "completed"
       }
      }
     }
    }
   }
  },
  "/v2/questions": {
   "get": {
    "tags": [
     "Siparişler"
    ],
    "summary": "Müşteri soruları",
    "parameters": [
     {
      "name": "limit",
      "in": "query",
      "schema": {
       "type": "integer",
       "default": 100,
       "maximum": 500
      },
      "description": "Sayfa başına kayıt (en çok 500)."
     },
     {
      "name": "cursor",
      "in": "query",
      "schema": {
       "type": "string"
      },
      "description": "Önceki yanıttaki meta.pagination.next_cursor değeri. next_cursor null ise liste bitmiştir."
     },
     {
      "name": "channel",
      "in": "query",
      "schema": {
       "type": "string"
      },
      "description": "Kanal"
     },
     {
      "name": "status",
      "in": "query",
      "schema": {
       "type": "string"
      },
      "description": "Durum"
     },
     {
      "name": "answered",
      "in": "query",
      "schema": {
       "type": "string"
      },
      "description": "1: cevaplanmış, 0: bekleyen"
     }
    ],
    "description": "**Gereken yetki:** `orders:read`\n\nYeniden eskiye.",
    "responses": {
     "200": {
      "description": "Başarılı",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/List"
        }
       }
      }
     },
     "401": {
      "description": "Anahtar yok / geçersiz / iptal",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "Yetki yok ya da bulut aboneliği etkin değil",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "Kayıt / uç bulunamadı",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "422": {
      "description": "Doğrulama hatası",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Dakikalık sınır aşıldı (Retry-After)",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   }
  },
  "/v2/questions/{id}": {
   "get": {
    "tags": [
     "Siparişler"
    ],
    "summary": "Soru getir",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      }
     }
    ],
    "description": "**Gereken yetki:** `orders:read`",
    "responses": {
     "200": {
      "description": "Başarılı",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Single"
        }
       }
      }
     },
     "401": {
      "description": "Anahtar yok / geçersiz / iptal",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "Yetki yok ya da bulut aboneliği etkin değil",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "Kayıt / uç bulunamadı",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "422": {
      "description": "Doğrulama hatası",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Dakikalık sınır aşıldı (Retry-After)",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   }
  },
  "/v2/questions/{id}/answer": {
   "post": {
    "tags": [
     "Siparişler"
    ],
    "summary": "Soruyu cevapla (istek)",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      }
     },
     {
      "name": "Idempotency-Key",
      "in": "header",
      "schema": {
       "type": "string",
       "minLength": 8,
       "maxLength": 64
      },
      "description": "Aynı anahtarla tekrar gönderilen istek ikinci kez işlenmez (aynı request_id döner)."
     }
    ],
    "description": "**Gereken yetki:** `orders:write`\n\nCevap pazaryerine program üzerinden gider. Cevapta telefon / e-posta / IBAN / link / başka pazaryeri adı varsa program reddeder (pazaryeri kuralı); bilerek göndermek için force: true.",
    "responses": {
     "202": {
      "description": "İstek alındı; program açıkken işlenir.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Queued"
        }
       }
      }
     },
     "401": {
      "description": "Anahtar yok / geçersiz / iptal",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "Yetki yok ya da bulut aboneliği etkin değil",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "Kayıt / uç bulunamadı",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "422": {
      "description": "Doğrulama hatası",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Dakikalık sınır aşıldı (Retry-After)",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object"
       },
       "example": {
        "answer": "Merhaba, ürün stokta; bugün kargoya verilir."
       }
      }
     }
    }
   }
  },
  "/v2/claims": {
   "get": {
    "tags": [
     "Siparişler"
    ],
    "summary": "İade talepleri",
    "parameters": [
     {
      "name": "limit",
      "in": "query",
      "schema": {
       "type": "integer",
       "default": 100,
       "maximum": 500
      },
      "description": "Sayfa başına kayıt (en çok 500)."
     },
     {
      "name": "cursor",
      "in": "query",
      "schema": {
       "type": "string"
      },
      "description": "Önceki yanıttaki meta.pagination.next_cursor değeri. next_cursor null ise liste bitmiştir."
     },
     {
      "name": "channel",
      "in": "query",
      "schema": {
       "type": "string"
      },
      "description": "Kanal"
     },
     {
      "name": "status",
      "in": "query",
      "schema": {
       "type": "string"
      },
      "description": "Durum"
     },
     {
      "name": "order_number",
      "in": "query",
      "schema": {
       "type": "string"
      },
      "description": "Sipariş no"
     }
    ],
    "description": "**Gereken yetki:** `orders:read`",
    "responses": {
     "200": {
      "description": "Başarılı",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/List"
        }
       }
      }
     },
     "401": {
      "description": "Anahtar yok / geçersiz / iptal",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "Yetki yok ya da bulut aboneliği etkin değil",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "Kayıt / uç bulunamadı",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "422": {
      "description": "Doğrulama hatası",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Dakikalık sınır aşıldı (Retry-After)",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   }
  },
  "/v2/claims/{id}": {
   "get": {
    "tags": [
     "Siparişler"
    ],
    "summary": "İade getir",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      }
     }
    ],
    "description": "**Gereken yetki:** `orders:read`",
    "responses": {
     "200": {
      "description": "Başarılı",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Single"
        }
       }
      }
     },
     "401": {
      "description": "Anahtar yok / geçersiz / iptal",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "Yetki yok ya da bulut aboneliği etkin değil",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "Kayıt / uç bulunamadı",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "422": {
      "description": "Doğrulama hatası",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Dakikalık sınır aşıldı (Retry-After)",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   }
  },
  "/v2/claims/{id}/actions/approve": {
   "post": {
    "tags": [
     "Siparişler"
    ],
    "summary": "İadeyi onayla (istek)",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      }
     },
     {
      "name": "Idempotency-Key",
      "in": "header",
      "schema": {
       "type": "string",
       "minLength": 8,
       "maxLength": 64
      },
      "description": "Aynı anahtarla tekrar gönderilen istek ikinci kez işlenmez (aynı request_id döner)."
     }
    ],
    "description": "**Gereken yetki:** `orders:write`\n\nstock işlemi: iade gelen ürünleri stoğa al.",
    "responses": {
     "202": {
      "description": "İstek alındı; program açıkken işlenir.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Queued"
        }
       }
      }
     },
     "401": {
      "description": "Anahtar yok / geçersiz / iptal",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "Yetki yok ya da bulut aboneliği etkin değil",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "Kayıt / uç bulunamadı",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "422": {
      "description": "Doğrulama hatası",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Dakikalık sınır aşıldı (Retry-After)",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   }
  },
  "/v2/customers": {
   "get": {
    "tags": [
     "Cariler"
    ],
    "summary": "Cariler",
    "parameters": [
     {
      "name": "limit",
      "in": "query",
      "schema": {
       "type": "integer",
       "default": 100,
       "maximum": 500
      },
      "description": "Sayfa başına kayıt (en çok 500)."
     },
     {
      "name": "cursor",
      "in": "query",
      "schema": {
       "type": "string"
      },
      "description": "Önceki yanıttaki meta.pagination.next_cursor değeri. next_cursor null ise liste bitmiştir."
     },
     {
      "name": "kind",
      "in": "query",
      "schema": {
       "type": "string"
      },
      "description": "customer | supplier"
     },
     {
      "name": "q",
      "in": "query",
      "schema": {
       "type": "string"
      },
      "description": "Unvan / kod / telefon"
     },
     {
      "name": "code",
      "in": "query",
      "schema": {
       "type": "string"
      },
      "description": "Cari kodu"
     },
     {
      "name": "tax_no",
      "in": "query",
      "schema": {
       "type": "string"
      },
      "description": "Vergi / TC no"
     },
     {
      "name": "email",
      "in": "query",
      "schema": {
       "type": "string"
      },
      "description": "E-posta"
     },
     {
      "name": "city",
      "in": "query",
      "schema": {
       "type": "string"
      },
      "description": "İl"
     }
    ],
    "description": "**Gereken yetki:** `customers:read`\n\nBakiye (balance = borç − alacak) ile.",
    "responses": {
     "200": {
      "description": "Başarılı",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/List"
        }
       }
      }
     },
     "401": {
      "description": "Anahtar yok / geçersiz / iptal",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "Yetki yok ya da bulut aboneliği etkin değil",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "Kayıt / uç bulunamadı",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "422": {
      "description": "Doğrulama hatası",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Dakikalık sınır aşıldı (Retry-After)",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   },
   "post": {
    "tags": [
     "Cariler"
    ],
    "summary": "Cari oluştur (istek)",
    "parameters": [
     {
      "name": "Idempotency-Key",
      "in": "header",
      "schema": {
       "type": "string",
       "minLength": 8,
       "maxLength": 64
      },
      "description": "Aynı anahtarla tekrar gönderilen istek ikinci kez işlenmez (aynı request_id döner)."
     }
    ],
    "description": "**Gereken yetki:** `customers:write`",
    "responses": {
     "202": {
      "description": "İstek alındı; program açıkken işlenir.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Queued"
        }
       }
      }
     },
     "401": {
      "description": "Anahtar yok / geçersiz / iptal",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "Yetki yok ya da bulut aboneliği etkin değil",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "Kayıt / uç bulunamadı",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "422": {
      "description": "Doğrulama hatası",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Dakikalık sınır aşıldı (Retry-After)",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object"
       },
       "example": {
        "kind": "customer",
        "title": "Acme Ltd.",
        "person_type": "Kurumsal",
        "phone": "05551112233",
        "email": "info@acme.com",
        "city": "İstanbul",
        "tax_office": "Kadıköy",
        "tax_no": "1234567890"
       }
      }
     }
    }
   }
  },
  "/v2/customers/{id}": {
   "get": {
    "tags": [
     "Cariler"
    ],
    "summary": "Cari getir",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      }
     }
    ],
    "description": "**Gereken yetki:** `customers:read`\n\nAdresler ve iletişim kanallarıyla.",
    "responses": {
     "200": {
      "description": "Başarılı",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Single"
        }
       }
      }
     },
     "401": {
      "description": "Anahtar yok / geçersiz / iptal",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "Yetki yok ya da bulut aboneliği etkin değil",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "Kayıt / uç bulunamadı",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "422": {
      "description": "Doğrulama hatası",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Dakikalık sınır aşıldı (Retry-After)",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   },
   "patch": {
    "tags": [
     "Cariler"
    ],
    "summary": "Cari güncelle (istek)",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      }
     },
     {
      "name": "Idempotency-Key",
      "in": "header",
      "schema": {
       "type": "string",
       "minLength": 8,
       "maxLength": 64
      },
      "description": "Aynı anahtarla tekrar gönderilen istek ikinci kez işlenmez (aynı request_id döner)."
     }
    ],
    "description": "**Gereken yetki:** `customers:write`\n\nAlanlar: GET /schema → party.",
    "responses": {
     "202": {
      "description": "İstek alındı; program açıkken işlenir.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Queued"
        }
       }
      }
     },
     "401": {
      "description": "Anahtar yok / geçersiz / iptal",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "Yetki yok ya da bulut aboneliği etkin değil",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "Kayıt / uç bulunamadı",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "422": {
      "description": "Doğrulama hatası",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Dakikalık sınır aşıldı (Retry-After)",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object"
       },
       "example": {
        "credit_limit": 50000
       }
      }
     }
    }
   }
  },
  "/v2/customers/{id}/ledger": {
   "get": {
    "tags": [
     "Cariler"
    ],
    "summary": "Cari hesap hareketleri",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      }
     },
     {
      "name": "limit",
      "in": "query",
      "schema": {
       "type": "integer",
       "default": 100,
       "maximum": 500
      },
      "description": "Sayfa başına kayıt (en çok 500)."
     },
     {
      "name": "cursor",
      "in": "query",
      "schema": {
       "type": "string"
      },
      "description": "Önceki yanıttaki meta.pagination.next_cursor değeri. next_cursor null ise liste bitmiştir."
     }
    ],
    "description": "**Gereken yetki:** `customers:read`",
    "responses": {
     "200": {
      "description": "Başarılı",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/List"
        }
       }
      }
     },
     "401": {
      "description": "Anahtar yok / geçersiz / iptal",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "Yetki yok ya da bulut aboneliği etkin değil",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "Kayıt / uç bulunamadı",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "422": {
      "description": "Doğrulama hatası",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Dakikalık sınır aşıldı (Retry-After)",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   }
  },
  "/v2/customers/{id}/payments": {
   "post": {
    "tags": [
     "Cariler"
    ],
    "summary": "Tahsilat / ödeme (istek)",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      }
     },
     {
      "name": "Idempotency-Key",
      "in": "header",
      "schema": {
       "type": "string",
       "minLength": 8,
       "maxLength": 64
      },
      "description": "Aynı anahtarla tekrar gönderilen istek ikinci kez işlenmez (aynı request_id döner)."
     }
    ],
    "description": "**Gereken yetki:** `finance:write`\n\nincoming: true tahsilat, false ödeme. account_id: GET /accounts.",
    "responses": {
     "202": {
      "description": "İstek alındı; program açıkken işlenir.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Queued"
        }
       }
      }
     },
     "401": {
      "description": "Anahtar yok / geçersiz / iptal",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "Yetki yok ya da bulut aboneliği etkin değil",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "Kayıt / uç bulunamadı",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "422": {
      "description": "Doğrulama hatası",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Dakikalık sınır aşıldı (Retry-After)",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object"
       },
       "example": {
        "account_id": 1,
        "amount": 1250.5,
        "incoming": true,
        "date": "2026-10-15",
        "note": "Havale"
       }
      }
     }
    }
   }
  },
  "/v2/customers/{id}/activities": {
   "post": {
    "tags": [
     "Cariler"
    ],
    "summary": "Ziyaret / arama / not (istek)",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      }
     },
     {
      "name": "Idempotency-Key",
      "in": "header",
      "schema": {
       "type": "string",
       "minLength": 8,
       "maxLength": 64
      },
      "description": "Aynı anahtarla tekrar gönderilen istek ikinci kez işlenmez (aynı request_id döner)."
     }
    ],
    "description": "**Gereken yetki:** `customers:write`\n\nkind: visit | call | meeting | note | task",
    "responses": {
     "202": {
      "description": "İstek alındı; program açıkken işlenir.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Queued"
        }
       }
      }
     },
     "401": {
      "description": "Anahtar yok / geçersiz / iptal",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "Yetki yok ya da bulut aboneliği etkin değil",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "Kayıt / uç bulunamadı",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "422": {
      "description": "Doğrulama hatası",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Dakikalık sınır aşıldı (Retry-After)",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object"
       },
       "example": {
        "kind": "call",
        "title": "Fiyat teklifi görüşmesi",
        "body": "Hafta sonu tekrar aranacak."
       }
      }
     }
    }
   }
  },
  "/v2/documents": {
   "get": {
    "tags": [
     "Belgeler"
    ],
    "summary": "Teklif / sipariş / fatura / irsaliye",
    "parameters": [
     {
      "name": "limit",
      "in": "query",
      "schema": {
       "type": "integer",
       "default": 100,
       "maximum": 500
      },
      "description": "Sayfa başına kayıt (en çok 500)."
     },
     {
      "name": "cursor",
      "in": "query",
      "schema": {
       "type": "string"
      },
      "description": "Önceki yanıttaki meta.pagination.next_cursor değeri. next_cursor null ise liste bitmiştir."
     },
     {
      "name": "kind",
      "in": "query",
      "schema": {
       "type": "string"
      },
      "description": "quote | order | sale | purchase"
     },
     {
      "name": "status",
      "in": "query",
      "schema": {
       "type": "string"
      },
      "description": "Durum"
     },
     {
      "name": "number",
      "in": "query",
      "schema": {
       "type": "string"
      },
      "description": "Belge no"
     },
     {
      "name": "party_id",
      "in": "query",
      "schema": {
       "type": "integer"
      },
      "description": "Cari"
     },
     {
      "name": "from",
      "in": "query",
      "schema": {
       "type": "string"
      },
      "description": "Tarih ≥"
     },
     {
      "name": "to",
      "in": "query",
      "schema": {
       "type": "string"
      },
      "description": "Tarih ≤"
     },
     {
      "name": "updated_since",
      "in": "query",
      "schema": {
       "type": "string"
      },
      "description": "Değişme ≥"
     }
    ],
    "description": "**Gereken yetki:** `documents:read`",
    "responses": {
     "200": {
      "description": "Başarılı",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/List"
        }
       }
      }
     },
     "401": {
      "description": "Anahtar yok / geçersiz / iptal",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "Yetki yok ya da bulut aboneliği etkin değil",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "Kayıt / uç bulunamadı",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "422": {
      "description": "Doğrulama hatası",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Dakikalık sınır aşıldı (Retry-After)",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   },
   "post": {
    "tags": [
     "Belgeler"
    ],
    "summary": "Belge oluştur (istek)",
    "parameters": [
     {
      "name": "Idempotency-Key",
      "in": "header",
      "schema": {
       "type": "string",
       "minLength": 8,
       "maxLength": 64
      },
      "description": "Aynı anahtarla tekrar gönderilen istek ikinci kez işlenmez (aynı request_id döner)."
     }
    ],
    "description": "**Gereken yetki:** `documents:write`\n\nTeklif, sipariş, satış / alış faturası. Alanlar ve türler: GET /schema → doc. Basit satış siparişi için /documents/sales-orders.",
    "responses": {
     "202": {
      "description": "İstek alındı; program açıkken işlenir.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Queued"
        }
       }
      }
     },
     "401": {
      "description": "Anahtar yok / geçersiz / iptal",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "Yetki yok ya da bulut aboneliği etkin değil",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "Kayıt / uç bulunamadı",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "422": {
      "description": "Doğrulama hatası",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Dakikalık sınır aşıldı (Retry-After)",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object"
       },
       "example": {
        "kind": "quote",
        "party_id": 7,
        "lines": [
         {
          "product_id": 12,
          "qty": 3,
          "price": 450
         }
        ]
       }
      }
     }
    }
   }
  },
  "/v2/documents/{id}": {
   "get": {
    "tags": [
     "Belgeler"
    ],
    "summary": "Belge getir",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      }
     }
    ],
    "description": "**Gereken yetki:** `documents:read`\n\nKalemleriyle (lines).",
    "responses": {
     "200": {
      "description": "Başarılı",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Single"
        }
       }
      }
     },
     "401": {
      "description": "Anahtar yok / geçersiz / iptal",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "Yetki yok ya da bulut aboneliği etkin değil",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "Kayıt / uç bulunamadı",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "422": {
      "description": "Doğrulama hatası",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Dakikalık sınır aşıldı (Retry-After)",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   }
  },
  "/v2/documents/sales-orders": {
   "post": {
    "tags": [
     "Belgeler"
    ],
    "summary": "Satış siparişi (istek)",
    "parameters": [
     {
      "name": "Idempotency-Key",
      "in": "header",
      "schema": {
       "type": "string",
       "minLength": 8,
       "maxLength": 64
      },
      "description": "Aynı anahtarla tekrar gönderilen istek ikinci kez işlenmez (aynı request_id döner)."
     }
    ],
    "description": "**Gereken yetki:** `documents:write`\n\nFiyat verilmezse cariye özel / liste fiyatı. Program siparişi kendi numarasıyla açar.",
    "responses": {
     "202": {
      "description": "İstek alındı; program açıkken işlenir.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Queued"
        }
       }
      }
     },
     "401": {
      "description": "Anahtar yok / geçersiz / iptal",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "Yetki yok ya da bulut aboneliği etkin değil",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "Kayıt / uç bulunamadı",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "422": {
      "description": "Doğrulama hatası",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Dakikalık sınır aşıldı (Retry-After)",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object"
       },
       "example": {
        "party_id": 7,
        "lines": [
         {
          "product_id": 12,
          "qty": 2
         },
         {
          "product_id": 15,
          "qty": 1,
          "price": 499.9
         }
        ],
        "due_date": "2026-10-30",
        "note": "Web sitesinden"
       }
      }
     }
    }
   }
  },
  "/v2/documents/{id}/actions/{action}": {
   "post": {
    "tags": [
     "Belgeler"
    ],
    "summary": "Belge işlemi (istek)",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      }
     },
     {
      "name": "action",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "enum": [
        "status",
        "convert",
        "ship",
        "revise",
        "copy",
        "receive",
        "payment",
        "pdf",
        "return",
        "dispatch"
       ]
      }
     },
     {
      "name": "Idempotency-Key",
      "in": "header",
      "schema": {
       "type": "string",
       "minLength": 8,
       "maxLength": 64
      },
      "description": "Aynı anahtarla tekrar gönderilen istek ikinci kez işlenmez (aynı request_id döner)."
     }
    ],
    "description": "**Gereken yetki:** `documents:write`\n\nconvert ({target: order | sale}): teklifi siparişe / siparişi faturaya dönüştür · ship: sevk et (faturalı) · status ({status}) · dispatch: irsaliye kes · payment: tahsilat / ödeme · pdf: belge PDF'i.",
    "responses": {
     "202": {
      "description": "İstek alındı; program açıkken işlenir.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Queued"
        }
       }
      }
     },
     "401": {
      "description": "Anahtar yok / geçersiz / iptal",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "Yetki yok ya da bulut aboneliği etkin değil",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "Kayıt / uç bulunamadı",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "422": {
      "description": "Doğrulama hatası",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Dakikalık sınır aşıldı (Retry-After)",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object"
       },
       "example": {
        "target": "sale"
       }
      }
     }
    }
   }
  },
  "/v2/accounts": {
   "get": {
    "tags": [
     "Finans"
    ],
    "summary": "Kasa / banka hesapları",
    "parameters": [],
    "description": "**Gereken yetki:** `finance:read`\n\nBakiyeleriyle.",
    "responses": {
     "200": {
      "description": "Başarılı",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Single"
        }
       }
      }
     },
     "401": {
      "description": "Anahtar yok / geçersiz / iptal",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "Yetki yok ya da bulut aboneliği etkin değil",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "Kayıt / uç bulunamadı",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "422": {
      "description": "Doğrulama hatası",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Dakikalık sınır aşıldı (Retry-After)",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   }
  },
  "/v2/accounts/{id}/moves": {
   "get": {
    "tags": [
     "Finans"
    ],
    "summary": "Hesap hareketleri",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      }
     },
     {
      "name": "limit",
      "in": "query",
      "schema": {
       "type": "integer",
       "default": 100,
       "maximum": 500
      },
      "description": "Sayfa başına kayıt (en çok 500)."
     },
     {
      "name": "cursor",
      "in": "query",
      "schema": {
       "type": "string"
      },
      "description": "Önceki yanıttaki meta.pagination.next_cursor değeri. next_cursor null ise liste bitmiştir."
     }
    ],
    "description": "**Gereken yetki:** `finance:read`",
    "responses": {
     "200": {
      "description": "Başarılı",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/List"
        }
       }
      }
     },
     "401": {
      "description": "Anahtar yok / geçersiz / iptal",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "Yetki yok ya da bulut aboneliği etkin değil",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "Kayıt / uç bulunamadı",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "422": {
      "description": "Doğrulama hatası",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Dakikalık sınır aşıldı (Retry-After)",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   }
  },
  "/v2/reports/sales": {
   "get": {
    "tags": [
     "Raporlar"
    ],
    "summary": "Satış raporu",
    "parameters": [
     {
      "name": "from",
      "in": "query",
      "schema": {
       "type": "string"
      },
      "description": "Başlangıç (varsayılan: 30 gün önce)"
     },
     {
      "name": "to",
      "in": "query",
      "schema": {
       "type": "string"
      },
      "description": "Bitiş (varsayılan: bugün)"
     },
     {
      "name": "group",
      "in": "query",
      "schema": {
       "type": "string",
       "enum": [
        "day",
        "channel",
        "product"
       ]
      },
      "description": "day | channel | product"
     }
    ],
    "description": "**Gereken yetki:** `reports:read`\n\nPazaryeri / e-ticaret siparişleri; iptal / iade edilenler hariç. En çok 400 gün.",
    "responses": {
     "200": {
      "description": "Başarılı",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Single"
        }
       }
      }
     },
     "401": {
      "description": "Anahtar yok / geçersiz / iptal",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "Yetki yok ya da bulut aboneliği etkin değil",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "Kayıt / uç bulunamadı",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "422": {
      "description": "Doğrulama hatası",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Dakikalık sınır aşıldı (Retry-After)",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   }
  },
  "/v2/reports/finance": {
   "get": {
    "tags": [
     "Raporlar"
    ],
    "summary": "Finans özeti",
    "parameters": [],
    "description": "**Gereken yetki:** `reports:read`\n\nKasa / banka toplamları, vade analizi (aging), nakit akışı tahmini, aylık özet — programda hesaplanır.",
    "responses": {
     "200": {
      "description": "Başarılı",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Single"
        }
       }
      }
     },
     "401": {
      "description": "Anahtar yok / geçersiz / iptal",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "Yetki yok ya da bulut aboneliği etkin değil",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "Kayıt / uç bulunamadı",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "422": {
      "description": "Doğrulama hatası",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Dakikalık sınır aşıldı (Retry-After)",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   }
  },
  "/v2/reports/store-health": {
   "get": {
    "tags": [
     "Raporlar"
    ],
    "summary": "Mağaza sağlığı",
    "parameters": [],
    "description": "**Gereken yetki:** `reports:read`\n\nKanal bazında 100 üzerinden puan: soru cevap hızı, iptal / iade oranı, geciken kargo, buybox payı, faturasız sipariş.",
    "responses": {
     "200": {
      "description": "Başarılı",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Single"
        }
       }
      }
     },
     "401": {
      "description": "Anahtar yok / geçersiz / iptal",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "Yetki yok ya da bulut aboneliği etkin değil",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "Kayıt / uç bulunamadı",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "422": {
      "description": "Doğrulama hatası",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Dakikalık sınır aşıldı (Retry-After)",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   }
  },
  "/v2/reports/cash-calendar": {
   "get": {
    "tags": [
     "Raporlar"
    ],
    "summary": "Nakit takvimi",
    "parameters": [],
    "description": "**Gereken yetki:** `reports:read`\n\nÖnümüzdeki günlerin beklenen giriş / çıkışı ve bakiye seyri.",
    "responses": {
     "200": {
      "description": "Başarılı",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Single"
        }
       }
      }
     },
     "401": {
      "description": "Anahtar yok / geçersiz / iptal",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "Yetki yok ya da bulut aboneliği etkin değil",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "Kayıt / uç bulunamadı",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "422": {
      "description": "Doğrulama hatası",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Dakikalık sınır aşıldı (Retry-After)",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   }
  },
  "/v2/reports/settlement": {
   "get": {
    "tags": [
     "Raporlar"
    ],
    "summary": "Hakediş",
    "parameters": [],
    "description": "**Gereken yetki:** `reports:read`\n\nPazaryeri hakediş özeti ve farklar.",
    "responses": {
     "200": {
      "description": "Başarılı",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Single"
        }
       }
      }
     },
     "401": {
      "description": "Anahtar yok / geçersiz / iptal",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "Yetki yok ya da bulut aboneliği etkin değil",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "Kayıt / uç bulunamadı",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "422": {
      "description": "Doğrulama hatası",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Dakikalık sınır aşıldı (Retry-After)",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   }
  },
  "/v2/schema": {
   "get": {
    "tags": [
     "Genel kayıt uçları"
    ],
    "summary": "Kayıt türleri ve alanları",
    "parameters": [],
    "description": "Panelle aynı kayıt türleri (ürün, cari, belge, gider, aktivite, CRM, üretim...): alanlar, seçenekler, işlemler ve gereken yetki. Alan listesi programdan gelir.",
    "responses": {
     "200": {
      "description": "Başarılı",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Single"
        }
       }
      }
     },
     "401": {
      "description": "Anahtar yok / geçersiz / iptal",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "Yetki yok ya da bulut aboneliği etkin değil",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "Kayıt / uç bulunamadı",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "422": {
      "description": "Doğrulama hatası",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Dakikalık sınır aşıldı (Retry-After)",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   }
  },
  "/v2/records/{entity}": {
   "post": {
    "tags": [
     "Genel kayıt uçları"
    ],
    "summary": "Kayıt oluştur (istek)",
    "parameters": [
     {
      "name": "entity",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "Idempotency-Key",
      "in": "header",
      "schema": {
       "type": "string",
       "minLength": 8,
       "maxLength": 64
      },
      "description": "Aynı anahtarla tekrar gönderilen istek ikinci kez işlenmez (aynı request_id döner)."
     }
    ],
    "description": "**Gereken yetki:** `<türün kaynağı>:write`\n\nentity: GET /schema anahtarlarından biri.",
    "responses": {
     "202": {
      "description": "İstek alındı; program açıkken işlenir.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Queued"
        }
       }
      }
     },
     "401": {
      "description": "Anahtar yok / geçersiz / iptal",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "Yetki yok ya da bulut aboneliği etkin değil",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "Kayıt / uç bulunamadı",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "422": {
      "description": "Doğrulama hatası",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Dakikalık sınır aşıldı (Retry-After)",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object"
       },
       "example": {
        "values": {
         "description": "Ofis kirası",
         "amount": 15000,
         "category": "Kira"
        }
       }
      }
     }
    }
   }
  },
  "/v2/records/{entity}/{id}": {
   "patch": {
    "tags": [
     "Genel kayıt uçları"
    ],
    "summary": "Kayıt güncelle (istek)",
    "parameters": [
     {
      "name": "entity",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      }
     },
     {
      "name": "Idempotency-Key",
      "in": "header",
      "schema": {
       "type": "string",
       "minLength": 8,
       "maxLength": 64
      },
      "description": "Aynı anahtarla tekrar gönderilen istek ikinci kez işlenmez (aynı request_id döner)."
     }
    ],
    "description": "**Gereken yetki:** `<türün kaynağı>:write`",
    "responses": {
     "202": {
      "description": "İstek alındı; program açıkken işlenir.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Queued"
        }
       }
      }
     },
     "401": {
      "description": "Anahtar yok / geçersiz / iptal",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "Yetki yok ya da bulut aboneliği etkin değil",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "Kayıt / uç bulunamadı",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "422": {
      "description": "Doğrulama hatası",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Dakikalık sınır aşıldı (Retry-After)",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object"
       },
       "example": {
        "values": {
         "amount": 16000
        },
        "orig": {
         "amount": 15000
        }
       }
      }
     }
    }
   },
   "delete": {
    "tags": [
     "Genel kayıt uçları"
    ],
    "summary": "Kayıt sil (istek)",
    "parameters": [
     {
      "name": "entity",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      }
     },
     {
      "name": "Idempotency-Key",
      "in": "header",
      "schema": {
       "type": "string",
       "minLength": 8,
       "maxLength": 64
      },
      "description": "Aynı anahtarla tekrar gönderilen istek ikinci kez işlenmez (aynı request_id döner)."
     }
    ],
    "description": "**Gereken yetki:** `<türün kaynağı>:write`",
    "responses": {
     "202": {
      "description": "İstek alındı; program açıkken işlenir.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Queued"
        }
       }
      }
     },
     "401": {
      "description": "Anahtar yok / geçersiz / iptal",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "Yetki yok ya da bulut aboneliği etkin değil",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "Kayıt / uç bulunamadı",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "422": {
      "description": "Doğrulama hatası",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Dakikalık sınır aşıldı (Retry-After)",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   }
  },
  "/v2/records/{entity}/{id}/actions/{action}": {
   "post": {
    "tags": [
     "Genel kayıt uçları"
    ],
    "summary": "Kayıt işlemi (istek)",
    "parameters": [
     {
      "name": "entity",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      }
     },
     {
      "name": "action",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "Idempotency-Key",
      "in": "header",
      "schema": {
       "type": "string",
       "minLength": 8,
       "maxLength": 64
      },
      "description": "Aynı anahtarla tekrar gönderilen istek ikinci kez işlenmez (aynı request_id döner)."
     }
    ],
    "description": "**Gereken yetki:** `<türün kaynağı>:write`\n\nİşlem adları: GET /schema → actions.",
    "responses": {
     "202": {
      "description": "İstek alındı; program açıkken işlenir.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Queued"
        }
       }
      }
     },
     "401": {
      "description": "Anahtar yok / geçersiz / iptal",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "Yetki yok ya da bulut aboneliği etkin değil",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "Kayıt / uç bulunamadı",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "422": {
      "description": "Doğrulama hatası",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Dakikalık sınır aşıldı (Retry-After)",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object"
       },
       "example": {
        "values": {}
       }
      }
     }
    }
   }
  },
  "/v2/requests": {
   "get": {
    "tags": [
     "İstekler"
    ],
    "summary": "Bu anahtarın istekleri",
    "parameters": [
     {
      "name": "limit",
      "in": "query",
      "schema": {
       "type": "integer",
       "default": 100,
       "maximum": 500
      },
      "description": "Sayfa başına kayıt (en çok 500)."
     },
     {
      "name": "cursor",
      "in": "query",
      "schema": {
       "type": "string"
      },
      "description": "Önceki yanıttaki meta.pagination.next_cursor değeri. next_cursor null ise liste bitmiştir."
     },
     {
      "name": "status",
      "in": "query",
      "schema": {
       "type": "string"
      },
      "description": "bekliyor | islendi | hata"
     }
    ],
    "description": "",
    "responses": {
     "200": {
      "description": "Başarılı",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/List"
        }
       }
      }
     },
     "401": {
      "description": "Anahtar yok / geçersiz / iptal",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "Yetki yok ya da bulut aboneliği etkin değil",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "Kayıt / uç bulunamadı",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "422": {
      "description": "Doğrulama hatası",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Dakikalık sınır aşıldı (Retry-After)",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   }
  },
  "/v2/requests/{id}": {
   "get": {
    "tags": [
     "İstekler"
    ],
    "summary": "İstek durumu",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      }
     }
    ],
    "description": "status: bekliyor → islendi | hata. message: programın sonucu, ref: oluşan kayıt (ör. belge no), target: 'tür:id'.",
    "responses": {
     "200": {
      "description": "Başarılı",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Single"
        }
       }
      }
     },
     "401": {
      "description": "Anahtar yok / geçersiz / iptal",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "Yetki yok ya da bulut aboneliği etkin değil",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "Kayıt / uç bulunamadı",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "422": {
      "description": "Doğrulama hatası",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Dakikalık sınır aşıldı (Retry-After)",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   }
  },
  "/v2/webhooks": {
   "get": {
    "tags": [
     "Webhook"
    ],
    "summary": "Tanımlı webhook adresleri",
    "parameters": [],
    "description": "Adresler programda Ayarlar > Bulut > API anahtarları > Webhook'lar bölümünden eklenir (imza anahtarı orada).",
    "responses": {
     "200": {
      "description": "Başarılı",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Single"
        }
       }
      }
     },
     "401": {
      "description": "Anahtar yok / geçersiz / iptal",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "Yetki yok ya da bulut aboneliği etkin değil",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "Kayıt / uç bulunamadı",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "422": {
      "description": "Doğrulama hatası",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Dakikalık sınır aşıldı (Retry-After)",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   }
  }
 },
 "webhooks": {
  "order.created": {
   "post": {
    "tags": [
     "Webhook"
    ],
    "summary": "Yeni pazaryeri / e-ticaret siparişi geldi",
    "description": "Gövde: {id, event, created_at, firm, data}. data: ilgili kaydın API biçimi (değişikliklerde data.changes: {alan: {from, to}}).",
    "requestBody": {
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/WebhookEvent"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "2xx: teslim alındı"
     }
    }
   }
  },
  "order.updated": {
   "post": {
    "tags": [
     "Webhook"
    ],
    "summary": "Siparişin durumu, kargo kodu ya da faturası değişti",
    "description": "Gövde: {id, event, created_at, firm, data}. data: ilgili kaydın API biçimi (değişikliklerde data.changes: {alan: {from, to}}).",
    "requestBody": {
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/WebhookEvent"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "2xx: teslim alındı"
     }
    }
   }
  },
  "product.updated": {
   "post": {
    "tags": [
     "Webhook"
    ],
    "summary": "Ürün kartı değişti (ad, fiyat, barkod...)",
    "description": "Gövde: {id, event, created_at, firm, data}. data: ilgili kaydın API biçimi (değişikliklerde data.changes: {alan: {from, to}}).",
    "requestBody": {
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/WebhookEvent"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "2xx: teslim alındı"
     }
    }
   }
  },
  "stock.changed": {
   "post": {
    "tags": [
     "Webhook"
    ],
    "summary": "Ürünün stoğu değişti",
    "description": "Gövde: {id, event, created_at, firm, data}. data: ilgili kaydın API biçimi (değişikliklerde data.changes: {alan: {from, to}}).",
    "requestBody": {
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/WebhookEvent"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "2xx: teslim alındı"
     }
    }
   }
  },
  "listing.updated": {
   "post": {
    "tags": [
     "Webhook"
    ],
    "summary": "Pazaryeri ilanının fiyatı, stoğu ya da durumu değişti",
    "description": "Gövde: {id, event, created_at, firm, data}. data: ilgili kaydın API biçimi (değişikliklerde data.changes: {alan: {from, to}}).",
    "requestBody": {
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/WebhookEvent"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "2xx: teslim alındı"
     }
    }
   }
  },
  "question.created": {
   "post": {
    "tags": [
     "Webhook"
    ],
    "summary": "Yeni müşteri sorusu geldi",
    "description": "Gövde: {id, event, created_at, firm, data}. data: ilgili kaydın API biçimi (değişikliklerde data.changes: {alan: {from, to}}).",
    "requestBody": {
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/WebhookEvent"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "2xx: teslim alındı"
     }
    }
   }
  },
  "claim.created": {
   "post": {
    "tags": [
     "Webhook"
    ],
    "summary": "Yeni iade talebi geldi",
    "description": "Gövde: {id, event, created_at, firm, data}. data: ilgili kaydın API biçimi (değişikliklerde data.changes: {alan: {from, to}}).",
    "requestBody": {
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/WebhookEvent"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "2xx: teslim alındı"
     }
    }
   }
  },
  "document.created": {
   "post": {
    "tags": [
     "Webhook"
    ],
    "summary": "Yeni teklif / sipariş / fatura / irsaliye oluştu",
    "description": "Gövde: {id, event, created_at, firm, data}. data: ilgili kaydın API biçimi (değişikliklerde data.changes: {alan: {from, to}}).",
    "requestBody": {
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/WebhookEvent"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "2xx: teslim alındı"
     }
    }
   }
  },
  "party.created": {
   "post": {
    "tags": [
     "Webhook"
    ],
    "summary": "Yeni cari (müşteri / tedarikçi) açıldı",
    "description": "Gövde: {id, event, created_at, firm, data}. data: ilgili kaydın API biçimi (değişikliklerde data.changes: {alan: {from, to}}).",
    "requestBody": {
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/WebhookEvent"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "2xx: teslim alındı"
     }
    }
   }
  },
  "request.completed": {
   "post": {
    "tags": [
     "Webhook"
    ],
    "summary": "API ya da panelden gönderilen istek programda işlendi (başarılı / hatalı)",
    "description": "Gövde: {id, event, created_at, firm, data}. data: ilgili kaydın API biçimi (değişikliklerde data.changes: {alan: {from, to}}).",
    "requestBody": {
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/WebhookEvent"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "2xx: teslim alındı"
     }
    }
   }
  }
 },
 "components": {
  "securitySchemes": {
   "bearer": {
    "type": "http",
    "scheme": "bearer",
    "bearerFormat": "pzm_<FİRMA>_<anahtar>",
    "description": "Programda Ayarlar > Bulut > API anahtarları."
   }
  },
  "schemas": {
   "Single": {
    "type": "object",
    "properties": {
     "data": {
      "type": "object"
     }
    }
   },
   "List": {
    "type": "object",
    "properties": {
     "data": {
      "type": "array",
      "items": {
       "type": "object"
      }
     },
     "meta": {
      "type": "object",
      "properties": {
       "pagination": {
        "type": "object",
        "properties": {
         "limit": {
          "type": "integer"
         },
         "next_cursor": {
          "type": [
           "string",
           "null"
          ]
         }
        }
       }
      }
     }
    }
   },
   "Queued": {
    "type": "object",
    "properties": {
     "data": {
      "type": "object",
      "properties": {
       "request_id": {
        "type": "integer"
       },
       "status": {
        "type": "string",
        "example": "bekliyor"
       },
       "status_url": {
        "type": "string"
       },
       "message": {
        "type": "string"
       }
      }
     }
    }
   },
   "Error": {
    "type": "object",
    "properties": {
     "error": {
      "type": "object",
      "properties": {
       "code": {
        "type": "string"
       },
       "message": {
        "type": "string"
       },
       "request_id": {
        "type": "string"
       },
       "details": {}
      }
     }
    }
   },
   "WebhookEvent": {
    "type": "object",
    "properties": {
     "id": {
      "type": "string",
      "format": "uuid"
     },
     "event": {
      "type": "string",
      "enum": [
       "order.created",
       "order.updated",
       "product.updated",
       "stock.changed",
       "listing.updated",
       "question.created",
       "claim.created",
       "document.created",
       "party.created",
       "request.completed",
       "ping"
      ]
     },
     "created_at": {
      "type": "string",
      "format": "date-time"
     },
     "firm": {
      "type": "string"
     },
     "data": {
      "type": "object"
     },
     "test": {
      "type": "boolean"
     }
    }
   }
  }
 }
}