{
  "openapi": "3.1.0",
  "info": {
    "title": "KiralamaMerkezi API",
    "version": "1.0.0",
    "description": "KiralamaMerkezi envanter, kiralama, tahsilat ve rapor verilerine firma kapsamlı API anahtarıyla erişim."
  },
  "servers": [
    {
      "url": "https://kiralamamerkezi.pages.dev/api"
    }
  ],
  "security": [
    {
      "EnvanterApiKey": []
    }
  ],
  "paths": {
    "/api-proxy": {
      "post": {
        "summary": "KiralamaMerkezi veri işlemi",
        "operationId": "kiralamamerkeziEylem",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Islem"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Başarılı yanıt",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Yanit"
                }
              }
            }
          },
          "400": {
            "description": "Geçersiz istek"
          },
          "401": {
            "description": "API anahtarı gerekli"
          },
          "403": {
            "description": "Paket veya firma erişimi reddedildi"
          },
          "404": {
            "description": "Kayıt bulunamadı"
          },
          "429": {
            "description": "Kota aşıldı"
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "EnvanterApiKey": {
        "type": "apiKey",
        "in": "header",
        "name": "x-kiralama-api-key",
        "description": "Ayarlar > API Anahtarları bölümünden alınan krm_ anahtarı. Bearer başlığı da desteklenir."
      }
    },
    "schemas": {
      "Islem": {
        "oneOf": [
          {
            "type": "object",
            "required": [
              "islem"
            ],
            "properties": {
              "islem": {
                "const": "durum"
              }
            }
          },
          {
            "type": "object",
            "required": [
              "islem",
              "alan"
            ],
            "properties": {
              "islem": {
                "enum": [
                  "liste"
                ]
              },
              "alan": {
                "$ref": "#/components/schemas/Alan"
              }
            }
          },
          {
            "type": "object",
            "required": [
              "islem",
              "alan",
              "kayit"
            ],
            "properties": {
              "islem": {
                "enum": [
                  "ekle",
                  "guncelle"
                ]
              },
              "alan": {
                "$ref": "#/components/schemas/Alan"
              },
              "id": {
                "type": "string",
                "format": "uuid"
              },
              "kayit": {
                "type": "object",
                "additionalProperties": true
              }
            }
          },
          {
            "type": "object",
            "required": [
              "islem",
              "alan",
              "id"
            ],
            "properties": {
              "islem": {
                "const": "sil"
              },
              "alan": {
                "$ref": "#/components/schemas/Alan"
              },
              "id": {
                "type": "string",
                "format": "uuid"
              }
            }
          }
        ]
      },
      "Alan": {
        "type": "string",
        "enum": [
          "ekipmanlar",
          "araclar",
          "musteriler",
          "kiralamalar",
          "teklifler",
          "teklifKalemleri",
          "kalemler",
          "odemeler",
          "giderler",
          "giderKategorileri",
          "bakimlar",
          "sigortalar",
          "sigortaTaksitleri",
          "ortaklar",
          "ortakHareketleri",
          "cariKayitlari",
          "rezervasyonlar"
        ]
      },
      "Yanit": {
        "type": "object",
        "additionalProperties": true
      }
    }
  }
}
