# 获取优惠券奖励 通过券码获取优惠券奖励。 可用于允许用户从众多商品中选择一个作为奖励。 通常情况下,如果优惠券包含游戏作为奖励(type=unit),则为选择一个DRM。 Endpoint: GET /v2/project/{project_id}/coupon/code/{coupon_code}/rewards Version: 2.0.0 Security: XsollaLoginUserJWT ## Path parameters: - `project_id` (integer, required) 项目ID。您可以在您的发布商帐户项目名称旁边找到。 Example: 44056 - `coupon_code` (string, required) 区分大小写的唯一券码。包含字母和数字。 Example: "WINTER2021" ## Response 200 fields (application/json): - `bonus` (array) - `bonus.item` (object) - `bonus.item.bundle_type` (string) 捆绑类型。商品类型是捆绑包时返回。 Enum: "standard", "virtual_currency_package" - `bonus.item.content` (array) - `bonus.item.description` (string,null) 商品描述。 Example: "Game description" - `bonus.item.image_url` (string,null) 图像URL。 Example: "https://cdn.xsolla.net/img/misc/images/b79342cdf24f0f8557b63c87e8326e62.png" - `bonus.item.name` (object) 商品名称。 Example: {"en":"Game name"} - `bonus.item.sku` (string) 唯一商品ID。 SKU只能包含大小写英文字母和数字字符、句点、破折号和下划线。 Example: "game_01" - `bonus.item.type` (string) 商品类型:virtual_good/virtual_currency/bundle/physical_good/unit。 Example: "unit" - `bonus.item.unit_items` (array) 如果商品具有单位类型,则它包含单位中的所有商品。大多数情况下,用户应该选择其中之一作为优惠券奖励。 - `bonus.item.unit_items.drm_name` (string) DRM名称。 Example: "Steam" - `bonus.item.unit_items.drm_sku` (string) 唯一DRM ID。 SKU只能包含大小写英文字母和数字字符、句点、破折号和下划线。 Example: "steam" - `bonus.item.unit_items.is_free` (boolean) - `bonus.item.unit_items.type` (string) 商品类型:game_key。 Example: "game_key" - `bonus.quantity` (number) 商品数量。 - `discount` (object,null) 百分比折扣。 购物车价格将按照此百分比打折,然后四舍五入到小数点后两位。 - `discount.percent` (string) Example: "10.00" - `is_selectable` (boolean) 如果为true,则用户应在兑换优惠券之前选择奖励。 ## Response 401 fields (application/json): - `errorCode` (integer) Example: 1501 - `errorMessage` (string) Example: "[0401-1501]: Authorization failed: Provide authorization" - `statusCode` (integer) Example: 401 ## Response 403 fields (application/json): - `errorCode` (integer) - `errorMessage` (string) Example: "Authorization header not sent." - `statusCode` (integer) Example: 403 - `transactionId` (string) Example: "x-x-x-x-transactionId-mock-x-x-x" ## Response 404 fields (application/json): - `errorCode` (integer) Example: 4001 - `errorMessage` (string) Example: "[0401-9807]: Enter valid coupon code." - `statusCode` (integer) Example: 404