# 获取促销码奖励 通过促销码获取奖励。 可用于允许用户从众多商品中选择一个作为奖励。 通常情况下,如果优惠码包含游戏作为奖励(type=unit),则为选择一个DRM。 Endpoint: GET /v2/project/{project_id}/promocode/code/{promocode_code}/rewards Version: 2.0.0 Security: XsollaLoginUserJWT ## Path parameters: - `project_id` (integer, required) 项目ID。您可以在您的发布商帐户项目名称旁边找到。 Example: 44056 - `promocode_code` (string, required) 区分大小写的唯一券码。包含字母和数字。 Example: "SO6rew99j9" ## Response 200 fields (application/json): - `bonus` (array) - `bonus.item` (object) - `bonus.item.description` (string) 商品描述。 Example: "Game description" - `bonus.item.image_url` (string) 图像URL。 Example: "https://cdn.xsolla.net/img/misc/images/b79342cdf24f0f8557b63c87e8326e62.png" - `bonus.item.name` (string) 商品名称。 Example: "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) 如果为true,则该商品为免费。 - `bonus.item.unit_items.type` (string) 商品类型:game_key。 Example: "game_key" - `bonus.quantity` (number) 商品数量。 - `discount` (object,null) 百分比折扣。 购物车价格将按照此百分比打折,然后四舍五入到小数点后两位。 - `discount.percent` (string) Example: "10.00" - `discounted_items` (array,null) 通过促销码打折的商品列表。 - `discounted_items.discount` (object, required) - `discounted_items.discount.percent` (string, required) 百分比折扣。 购物车商品价格将按照此百分比打折, 然后四舍五入到小数点后两位。 Example: "10.00" - `discounted_items.sku` (string, required) 物品 SKU。 - `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 promo code." - `statusCode` (integer) Example: 404