{"openapi":"3.1.0","info":{"title":"Yazilimal Public API","version":"1.0.0","description":"Lisans dogrulama/aktivasyon ve bayi (reseller) musteri yonetimi uclari. Yalnizca ucuncu taraf entegrasyonu icin acilan uclar burada listelenir.","contact":{"url":"https://yazilimal.com/contact"}},"servers":[{"url":"https://yazilimal.com","description":"Production"}],"tags":[{"name":"license","description":"Uygulama lisansi dogrulama ve aktivasyon"},{"name":"reseller","description":"Bayi musteri kayitlari (B2B)"}],"paths":{"/api/v1/license/activate":{"post":{"tags":["license"],"summary":"Lisansi bir makineye aktive eder","description":"Lisans ilk kez kullanildiginda cagrilir ve lisansi verilen machineId'ye kilitler. Ayni machineId ile tekrar cagrilmasi guvenlidir (idempotent). Kimlik dogrulama ayri bir anahtarla degil, gonderilen lisans kodunun kendisiyle yapilir. Hiz siniri: IP basina dakikada 10 istek.","security":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LicenseRequest"}}}},"responses":{"200":{"description":"Aktivasyon basarili","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ActivateSuccess"}}}},"400":{"$ref":"#/components/responses/LicenseError"},"403":{"description":"Lisans iptal edilmis veya suresi dolmus","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LicenseFailure"}}}},"404":{"$ref":"#/components/responses/LicenseError"},"409":{"description":"Lisans baska bir makineye kayitli","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LicenseFailure"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/LicenseError"}}}},"/api/v1/license/verify":{"post":{"tags":["license"],"summary":"Lisansin gecerliligini dogrular","description":"Uygulama acilisinda veya periyodik olarak cagrilir. Aktive edilmemis lisans icin valid=false doner; once /api/v1/license/activate cagrilmalidir. Gecersiz lisansta da HTTP 200 doner — sonuc govdedeki `valid` alanindadir. Hiz siniri: IP basina dakikada 10 istek.","security":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LicenseRequest"}}}},"responses":{"200":{"description":"Dogrulama sonucu. `valid` alani true ise lisans gecerlidir; false ise `reason` sebebi aciklar.","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/VerifySuccess"},{"$ref":"#/components/schemas/VerifyFailure"}]}}}},"400":{"description":"key veya machineId eksik","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VerifyFailure"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"description":"Sunucu hatasi","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VerifyFailure"}}}}}}},"/api/v1/reseller/clients":{"get":{"tags":["reseller"],"summary":"Bayinin musteri kayitlarini listeler","description":"Yalnizca anahtarin sahibi olan bayinin kayitlari doner. Hiz siniri: IP basina dakikada 120 istek.","security":[{"ResellerApiKey":[]}],"responses":{"200":{"description":"Musteri listesi","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true},"clients":{"type":"array","items":{"$ref":"#/components/schemas/ResellerClient"}}},"required":["success","clients"]}}}},"401":{"$ref":"#/components/responses/ResellerUnauthorized"},"403":{"$ref":"#/components/responses/ResellerDisabled"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/GenericError"}}},"post":{"tags":["reseller"],"summary":"Yeni bayi musterisi olusturur","description":"Her kayit bayi kredisinden 50 kredi duser. Kredi yetersizse 402 doner ve kayit olusmaz. Ayni clientDomain ikinci kez gonderilirse 409 doner. Hiz siniri: IP basina dakikada 120 istek.","security":[{"ResellerApiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"clientDomain":{"type":"string","description":"Musterinin alan adi","examples":["musteri-alan-adi.com"]}},"required":["clientDomain"]}}}},"responses":{"201":{"description":"Musteri olusturuldu","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true},"message":{"type":"string"},"client":{"$ref":"#/components/schemas/ResellerClient"}},"required":["success","client"]}}}},"400":{"$ref":"#/components/responses/GenericError"},"401":{"$ref":"#/components/responses/ResellerUnauthorized"},"402":{"description":"Bayi kredisi yetersiz","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"$ref":"#/components/responses/ResellerDisabled"},"409":{"description":"Bu alan adi zaten kayitli","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/GenericError"}}}}},"components":{"securitySchemes":{"ResellerApiKey":{"type":"apiKey","in":"header","name":"x-reseller-key","description":"Bayi panelinizden alinan API anahtari. Sunucu tarafinda saklanmali; tarayici kodunda kullanilmamalidir."}},"schemas":{"LicenseRequest":{"type":"object","properties":{"key":{"type":"string","description":"Musteriye verilen lisans kodu","examples":["XXXX-XXXX-XXXX-XXXX"]},"machineId":{"type":"string","description":"Kurulumun bulundugu makineyi tanimlayan kararli bir kimlik (ornegin donanim kimliginin karmasi). Ayni makinede her zaman ayni degeri uretmelidir.","examples":["makine-kimliginin-karmasi"]}},"required":["key","machineId"]},"ActivateSuccess":{"type":"object","properties":{"ok":{"type":"boolean","const":true},"reason":{"type":"string"},"expiresAt":{"type":["string","null"],"format":"date-time","description":"null ise lisans suresizdir"},"customerName":{"type":["string","null"]},"productSlug":{"type":["string","null"]}},"required":["ok"]},"LicenseFailure":{"type":"object","properties":{"ok":{"type":"boolean","const":false},"reason":{"type":"string","description":"Kullaniciya gosterilebilir sebep"}},"required":["ok","reason"]},"VerifySuccess":{"type":"object","properties":{"valid":{"type":"boolean","const":true},"reason":{"type":"string","examples":["OK"]},"expiresAt":{"type":["string","null"],"format":"date-time"},"customerName":{"type":["string","null"]},"productSlug":{"type":["string","null"]}},"required":["valid"]},"VerifyFailure":{"type":"object","properties":{"valid":{"type":"boolean","const":false},"reason":{"type":"string"}},"required":["valid","reason"]},"ResellerClient":{"type":"object","properties":{"id":{"type":"string"},"clientDomain":{"type":"string"},"status":{"type":"string","examples":["ACTIVE"]},"createdAt":{"type":"string","format":"date-time"}}},"Error":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}},"responses":{"RateLimited":{"description":"Hiz siniri asildi. Retry-After basligina bakin.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"ResellerUnauthorized":{"description":"API anahtari eksik veya gecersiz","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"ResellerDisabled":{"description":"Bayi agi su anda kapali","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"GenericError":{"description":"Istek gecersiz veya sunucu hatasi","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"LicenseError":{"description":"Istek gecersiz, lisans bulunamadi veya sunucu hatasi","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LicenseFailure"}}}}}}}