# 通过代码获取兑换型促销活动 通过促销码或优惠券码获取促销活动。 Endpoint: GET /v3/project/{project_id}/admin/promotion/redeemable/code/{code} Version: 2.0.0 Security: basicAuth ## Path parameters: - `project_id` (integer, required) 项目ID。您可以在您的发布商帐户项目名称旁边找到。 Example: 44056 - `code` (string, required) 唯一区分大小写的代码。包含字母和数字。 Example: "WINTER2021" ## Response 200 fields (application/json): - `bonus` (array,null) - `bonus.quantity` (number) 商品数量。 - `bonus.sku` (string) 物品 SKU。 - `discount` (object,null) 仅适用于促销码。 Example: {"discount":{"percent":"10.99"}} - `discount.percent` (string,null) 百分比折扣。 购物车价格将按照此百分比打折,然后四舍五入到小数点后两位。 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。 - `external_id` (string) 唯一促销活动ID。 external_id只能包含大小写英文字母和数字字符、句点、破折号和下划线。 Example: "coupon_external_id" - `is_enabled` (boolean) - `name` (object) 促销活动名称。应包含键/值对, 其中键是"^[a-z]{2}-[A-Z]{2}$"格式的区域设置,值是字符串。 Example: {"de-DE":"Gutscheintitel","en-US":"Coupon title"} - `promotion_periods` (array) 促销活动有效期。若指定了多个时间段,则date_from和date_until均为必需。 - `promotion_periods.date_from` (string, required) 指定促销活动的开始日期。 Example: "2020-08-11T10:00:00+03:00" - `promotion_periods.date_until` (string,null) 促销活动的结束日期。设置为null时,促销活动永久有效。仅在指定单个有效期时可设置为null。 Example: "2020-08-11T20:00:00+03:00" - `redeem_code_limit` (integer,null) 每个代码的兑换次数。 Example: 10 - `redeem_total_limit` (integer,null) 限制优惠券的总数。 Example: 10 - `redeem_user_limit` (integer,null) 限制单个用户兑换的优惠券总数。 Example: 10 - `total_limit_state` (object,null) 每个唯一优惠券码的限制。 - `total_limit_state.available` (integer) 优惠券剩余可使用次数。 Example: 3 - `total_limit_state.reserved` (integer) 优惠券预留数量。 Example: 3 - `total_limit_state.used` (integer) 优惠券被使用的次数。 Example: 5 ## Response 401 fields (application/json): - `errorCode` (integer) Example: 1020 - `errorMessage` (string) Example: "[0401-1020]: Error in Authentication method occurred" - `statusCode` (integer) Example: 401 ## Response 404 fields (application/json): - `errorCode` (integer) Example: 9811 - `errorMessage` (string) Example: "[0401-9811]: Code not found." - `statusCode` (integer) Example: 404 ## Response 405 fields (application/json): - `errorCode` (integer) - `errorMessage` (string) Example: "Method is not allowed. Method must be one of: OPTIONS" - `statusCode` (integer) Example: 405