Auto redeem guide
Auto redeem flow
If the partner plans to use vouchers as a reward, we recommend implementing auto redeem of vouchers. It prevents from partner vouchers selling. When a user completes a mission, FACEIT sends a voucher to the partner via HTTP request instead of showing the voucher to the user. To implement this flow, account linkage must be implemented.
Vouchers must be unique for every user per reward. FACEIT can’t distribute the same code to different users. For example, if a campaign contains 3 missions, the partner can’t share only 3 codes (one code as a reward per mission). The partner should share approximately 100k unique codes per mission.
Redeem code endpoint
This POST
request is used to redeem a voucher.
Endpoint
POST
https://<partner domain>/codes/apply
Header (required)
Content-Type
- application/jsonAuthorization: Bearer <access token></access>
- We use Bearer authentication. <access token> - user access token after linking accounts.Data (JSON format)
Request body with following params:
param name | type | description |
---|---|---|
code | string | Code for redeeming |
Example of well-prepared request:
POST https://<partner domain>/codes/apply
Authorization: Bearer <access token>
Content-Type: application/json
{
"code": "CODE"
}
- Response
param name | type | description |
---|---|---|
code | string | A human-readable error code. It’s used to identify the error that occurred. |
message | string | A detailed error message. |
Example of response:
{
"code": "invalid_code",
"message": "code was already redeemed"
}
FACEIT can handle the following error codes:
expired_voucher - voucher is expired
redeemed_voucher - voucher is already redeemed
voucher_not_found - voucher doesn’t exist
user_banned - the user isn’t eligible to redeem a voucher
The partner must return 422 HTTP code in the error case mentioned above. If the access token is invalid, the partner must return 401 HTTP code.
Integration steps
We suggest that the account linkage is already implemented.
The partner implements the method to redeem vouchers.
The partner shares with FACEIT test vouchers for stage and prod environments.
FACEIT and partner test account linkage on stage.
FACEIT and partner test account linkage on prod.
Limitation
The redeeming rate is 1rps.