# 验证促销代码

确定代码是兑换码还是优惠券码，以及用户是否可以使用该代码。


  注：
    此API调用使用用户JWT进行授权。
    请在Authorization请求头中按以下格式传入令牌：Bearer &lt;user_JWT&gt;。关于用户JWT的更多信息，请参阅此调用的安全性部分。

Endpoint: GET /v2/project/{project_id}/promotion/code/{code}/verify
Version: 2.0.0
Security: XsollaLoginUserJWT

## Path parameters:

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

  - `code` (string, required)
    唯一区分大小写的代码。包含字母和数字。
    Example: "WINTER2021"

## Response 200 fields (application/json):

  - `type` (string)
    代码类型：promocode/coupon。

  - `code` (string)
    区分大小写的唯一兑换码。包含字母和数字。

  - `rewards` (any)

## Response 401 fields (application/json):

  - `statusCode` (integer)
    Example: 401

  - `errorCode` (integer)
    Example: 1501

  - `errorMessage` (string)
    Example: "[0401-1501]: Authorization failed: Provide authorization"

## 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: 9811

  - `errorMessage` (string)
    Example: "[0401-9811]: Code not found."

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

## Response 422 fields (application/json):

  - `errorCode` (integer)

  - `statusCode` (integer)

  - `errorMessage` (string)


