# 通过客户端兑换游戏Key

根据提供的游戏Key授予权益。


  提示
    仅可为DRM free平台兑换游戏Key。





  注：
    未经授权使用此API调用时，会返回通用商品目录数据。如需获取
    个性化
    用户数据，例如与商品相关的数量限制和促销活动，请使用授权。为此，请在Authorization请求头中传递用户JWT。
    有关用户JWT的更多信息，请参阅此调用的Security部分。

Endpoint: POST /v2/project/{project_id}/entitlement/redeem
Version: 2.0.0
Security: XsollaLoginUserJWT

## Path parameters:

  - `project_id` (integer, required)
    项目ID。您可以在发布商帐户的项目名称旁找到此参数；使用项目时，也可以在浏览器地址栏中找到此参数。URL格式如下：https://publisher.xsolla.com//projects/。
    Example: 44056

## Request fields (application/json):

  - `code` (string, required)
    游戏密钥。
    Example: "AAAA-BBBB-CCCC-DDDD"

  - `sandbox` (boolean)
    在沙盒模式下兑换游戏密钥。该选项适用于在公司用户列表中指定的那些用户。

## Response 403 fields (application/json):

  - `statusCode` (integer)
    Example: 403

  - `errorCode` (integer)

  - `errorMessage` (string)
    Example: "Authorization header not sent."

  - `transactionId` (string)
    Example: "x-x-x-x-transactionId-mock-x-x-x"

## Response 404 fields (application/json):

  - `statusCode` (integer)
    Example: 404

  - `errorCode` (integer)
    Example: 4603

  - `errorMessage` (string)
    Example: "[0401-4603]: Game code not found."

  - `transactionId` (string)
    Example: "x-x-x-x-transactionId-mock-x-x-x"

## Response 422 fields (application/json):

  - `statusCode` (integer)
    Example: 422

  - `errorCode` (integer)
    Example: 5103

  - `errorMessage` (string)
    Example: "[0401-5103]: Selected drm is not drmfree."

  - `transactionId` (string)
    Example: "x-x-x-x-transactionId-mock-x-x-x"


## Response 201 fields
