{"openapi":"3.1.0","info":{"title":"CodeRedemption Service","version":"1.0.0"},"paths":{"/public/accounts/{accountId}/redemptions":{"get":{"tags":["Accounts - Public"],"summary":"List redemptions for an account","parameters":[{"in":"path","name":"accountId","schema":{"$ref":"#/components/schemas/AccountID"},"required":true,"description":"An account id"}],"responses":{"200":{"description":"Codes","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/CodeRedemptionInfo"}}}}}},"description":"**Permission Required**: [`coderedemption:public:{accountId}:redemptions READ`](https://egs.jaren.wtf/#resource=coderedemption:public:{accountId}:redemptions&action=2)","security":[{"bearer":["coderedemption:public:{accountId}:redemptions READ"]}]}},"/public/identities/{identityId}/codes":{"get":{"tags":["Identities - Public"],"summary":"List codes for an identity","parameters":[{"in":"path","name":"identityId","schema":{"$ref":"#/components/schemas/IdentityID"},"required":true,"description":"An identity id"}],"responses":{"200":{"description":"Codes","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/CodeInfo"}}}}}},"description":"**Permission Required**: [`coderedemption:public:{accountId}:codes READ`](https://egs.jaren.wtf/#resource=coderedemption:public:{accountId}:codes&action=2)","security":[{"bearer":["coderedemption:public:{accountId}:codes READ"]}]}},"/public/identities/{identityId}/coupons/free":{"get":{"tags":["Identities - Public"],"summary":"Check free coupon count for sales event","parameters":[{"in":"path","name":"identityId","schema":{"$ref":"#/components/schemas/IdentityID"},"required":true,"description":"An identity id"},{"in":"query","name":"salesEventId","schema":{"type":"string"},"required":true,"description":"The sales event id"}],"responses":{"200":{"description":"Free coupon count","content":{"application/json":{"schema":{"type":"object","properties":{"numberOfFreeCoupons":{"type":"integer"}}}}}},"400":{"description":"Sales event active, or invalid request"},"404":{"description":"Sales event not found"}},"description":"**Permission Required**: [`coderedemption:public:{accountId}:coupons:free READ`](https://egs.jaren.wtf/#resource=coderedemption:public:{accountId}:coupons:free&action=2)","security":[{"bearer":["coderedemption:public:{accountId}:coupons:free READ"]}]},"post":{"tags":["Identities - Public"],"summary":"Claim free coupon for sales event","parameters":[{"in":"path","name":"identityId","schema":{"$ref":"#/components/schemas/IdentityID"},"required":true,"description":"An identity id"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["salesEventId"],"properties":{"salesEventId":{"type":"string","description":"The sales event id"}}}}}},"responses":{"200":{"description":"Claimed coupon codes","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/CodeInfo"}}}}},"400":{"description":"Sales event active, invalid request or coupon already claimed"},"404":{"description":"Sales event not found"}},"description":"**Permission Required**: [`coderedemption:public:{accountId}:coupons:free CREATE`](https://egs.jaren.wtf/#resource=coderedemption:public:{accountId}:coupons:free&action=1)","security":[{"bearer":["coderedemption:public:{accountId}:coupons:free CREATE"]}]}},"/public/identities/{identityId}/redemptions":{"get":{"tags":["Identities - Public"],"summary":"List redemptions for an identity","parameters":[{"in":"path","name":"identityId","schema":{"$ref":"#/components/schemas/IdentityID"},"required":true,"description":"An identity id"}],"responses":{"200":{"description":"Codes","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/CodeRedemptionInfo"}}}}}},"description":"**Permission Required**: [`coderedemption:public:{accountId}:redemptions READ`](https://egs.jaren.wtf/#resource=coderedemption:public:{accountId}:redemptions&action=2)","security":[{"bearer":["coderedemption:public:{accountId}:redemptions READ"]}]}},"/shared/accounts/{identityId}/redeem/{code}/evaluate":{"post":{"tags":["Accounts - Shared"],"summary":"Lookup a code and evaluate it for redemption (if it can be redeemed)","parameters":[{"in":"path","name":"identityId","schema":{"$ref":"#/components/schemas/IdentityID"},"required":true,"description":"An identity id"},{"in":"path","name":"code","schema":{"type":"string"},"required":true,"description":"The code to evaluate, without dashes"}],"responses":{"200":{"description":"Code evaluation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CodeInfo"}}}}},"description":"**Permission Required**: [`coderedemption:shared:redeem CREATE`](https://egs.jaren.wtf/#resource=coderedemption:shared:redeem&action=1)","security":[{"bearer":["coderedemption:shared:redeem CREATE"]}]}},"/shared/code/{code}/codeUse/{codeUseId}":{"delete":{"tags":["Codes - Shared"],"summary":"Unlock a locked code use id","parameters":[{"in":"path","name":"code","schema":{"type":"string"},"required":true,"description":"The code to unlock, without dashes"},{"in":"path","name":"codeUseId","schema":{"type":"query"},"required":false,"description":"The code use id to unlock"}],"responses":{"204":{"description":"Code use unlocked"}},"description":"**Permission Required**: [`coderedemption:shared:redeem DELETE`](https://egs.jaren.wtf/#resource=coderedemption:shared:redeem&action=8)","security":[{"bearer":["coderedemption:shared:redeem DELETE"]}]}},"/shared/code/{code}/lock":{"post":{"tags":["Codes - Shared"],"summary":"Lock a code use, to redeem later","parameters":[{"in":"path","name":"code","schema":{"type":"string"},"required":true,"description":"The code to lock, without dashes"},{"in":"query","name":"codeUseId","schema":{"type":"string"},"required":false,"description":"Supply a custom code use id (32 characters of 1-9 or a-z)"}],"responses":{"200":{"description":"Code use lock response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CodeLockInfo"}}}}},"description":"**Permission Required**: [`coderedemption:shared:redeem CREATE`](https://egs.jaren.wtf/#resource=coderedemption:shared:redeem&action=1)","security":[{"bearer":["coderedemption:shared:redeem CREATE"]}]}},"/shared/identities/{identityId}/coupons/{code}":{"get":{"tags":["Identities - Shared"],"parameters":[{"in":"path","name":"identityId","schema":{"$ref":"#/components/schemas/IdentityID"},"required":true,"description":"An identity id"},{"in":"path","name":"code","schema":{"type":"string"},"required":true,"description":"The code, without dashes"}],"responses":{},"description":"**Permission Required**: [`coderedemption:shared:coupons READ`](https://egs.jaren.wtf/#resource=coderedemption:shared:coupons&action=2)","security":[{"bearer":["coderedemption:shared:coupons READ"]}]}},"/shared/identities/{identityId}/redeem/{code}/evaluate":{"post":{"tags":["Identities - Shared"],"summary":"Lookup a code and evaluate it for redemption (if it can be redeemed)","parameters":[{"in":"path","name":"identityId","schema":{"$ref":"#/components/schemas/IdentityID"},"required":true,"description":"An identity id"},{"in":"path","name":"code","schema":{"type":"string"},"required":true,"description":"The code to evaluate, without dashes"}],"responses":{"200":{"description":"Code evaluation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CodeInfo"}}}}},"description":"**Permission Required**: [`coderedemption:shared:redeem CREATE`](https://egs.jaren.wtf/#resource=coderedemption:shared:redeem&action=1)","security":[{"bearer":["coderedemption:shared:redeem CREATE"]}]}},"/version":{"get":{"tags":["Version"],"summary":"Get the current version","responses":{"200":{"description":"Version info","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Version"}}}}}}}},"components":{"schemas":{"IdentityID":{"oneOf":[{"$ref":"#/components/schemas/AccountID"},{"$ref":"#/components/schemas/OrganizationID"}],"description":"This represents a unique id for an identity, which can be either an account or an organization."},"AccountID":{"type":"string","pattern":"^[0-9a-f]{12}4[0-9a-f]{3}[89ab][0-9a-f]{15}$","examples":["8b0a23cb43af46cb972806f4025a9cba"],"description":"This represents a unique id for an epic games account"},"Version":{"type":"object","required":["app","serverDate","overridePropertiesVersion","cln","build","moduleName","buildDate","version","branch","modules"],"properties":{"app":{"type":"string"},"serverDate":{"type":"string","format":"date-time"},"overridePropertiesVersion":{"type":"string"},"cln":{"type":"string"},"build":{"type":"string"},"moduleName":{"type":"string"},"buildDate":{"type":"string","format":"date-time"},"version":{"type":"string"},"branch":{"type":"string"},"modules":{"type":"object","additionalProperties":{"type":"object","required":["cln","build","buildDate","version","branch"],"properties":{"cln":{"type":"string"},"build":{"type":"string"},"buildDate":{"type":"string","format":"date-time"},"version":{"type":"string"},"branch":{"type":"string"}}}}}},"OrganizationID":{"type":"string","pattern":"^o-[0-9a-z]{30}$","examples":["o-aa83a0a9bc45e98c80c1b1c9d92e9e","o-qffyne2n8tuxgnxu4gzg33th8xkuud"],"description":"This represents a unique id for an organization"},"CodeInfo":{"type":"object","properties":{"code":{"type":"string","examples":["BANANNANANANA"]},"namespace":{"type":"string","examples":["fn"]},"creator":{"type":"string","description":"A client id (for redemption codes) or account id (for coupons)","examples":["b00872566c594e0da274fcb2a66e8588"]},"dateCreated":{"type":"string","format":"date-time"},"startDate":{"type":"string","format":"date-time"},"endDate":{"type":"string","format":"date-time"},"allowedUsers":{"type":"array","items":{"$ref":"#/components/schemas/AccountID"}},"allowedCountries":{"type":"array","items":{"type":"string","examples":["DE","US"]}},"allowedClients":{"type":"array","items":{"type":"string"}},"distributionMetadata":{"type":"object","additionalProperties":true},"allowedDistributionClients":{"type":"array","items":{"type":"string"}},"codeType":{"$ref":"#/components/schemas/CodeType"},"maxNumberOfUses":{"type":"integer","format":"int32"},"allowRepeatedUsesBySameUser":{"type":"boolean"},"useCount":{"type":"integer","format":"int32"},"completedCount":{"type":"integer","format":"int32"},"consumptionMetadata":{"$ref":"#/components/schemas/CodeConsumptionMetadata"},"codeStatus":{"$ref":"#/components/schemas/CodeStatus"},"batchId":{"type":"string","examples":["746e982142404b138fb496804df30a3a"]},"batchNumber":{"type":"integer","format":"int32"},"labels":{"type":"array","items":{"type":"string","examples":["unmanagedSPTProduct","walkInPartner"]}},"codeRuleId":{"type":"string","examples":["ecb94c7c32d54656a1ebf00c3a799a4b"]},"blockedCountries":{"type":"array","items":{"type":"string","examples":["CN","RU"]}}}},"CodeType":{"type":"string","enum":["REDEMPTION","COUPON"]},"CodeConsumptionMetadata":{"type":"object","properties":{"organizationId":{"type":"string"},"productId":{"type":"string"},"offerId":{"type":"string"},"sandboxId":{"type":"string"},"from":{"type":"string"},"criteria":{"type":"object","properties":{"checks":{"type":"array","items":{"type":"object","properties":{"data":{"type":"string"},"type":{"type":"string"}}}},"elseAction":{"type":"string"},"rejectErrorType":{"type":"string"},"action":{"type":"string"},"operator":{"type":"string"}}},"quotaEntitlementName":{"type":"string"},"distributionMetadataRequired":{"type":"boolean"},"actions":{"type":"array","items":{"type":"object","properties":{"actionType":{"type":"string"},"actionData":{"type":"object"}}}},"epicSalesEventId":{"type":"string"},"applyMerchantGroup":{"type":"array","items":{"type":"string","examples":["EGS_MKT","VPR_MKT"]}}},"examples":[{"criteria":{"checks":[{"data":"FN_Potassium_Emote","type":"entitlement"}],"elseAction":"REDEEM","rejectErrorType":"ALREADY_OWNED","action":"REJECT","operator":"AND"},"namespace":"fn","offerId":"5ae93cd2ca5244b6827bb1220ccbdd8d"},{"criteria":{"checks":[{"data":"Fortnite_Mobile","type":"entitlement"}],"elseAction":"REDEEM","rejectErrorType":"ALREADY_OWNED","action":"REJECT","operator":"AND"},"quotaEntitlementName":"Fortnite_Mobile_Invite","distributionMetadataRequired":true,"namespace":"fn","offerId":"4fb3d836151a4e8a8f145a13ee426786","actions":[{"actionType":"friendship","actionData":{}}]},{"epicSalesEventId":"2711ebb8eac84abebe03da212e8e1a47","applyMerchantGroup":["EGS_MKT","VPR_MKT"]},{"organizationId":"o-e8ssfbygyxzlaq4q72f2chdz4ucwfz","productId":"550b09df2fff481cbf051950896f8b91","offerId":"8afcd8016364438cbaa8b5e808298bf5","sandboxId":"p-jbevlmd3zzfcz7zf5ty8f8j4l3q9wn","from":"devportal"}]},"CodeRedemptionInfo":{"type":"object","properties":{"codeUseId":{"type":"string"},"codeId":{"type":"string","examples":["BANANNANANANA"]},"codeType":{"$ref":"#/components/schemas/CodeType"},"redeemingClient":{"type":"string"},"redeemAction":{"type":"string","examples":["REDEEM"]},"redeemStarted":{"type":"string","format":"date-time"},"redeemEnded":{"type":"string","format":"date-time"},"useNumber":{"type":"integer"},"consumingUser":{"$ref":"#/components/schemas/AccountID"},"useData":{"type":"object","properties":{"entitlementIds":{"type":"array","items":{"type":"string"}}}},"consumptionMetadata":{"$ref":"#/components/schemas/CodeConsumptionMetadata"},"batchId":{"type":"string"},"batchNumber":{"type":"integer"},"distributionMetadata":{"type":"object","additionalProperties":true},"anonymousUse":{"type":"boolean"},"namespace":{"type":"string","examples":["fn"]},"country":{"type":"string","examples":["DE"]}}},"CodeStatus":{"type":"string","examples":["ACTIVE","LOCKED"]},"CodeLockInfo":{"type":"object","properties":{"codeUseId":{"type":"string","examples":["bd6c2e6ba8494e1caf526b6115ce4048"]},"codeId":{"type":"string","examples":["BANANNANANANA"]},"codeType":{"$ref":"#/components/schemas/CodeType"},"redeemingClient":{"type":"string"},"redeemAction":{"type":"string","examples":["REDEEM"]},"redeemStarted":{"type":"string","format":"date-time"},"useNumber":{"type":"integer"},"consumingUser":{"$ref":"#/components/schemas/AccountID"},"useData":{"type":"object","additionalProperties":true},"consumptionMetadata":{"$ref":"#/components/schemas/CodeConsumptionMetadata"},"batchNumber":{"type":"integer"},"distributionMetadata":{"type":"object","additionalProperties":true},"anonymousUse":{"type":"boolean"},"namespace":{"type":"string","examples":["epic"]}}}},"securitySchemes":{"bearer":{"type":"http","scheme":"bearer"}}},"servers":[{"url":"https://coderedemption-public-service-prod.ol.epicgames.com/coderedemption/api"}]}