Skip to main content

Entitlements - Redeem Code

Description

Redeems one or more provided codes to the authenticated Twitch user.

warning

Twitch decommissioned this endpoint on 2023-02-27.

Method Definition

@Deprecated
@RequestLine("POST /entitlements/codes?code={code}&user_id={user_id}")
@Headers("Authorization: Bearer {token}")
HystrixCommand<CodeStatusList> redeemCode(
@Param("token") String authToken,
@Param("code") List<String> code,
@Param("user_id") Integer userId
);

Required Parameters

NameTypeDescription
authTokenstringApp Access Token
codestringThe code to redeem to the authenticated user’s account.
userIdintegerRepresents a numeric Twitch user ID

Code-Snippets

redeem code and print status

CodeStatusList codeStatusList = twitchClient.getHelix().redeemCode(authToken, Arrays.asList("KUHXV-4GXYP-AKAKK"), 156900877).execute();
codeStatusList.getStatuses().forEach(codeStatus -> {
System.out.println(codeStatus.getCode() + " " + codeStatus.getStatus());
});