# クライアントによるゲームコードを引き換える

提供されたゲームコードで権利を付与します。


  注意
    コードの引き換えは、DRMフリーのプラットフォームのみに対応しています。





  注意
    認証なしで使用した場合、このAPIコールは一般的なアイテムカタログデータを返します。認証を使用して、アイテムに関連する制限やプロモーションなどのパーソナライズされたユーザーデータを取得します。これを行うには、ユーザーのJWTをAuthorizationヘッダーに渡してください。ユーザーJWTの詳細については、このコールのセキュリティブロックを参照してください。

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
