{"openapi":"3.1.0","info":{"title":"Daha İyi Partner API","version":"1.0.0","description":"Markanın kasa, e-ticaret ya da sipariş sistemi için kod doğrulama, kullanım ve iade bildirimi, kampanya ve kullanım listesi. Tutarlar kuruş, zamanlar ISO 8601. Ayrıntılı rehber: /gelistiriciler. Her istek üç başlıkla imzalanır: `X-Daha-Key` (anahtar kimliği), `X-Daha-Timestamp` (unix saniye) ve `X-Daha-Signature: v1=<hex(HMAC-SHA256(sır, kanonik dize))>`. Kanonik dize `zaman + \".\" + YÖNTEM + \".\" + yol?sorgu + \".\" + ham gövde`: yöntem büyük harf, yol istek satırındaki hâliyle (`/v1` öneki, harf düzeni ve sorgu dizesi dahil), gövdesiz istekte gövde boş dize. HMAC anahtarı sırrın UTF-8 baytlarıdır. Zaman sunucu saatinden en fazla 5 dakika sapabilir; aynı imza 10 dakika içinde ikinci kez kabul edilmez (tekrar denemede yeni zamanla yeniden imzalayın). Her kimlik hatası `401 AUTH_FAILED` döner. Anahtar başına dakikada 600 istek (`429 RATE_LIMITED`)."},"jsonSchemaDialect":"https://json-schema.org/draft/2020-12/schema","servers":[{"url":"/v1"}],"security":[{"DahaKey":[],"DahaTimestamp":[],"DahaSignature":[]}],"paths":{"/partner/ping":{"get":{"operationId":"ping","summary":"Anahtar ve imzayı dene","description":"İmza doğruysa anahtarın modu, kimliği ve markası döner.","x-modes":["live","test"],"responses":{"200":{"description":"Anahtar geçerli.","headers":{"Cache-Control":{"description":"Her zaman `no-store`.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/PingResult"}},"required":["data"],"additionalProperties":false}}}},"401":{"description":"Kimlik doğrulama başarısız; neden panelin İstek Logu'nda.","x-codes":["AUTH_FAILED"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Uç bu anahtar modunu kabul etmiyor.","x-codes":["MODE_NOT_ALLOWED"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"İstek sınırı aşıldı; `retryAfter` saniye sonra yeniden imzalayıp deneyin.","x-codes":["RATE_LIMITED","TOO_MANY_FAILURES"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/partner/codes/verify":{"post":{"operationId":"verifyCode","summary":"Kodu doğrula","description":"Kod bu markanın mı, şu an kullanılabilir mi. Canlı anahtar markanın kampanyalarındaki kodlara, test anahtarı markanın test kodlarına bakar. Yanıt her zaman 200; geçersizse `valid: false` ve `reason`.","x-modes":["live","test"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VerifyCodeRequest"}}}},"responses":{"200":{"description":"Doğrulama sonucu.","headers":{"Cache-Control":{"description":"Her zaman `no-store`.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/VerifyResult"}},"required":["data"],"additionalProperties":false}}}},"400":{"description":"Gövde geçersiz.","x-codes":["INVALID_JSON"],"content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ValidationError"},{"$ref":"#/components/schemas/ApiError"}]}}}},"401":{"description":"Kimlik doğrulama başarısız; neden panelin İstek Logu'nda.","x-codes":["AUTH_FAILED"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Uç bu anahtar modunu kabul etmiyor.","x-codes":["MODE_NOT_ALLOWED"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"413":{"description":"Gövde 100 KB'tan büyük.","x-codes":["BODY_TOO_LARGE"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"415":{"description":"Gövde `application/json` değil.","x-codes":["JSON_REQUIRED"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"İstek sınırı aşıldı; `retryAfter` saniye sonra yeniden imzalayıp deneyin.","x-codes":["RATE_LIMITED","TOO_MANY_FAILURES","TOO_MANY_CODE_FAILURES"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"503":{"description":"Sınır sayacına ulaşılamadı; kısa süre sonra deneyin.","x-codes":["SERVICE_UNAVAILABLE"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/partner/redemptions":{"get":{"operationId":"listRedemptions","summary":"Kullanımları listele","description":"Anahtarın markası ve modundaki kullanımlar, en yeni kayıt önce. Partner API (`source: webhook`) ve mağaza kasiyeri (`source: cashier`, `externalRef` `cashier:` önekli) kullanımları birlikte döner. Kullanıcı, kasiyer ve kod bilgisi dönmez.","x-modes":["live","test"],"parameters":[{"name":"from","in":"query","required":false,"description":"`redeemedAt` alt sınırı (dahil).","schema":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"}},{"name":"to","in":"query","required":false,"description":"`redeemedAt` üst sınırı (hariç); `from`'dan sonra olmalı, `from` ile en fazla 366 gün.","schema":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"}},{"name":"status","in":"query","required":false,"description":"Duruma göre süzer.","schema":{"type":"string","enum":["verified","reversed"]}},{"name":"limit","in":"query","required":false,"description":"Sayfa boyutu.","schema":{"default":50,"type":"integer","minimum":1,"maximum":100}},{"name":"cursor","in":"query","required":false,"description":"Önceki sayfanın `nextCursor` değeri.","schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"responses":{"200":{"description":"Kullanım sayfası.","headers":{"Cache-Control":{"description":"Her zaman `no-store`.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/RedemptionPage"}},"required":["data"],"additionalProperties":false}}}},"400":{"description":"Sorgu geçersiz.","x-codes":[],"content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ValidationError"},{"$ref":"#/components/schemas/ApiError"}]}}}},"401":{"description":"Kimlik doğrulama başarısız; neden panelin İstek Logu'nda.","x-codes":["AUTH_FAILED"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Uç bu anahtar modunu kabul etmiyor.","x-codes":["MODE_NOT_ALLOWED"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"İstek sınırı aşıldı; `retryAfter` saniye sonra yeniden imzalayıp deneyin.","x-codes":["RATE_LIMITED","TOO_MANY_FAILURES"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}},"post":{"operationId":"createRedemption","summary":"Kullanım bildir","description":"Kodun bir siparişte kullanıldığını bildirir. `externalRef` marka ve mod içinde idempotency anahtarıdır: aynı gövdeyle tekrar 200 ve `Idempotent-Replayed: true`, farklı gövdeyle `409 IDEMPOTENCY_CONFLICT`.","x-modes":["live","test"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateRedemptionRequest"}}}},"responses":{"200":{"description":"Tekrar: kaydın güncel hâli.","headers":{"Cache-Control":{"description":"Her zaman `no-store`.","schema":{"type":"string"}},"Idempotent-Replayed":{"description":"Tekrar (idempotent) yanıtında `true`.","schema":{"type":"string","const":"true"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Redemption"}},"required":["data"],"additionalProperties":false}}}},"201":{"description":"Kullanım kaydedildi.","headers":{"Cache-Control":{"description":"Her zaman `no-store`.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Redemption"}},"required":["data"],"additionalProperties":false}}}},"400":{"description":"Gövde ya da kullanım kuralı geçersiz.","x-codes":["REDEEMED_AT_INVALID","DISCOUNT_TOO_HIGH","MIN_BASKET_NOT_MET","INVALID_JSON"],"content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ValidationError"},{"$ref":"#/components/schemas/ApiError"}]}}}},"401":{"description":"Kimlik doğrulama başarısız; neden panelin İstek Logu'nda.","x-codes":["AUTH_FAILED"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Uç bu anahtar modunu kabul etmiyor.","x-codes":["MODE_NOT_ALLOWED"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Kod markanızda yok.","x-codes":["CODE_NOT_FOUND"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"409":{"description":"Kod bu kullanım için uygun değil ya da `externalRef` çakışıyor.","x-codes":["ALREADY_REDEEMED","CODE_EXPIRED","CODE_CANCELLED","CAMPAIGN_NOT_STARTED","CODE_AMBIGUOUS","IDEMPOTENCY_CONFLICT"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"413":{"description":"Gövde 100 KB'tan büyük.","x-codes":["BODY_TOO_LARGE"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"415":{"description":"Gövde `application/json` değil.","x-codes":["JSON_REQUIRED"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"İstek sınırı aşıldı; `retryAfter` saniye sonra yeniden imzalayıp deneyin.","x-codes":["RATE_LIMITED","TOO_MANY_FAILURES","TOO_MANY_CODE_FAILURES"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"503":{"description":"Sınır sayacına ulaşılamadı; kısa süre sonra deneyin.","x-codes":["SERVICE_UNAVAILABLE"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/partner/redemptions/{externalRef}/reverse":{"post":{"operationId":"reverseRedemption","summary":"Kullanımı iade et","description":"Siparişin tamamı iade ya da iptal edildiğinde. Yalnız partner API'nin bildirdiği kullanım iade edilir; tekrar 200 ve `Idempotent-Replayed: true`.","x-modes":["live","test"],"parameters":[{"name":"externalRef","in":"path","required":true,"description":"Kullanım bildirimindeki sipariş anahtarı.","schema":{"type":"string","pattern":"^[A-Za-z0-9._:-]{1,128}$"}}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReverseRedemptionRequest"}}}},"responses":{"200":{"description":"Kaydın güncel hâli (`status: reversed`).","headers":{"Cache-Control":{"description":"Her zaman `no-store`.","schema":{"type":"string"}},"Idempotent-Replayed":{"description":"Tekrar (idempotent) yanıtında `true`.","schema":{"type":"string","const":"true"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Redemption"}},"required":["data"],"additionalProperties":false}}}},"400":{"description":"Gövde geçersiz.","x-codes":["INVALID_JSON"],"content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ValidationError"},{"$ref":"#/components/schemas/ApiError"}]}}}},"401":{"description":"Kimlik doğrulama başarısız; neden panelin İstek Logu'nda.","x-codes":["AUTH_FAILED"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Uç bu anahtar modunu kabul etmiyor.","x-codes":["MODE_NOT_ALLOWED"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Bu modda bu `externalRef` ile kullanım yok.","x-codes":["REDEMPTION_NOT_FOUND"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"413":{"description":"Gövde 100 KB'tan büyük.","x-codes":["BODY_TOO_LARGE"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"415":{"description":"Gövde `application/json` değil.","x-codes":["JSON_REQUIRED"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"İstek sınırı aşıldı; `retryAfter` saniye sonra yeniden imzalayıp deneyin.","x-codes":["RATE_LIMITED","TOO_MANY_FAILURES"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/partner/campaigns":{"get":{"operationId":"listCampaigns","summary":"Kampanyaları listele","description":"Anahtarın markasının kampanyaları (taslak ve onay bekleyen dahil), en yeni önce. `quota.claimed` ve `quota.redeemed` anahtarın moduna göredir: canlıda alınan kodlar ve doğrulanmış kullanımı olanlar, testte kampanyaya bağlı test kodları ve kullanılmış olanlar.","x-modes":["live","test"],"parameters":[{"name":"status","in":"query","required":false,"description":"Duruma göre süzer.","schema":{"type":"string","enum":["draft","pending_review","active","exhausted","ended"]}},{"name":"limit","in":"query","required":false,"description":"Sayfa boyutu.","schema":{"default":50,"type":"integer","minimum":1,"maximum":100}},{"name":"cursor","in":"query","required":false,"description":"Önceki sayfanın `nextCursor` değeri.","schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"responses":{"200":{"description":"Kampanya sayfası.","headers":{"Cache-Control":{"description":"Her zaman `no-store`.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CampaignPage"}},"required":["data"],"additionalProperties":false}}}},"400":{"description":"Sorgu geçersiz.","x-codes":[],"content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ValidationError"},{"$ref":"#/components/schemas/ApiError"}]}}}},"401":{"description":"Kimlik doğrulama başarısız; neden panelin İstek Logu'nda.","x-codes":["AUTH_FAILED"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Uç bu anahtar modunu kabul etmiyor.","x-codes":["MODE_NOT_ALLOWED"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"İstek sınırı aşıldı; `retryAfter` saniye sonra yeniden imzalayıp deneyin.","x-codes":["RATE_LIMITED","TOO_MANY_FAILURES"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}}},"components":{"securitySchemes":{"DahaKey":{"type":"apiKey","in":"header","name":"X-Daha-Key","description":"Anahtar kimliği (`dk_live_...` ya da `dk_test_...`)."},"DahaTimestamp":{"type":"apiKey","in":"header","name":"X-Daha-Timestamp","description":"Unix zamanı, saniye; sunucu saatinden en fazla 5 dakika sapabilir."},"DahaSignature":{"type":"apiKey","in":"header","name":"X-Daha-Signature","description":"Her istek üç başlıkla imzalanır: `X-Daha-Key` (anahtar kimliği), `X-Daha-Timestamp` (unix saniye) ve `X-Daha-Signature: v1=<hex(HMAC-SHA256(sır, kanonik dize))>`. Kanonik dize `zaman + \".\" + YÖNTEM + \".\" + yol?sorgu + \".\" + ham gövde`: yöntem büyük harf, yol istek satırındaki hâliyle (`/v1` öneki, harf düzeni ve sorgu dizesi dahil), gövdesiz istekte gövde boş dize. HMAC anahtarı sırrın UTF-8 baytlarıdır. Zaman sunucu saatinden en fazla 5 dakika sapabilir; aynı imza 10 dakika içinde ikinci kez kabul edilmez (tekrar denemede yeni zamanla yeniden imzalayın). Her kimlik hatası `401 AUTH_FAILED` döner. Anahtar başına dakikada 600 istek (`429 RATE_LIMITED`)."}},"schemas":{"VerifyCodeRequest":{"type":"object","properties":{"code":{"type":"string","minLength":1,"maxLength":64},"campaignId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["code"]},"CreateRedemptionRequest":{"type":"object","properties":{"code":{"type":"string","minLength":1,"maxLength":64},"campaignId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"externalRef":{"type":"string","pattern":"^[A-Za-z0-9._:-]{1,128}$"},"orderAmount":{"type":"integer","minimum":1,"maximum":2147483647},"discountAmount":{"type":"integer","minimum":0,"maximum":2147483647},"currency":{"type":"string","const":"TRY"},"redeemedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"}},"required":["code","externalRef","orderAmount","discountAmount","currency"]},"ReverseRedemptionRequest":{"type":"object","properties":{"reason":{"type":"string","minLength":1,"maxLength":200}}},"BrandSummary":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"slug":{"type":"string"},"name":{"type":"string"}},"required":["id","slug","name"],"additionalProperties":false},"CampaignRef":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"slug":{"type":"string"},"title":{"type":"object","properties":{"tr":{"type":"string"},"en":{"type":"string"}},"required":["tr","en"],"additionalProperties":false}},"required":["id","slug","title"],"additionalProperties":false},"PingResult":{"type":"object","properties":{"ok":{"type":"boolean","const":true},"mode":{"type":"string","enum":["live","test"]},"keyId":{"type":"string"},"brand":{"$ref":"#/components/schemas/BrandSummary"}},"required":["ok","mode","keyId","brand"],"additionalProperties":false},"VerifyResult":{"oneOf":[{"type":"object","properties":{"valid":{"type":"boolean","const":true},"claim":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"expiresAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"graceUntil":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]}},"required":["id","expiresAt","graceUntil"],"additionalProperties":false},"campaign":{"anyOf":[{"$ref":"#/components/schemas/CampaignRef"},{"type":"null"}]}},"required":["valid","claim","campaign"],"additionalProperties":false},{"type":"object","properties":{"valid":{"type":"boolean","const":false},"reason":{"type":"string","enum":["NOT_FOUND","AMBIGUOUS","CANCELLED","EXPIRED","ALREADY_REDEEMED"]},"claim":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"expiresAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"graceUntil":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]}},"required":["id","expiresAt","graceUntil"],"additionalProperties":false},"campaign":{"anyOf":[{"$ref":"#/components/schemas/CampaignRef"},{"type":"null"}]}},"required":["valid","reason"],"additionalProperties":false}]},"Redemption":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"mode":{"type":"string","enum":["live","test"]},"source":{"type":"string","enum":["webhook","cashier"]},"externalRef":{"type":["string","null"]},"status":{"type":"string","enum":["verified","reversed"]},"orderAmount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"discountAmount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"currency":{"type":"string"},"redeemedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"reversedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"reason":{"type":["string","null"]},"claim":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"code":{"type":"string"}},"required":["id","code"],"additionalProperties":false},"campaign":{"anyOf":[{"$ref":"#/components/schemas/CampaignRef"},{"type":"null"}]}},"required":["id","mode","source","externalRef","status","orderAmount","discountAmount","currency","redeemedAt","reversedAt","reason","claim","campaign"],"additionalProperties":false},"RedemptionListItem":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"externalRef":{"type":["string","null"]},"status":{"type":"string","enum":["verified","reversed"]},"source":{"type":"string","enum":["webhook","cashier"]},"campaignId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"orderAmount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"discountAmount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"currency":{"type":"string"},"redeemedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"reversedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]}},"required":["id","externalRef","status","source","campaignId","orderAmount","discountAmount","currency","redeemedAt","reversedAt"],"additionalProperties":false},"RedemptionPage":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/RedemptionListItem"}},"nextCursor":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]}},"required":["items","nextCursor"],"additionalProperties":false},"PartnerCampaign":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"slug":{"type":"string"},"title":{"type":"object","properties":{"tr":{"type":"string"},"en":{"type":"string"}},"required":["tr","en"],"additionalProperties":false},"status":{"type":"string","enum":["draft","pending_review","active","exhausted","ended"]},"startsAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"endsAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"quota":{"type":"object","properties":{"total":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"remaining":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"claimed":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"redeemed":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["total","remaining","claimed","redeemed"],"additionalProperties":false}},"required":["id","slug","title","status","startsAt","endsAt","quota"],"additionalProperties":false},"CampaignPage":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/PartnerCampaign"}},"nextCursor":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]}},"required":["items","nextCursor"],"additionalProperties":false},"ApiError":{"type":"object","properties":{"code":{"type":"string"},"retryAfter":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"maxDiscount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"minBasketAmount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["code"],"additionalProperties":{}},"ValidationError":{"type":"object","properties":{"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["message","issues"],"additionalProperties":false}}}}