{
  "openapi": "3.1.0",
  "info": {
    "title": "Hicret Kutu Contact API",
    "description": "AI agentler, GPT Actions, Custom GPT'ler ve otomasyon araçları için Hicret Kutu iletişim ve teklif talebi API'si.",
    "version": "1.0.0",
    "contact": {
      "name": "Hicret Kutu",
      "email": "info@hicretkutu.com",
      "url": "https://hicretkutu.com"
    }
  },
  "servers": [
    {
      "url": "https://hicretkutu.com/api/v1",
      "description": "Production Server"
    }
  ],
  "paths": {
    "/contact": {
      "post": {
        "operationId": "submitContactForm",
        "summary": "İletişim formu / teklif talebi gönder",
        "description": "Hicret Kutu satış ekibine müşteri iletişim mesajı veya teklif talebi gönderir. Rate limit: dakikada 5 istek.",
        "tags": ["Contact"],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": { "$ref": "#/components/schemas/ContactRequest" },
              "examples": {
                "quoteRequest": {
                  "summary": "Teklif Talebi Örneği",
                  "value": {
                    "name": "Ahmet Yılmaz",
                    "email": "ahmet@sirket.com",
                    "phone": "+905551234567",
                    "company": "ABC Gıda A.Ş.",
                    "subject": "Fast Food Kutusu Teklif Talebi",
                    "message": "Merhaba, burger ambalajı için 5.000 adet teklif almak istiyorum. Boyut: 15x15x8 cm, logo baskılı.",
                    "dimensions": "15x15x8",
                    "quantity": "5000",
                    "inquiryType": "quote_request",
                    "agentContext": { "agentName": "Claude", "agentUserConsent": true }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Talep başarıyla alındı",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/ContactResponse" }
              }
            }
          },
          "400": {
            "description": "Doğrulama hatası — zorunlu alan eksik veya geçersiz format",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/ErrorResponse" }
              }
            }
          },
          "429": {
            "description": "Rate limit aşıldı — 1 dakika sonra tekrar deneyin",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/ErrorResponse" }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "ContactRequest": {
        "type": "object",
        "required": ["name", "email", "message"],
        "properties": {
          "name": { "type": "string", "description": "Müşteri adı veya firma adı", "minLength": 2, "maxLength": 100, "example": "Ahmet Yılmaz" },
          "email": { "type": "string", "format": "email", "description": "İletişim e-posta adresi", "example": "ahmet@sirket.com" },
          "phone": { "type": "string", "description": "Telefon numarası (uluslararası format)", "example": "+905551234567" },
          "company": { "type": "string", "description": "Şirket veya marka adı", "example": "ABC Gıda A.Ş." },
          "subject": { "type": "string", "description": "Mesaj konu başlığı", "maxLength": 200 },
          "message": { "type": "string", "description": "Mesaj içeriği — teklif için boyut, adet ve baskı detaylarını belirtin", "minLength": 10, "maxLength": 5000 },
          "dimensions": { "type": "string", "description": "Kutu ölçüleri — format: En x Boy x Yükseklik cm", "example": "15x15x8" },
          "quantity": { "type": "string", "description": "İstenilen adet", "example": "5000" },
          "inquiryType": { "type": "string", "enum": ["quote_request", "general_inquiry", "support"], "default": "general_inquiry" },
          "agentContext": {
            "type": "object",
            "description": "AI agent tarafından gönderiliyorsa agent metadata",
            "properties": {
              "agentName": { "type": "string", "example": "Claude" },
              "agentUserConsent": { "type": "boolean", "example": true }
            }
          }
        }
      },
      "ContactResponse": {
        "type": "object",
        "properties": {
          "success": { "type": "boolean", "example": true },
          "ticketId": { "type": "string", "example": "HK-1725055200000" },
          "estimatedResponseTime": { "type": "string", "example": "24 saat" },
          "message": { "type": "string", "example": "Talebiniz başarıyla alındı." }
        }
      },
      "ErrorResponse": {
        "type": "object",
        "properties": {
          "success": { "type": "boolean", "example": false },
          "error": { "type": "string" },
          "missingFields": { "type": "array", "items": { "type": "string" } }
        }
      }
    }
  }
}
