# Get coupon rewards

Gets coupons rewards by its code.
Can be used to allow users to choose one of many items as a bonus.
The usual case is choosing a DRM if the coupon contains a game as a bonus (type=unit).  
  Note
    This API call uses a user JWT for authorization.
    Include the token in the Authorization header in the following format: Bearer &lt;user_JWT&gt;. For more information about user JWT, see the Security block for this call.

Endpoint: GET /v2/project/{project_id}/coupon/code/{coupon_code}/rewards
Version: 2.0.0
Security: XsollaLoginUserJWT

## Path parameters:

  - `project_id` (integer, required)
    Project ID. You can find this parameter in your Publisher Account next to the project name and in the browser address bar when working with a project. The URL has the following format: https://publisher.xsolla.com//projects/.
    Example: 44056

  - `coupon_code` (string, required)
    Unique case sensitive code. Contains letters and numbers.
    Example: "WINTER2021"

## Response 200 fields (application/json):

  - `bonus` (array)

  - `bonus.item` (object)

  - `bonus.item.sku` (string)
    Unique item ID. The SKU may contain only lowercase and uppercase Latin alphanumeric characters, periods, dashes, and underscores.
    Example: "game_01"

  - `bonus.item.name` (object)
    Item name.
    Example: {"en":"Game name"}

  - `bonus.item.type` (string)
    Type of item. Possible values:virtual_good — virtual itemsvirtual_currency — virtual currencybundle — bundleunit — game key package
    Example: "unit"

  - `bonus.item.bundle_type` (string)
    Bundle type. Returned if item type is a bundle.
    Enum: "standard", "virtual_currency_package"

  - `bonus.item.description` (string,null)
    Item description.
    Example: "Game description"

  - `bonus.item.image_url` (string,null)
    Image URL.
    Example: "https://cdn.xsolla.net/img/misc/images/b79342cdf24f0f8557b63c87e8326e62.png"

  - `bonus.item.content` (array)

  - `bonus.item.unit_items` (array)
    Array of platform-specific game keys. Used only when the item type is unit (bonus.item.type = 'unit'). If the game key package includes platform-specific keys, the user can choose one of them as a bonus.

  - `bonus.item.unit_items.sku` (string)
    Unique platform-specific game key package ID. Allowed characters: a–z, A–Z, 0–9, period (.), hyphen (-), underscore (_). It combines bonus.item.​sku and bonus.item.unit_items.drm_sku values. E.g., if bonus.item.​sku = 'cool_game' and bonus.item.unit_items.drm_sku = 'steam', the value will be cool_game_steam.
    Example: "cool_game_steam"

  - `bonus.item.unit_items.is_free` (boolean)

  - `bonus.item.unit_items.type` (string)
    Indicates that the item is a game key.
    Enum: "game_key"

  - `bonus.item.unit_items.name` (string)
    Game title.
    Example: "Awesome Game"

  - `bonus.item.unit_items.drm_name` (string)
    DRM name.
    Example: "Steam"

  - `bonus.item.unit_items.drm_sku` (string)
    Unique DRM ID used as a suffix to indicate a platform-specific game key. Allowed characters: a–z, A–Z, 0–9, period (.), hyphen (-), underscore (_).
    Example: "steam"

  - `bonus.quantity` (number)
    Item quantity.

  - `is_selectable` (boolean)
    If true, the user should choose the bonus before redeeming a coupon.

  - `discount` (object,null)
    Percent discount.
The price of cart will be decreased using a value calculated by using this percent and then rounded to 2 decimal places.

  - `discount.percent` (string)
    Example: "10.00"

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

  - `errorMessage` (string)
    Example: "[0401-9807]: Enter valid coupon code."


