Skip to main content

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.

Note

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/json

    Authorization: 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 nametypedescription
codestringCode 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 nametypedescription
codestringA human-readable error code. It’s used to identify the error that occurred.
messagestringA 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.

  1. The partner implements the method to redeem vouchers.

  2. The partner shares with FACEIT test vouchers for stage and prod environments.

  3. FACEIT and partner test account linkage on stage.

  4. FACEIT and partner test account linkage on prod.

Limitation

The redeeming rate is 1rps.