# 移除购物车的促销码 移除购物车的促销码。 删除促销码后,将重新计算购物车中所有商品的总价,去掉促销码提供的奖励和折扣。 Endpoint: PUT /v2/project/{project_id}/promocode/remove Version: 2.0.0 Security: AuthForCart ## Path parameters: - `project_id` (integer, required) 项目ID。您可以在您的发布商帐户项目名称旁边找到。 Example: 44056 ## Request fields (application/json): - `cart` (object,null) - `cart.id` (string, required) 购物车ID。 ## Response 200 fields (application/json): - `cart_id` (string) 购物车ID。 Example: "cart_id" - `is_free` (boolean) 如果为true,则该商品为免费。 - `items` (array) Example: [{"attributes":[],"can_be_bought":true,"description":"Take it, take it all! All of Xsolla's riches in one Mega Booster.","groups":[{"external_id":"powerups","name":"Power Ups"}],"image_url":"https://cdn.xsolla.net/img/misc/images/e9f2f4a634bc96ea03b5d5ceadd7c55f.png","is_free":false,"limits":{"per_user":{"available":3,"recurrent_schedule":{"interval_type":"weekly","reset_next_date":1746057600},"total":5}},"name":"Xsolla Booster Mega","periods":[{"date_from":"2020-08-11T10:00:00+03:00","date_until":"2020-08-11T20:00:00+03:00"}],"price":{"amount":"50.0000000000000000","amount_without_discount":"100.0000000000000000","currency":"USD"},"promotions":[{"bonus":[{"image_url":"https://cdn.xsolla.net/img/misc/images/2fc5c491a47413a8e8000447889093c2.png","name":"Xsolla Minigun","quantity":1,"sku":"com.xsolla.minigun_1","type":"virtual_good"}],"date_end":"2026-04-15T16:16:00+03:00","date_start":"2020-04-15T16:16:00+03:00","discount":{"percent":"50.00"},"name":"Bonus promotion"}],"quantity":123,"sku":"com.xsolla.booster_mega_1","type":"virtual_good","virtual_item_type":"consumable","virtual_prices":[],"vp_rewards":[{"amount":130,"image_url":"https://cdn3.xsolla.com/img/misc/images/54c0cf9d345817cdacfdde198db178e0.jpg","item_id":175232,"name":"Value point","sku":"com.xsolla.value_point_1"},{"amount":50,"image_url":"https://cdn3.xsolla.com/img/misc/images/54c0cf9d345817cdacfdde198db178e0.jpg","is_clan":true,"item_id":186321,"name":"Clan Reward VP 1","sku":"com.xsolla.clan_value_point_1"}]}] - `items.attributes` (array) 与商品对应的属性及其值的列表。可用于目录筛选。 Example: {"value":{"external_id":"genre","name":"Жанр","values":[{"external_id":"genre_e3364991f92e751689a68b96598a5a5a84010b85","value":"Casual"},{"external_id":"genre_eba07bfd0f982940773cba3744d97264dd58acd7","value":"Strategy"},{"external_id":"genre_b8d0c6d8f0524c2b2d79ebb93aa3cd0e8b5199a8","value":"Mobile"}]}} - `items.attributes.external_id` (string) 唯一属性ID。 external_id只能包含大小写英文字母和数字字符、破折号和下划线。 Example: "attribute_1" - `items.attributes.name` (string) 属性名称。 Example: "Genre" - `items.attributes.values` (array) - `items.attributes.values.external_id` (string) 属性的唯一值ID。 external_id只能包含小写英文字母和数字字符、破折号和下划线。 Example: "attribute_value" - `items.attributes.values.value` (string) 属性值。 Example: "Strategy" - `items.can_be_bought` (boolean) 如为true,则用户可以购买商品。 Example: true - `items.description` (string) - `items.groups` (array) - `items.groups.external_id` (string) - `items.groups.name` (string) - `items.image_url` (string) - `items.limits` (object,null) 商品限制。 - `items.limits.per_item` (object,null) 商品的购买限制。 - `items.limits.per_item.available` (integer) 所有用户可购买的剩余商品数量。 Example: 3 - `items.limits.per_item.total` (integer) 所有用户可购买的最大商品数量。 Example: 5 - `items.limits.per_user` (object,null) 一个用户的购买数量限制。 - `items.limits.per_user.available` (integer) 当前用户可购买的剩余商品数量。 Example: 3 - `items.limits.per_user.limit_exceeded_visibility` (string) 设定商品在达到购买限制后、下次限制重置前在目录中的可见性。 适用于在recurrent_schedule数组中配置了周期性重置数量限制的商品。 若未配置数量限制重置,则商品在达到购买限制后将不会出现在目录中,无论limit_exceeded_visibility值为何。 Enum: "show", "hide" - `items.limits.per_user.recurrent_schedule` (object) 用户的商品限制循环刷新周期。 - `items.limits.per_user.recurrent_schedule.interval_type` (string) 循环刷新周期类型。 Enum: "daily", "weekly", "monthly", "hourly" - `items.limits.per_user.recurrent_schedule.reset_next_date` (integer) 重置限制次数的日期和时间(Unix时间戳)。 Example: 1677553200 - `items.limits.per_user.total` (integer) 单个用户可购买的最大商品数量。 Example: 5 - `items.periods` (array,null) 商品促销时间段。 - `items.periods.date_from` (string) 指定商品促销开始的日期。 Example: "2020-08-11T10:00:00+03:00" - `items.periods.date_until` (string,null) 指定商品停止促销的日期。可以为null。 Example: "2020-08-11T20:00:00+03:00" - `items.price` (object,null) 商品价格。 - `items.price.amount` (string) 折扣后的商品价格。 Example: "2.9900" - `items.price.amount_without_discount` (string) 商品价格。 Example: "2.9900" - `items.price.currency` (string) 商品价格货币。每[ISO 4217](https://en.wikipedia.org/wiki/ISO_4217)。 Example: "USD" - `items.promotions` (array) 应用于购物车中指定商品的促销活动。仅在以下情况下返回该数组: * 为某商品配置了折扣促销活动。 * 应用了对所选商品提供折扣设置的促销码。 如果未应用任何商品级促销活动,则返回空数组。 - `items.promotions.bonus` (array) - `items.promotions.bonus.bundle_type` (string) 奖励捆绑包商品类型。仅适用于bundle奖励品类型。 Enum: "standard", "virtual_currency_package" - `items.promotions.bonus.image_url` (string) 奖励商品图片URL。不适用于physical_good奖励品类型。 - `items.promotions.bonus.name` (string) 奖励品名称。不适用于physical_good奖励品类型。 - `items.promotions.bonus.quantity` (integer) - `items.promotions.bonus.sku` (string) - `items.promotions.bonus.type` (string) 奖励品类型。 Enum: "virtual_good", "virtual_currency", "bundle", "physical_good", "game_key", "nft" - `items.promotions.date_end` (string,null) - `items.promotions.date_start` (string,null) - `items.promotions.discount` (object,null) - `items.promotions.discount.percent` (string,null) - `items.promotions.discount.value` (string,null) - `items.promotions.limits` (object) - `items.promotions.limits.per_user` (object) - `items.promotions.limits.per_user.available` (integer) - `items.promotions.limits.per_user.total` (integer) - `items.type` (string) - `items.virtual_item_type` (string) 虚拟物品的类型。 Enum: "consumable", "non_consumable", "non_renewing_subscription" - `items.virtual_prices` (array) - `items.vp_rewards` (array) 奖励积分商品奖励。 - `items.vp_rewards.amount` (integer) 奖励积分的数量。 - `items.vp_rewards.image_url` (string) 图像URL。 Example: "https://image.example.com" - `items.vp_rewards.is_clan` (boolean) 该奖励积分是否用于公会奖励链。 Example: true - `items.vp_rewards.item_id` (integer) 内部唯一物品ID。 Example: 1 - `items.vp_rewards.name` (string) 奖励积分名称。 - `items.vp_rewards.sku` (string) 唯一奖励积分ID。 - `price` (object,null) 购物车价格。 Example: {"amount":"6150.0000000000000000","amount_without_discount":"6150.0000000000000000","currency":"USD"} - `price.amount` (string) Example: "6150.0000000000000000" - `price.amount_without_discount` (string) Example: "6150.0000000000000000" - `price.currency` (string) Example: "USD" ## 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 422 fields (application/json): - `errorCode` (integer) Example: 1102 - `errorMessage` (string) Example: "[0401-1102]: Unprocessable Entity. The property `id` is required" - `statusCode` (integer) Example: 422 - `transactionId` (string) Example: "x-x-x-x-transactionId-mock-x-x-x"