# 更新捆绑包 更新捆绑包。 Endpoint: PUT /v2/project/{project_id}/admin/items/bundle/sku/{sku} Version: 2.0.0 Security: basicAuth ## Path parameters: - `project_id` (integer, required) 项目ID。您可以在您的发布商帐户项目名称旁边找到。 Example: 44056 - `sku` (string, required) 捆绑包SKU。 Example: "kg_1" ## Request fields (application/json): - `attributes` (array) 属性列表。 注意:为每个商品指定的属性不能超过20个。任何超出限制的尝试都会导致错误。 - `attributes.external_id` (string, required) 唯一属性ID。 external_id只能包含大小写英文字母和数字字符、破折号和下划线。 Example: "attribute_1" - `attributes.name` (object) 包含本地化属性名称的对象。编码按照ISO 3166-1的规定。 Example: {"de":"Genre","en":"Genre"} - `attributes.values` (array, required) 注意:为每个属性创建的值不能超过6个。任何超出限制的尝试都会导致错误。 Example: [{"external_id":"strategy","value":{"de":"Strategie","en":"Strategy"}},{"external_id":"action","value":{"de":"Aktion","en":"Action"}}] - `attributes.values.external_id` (string, required) 属性的唯一值ID。 external_id只能包含小写英文字母和数字字符、破折号和下划线。 Example: "attribute_value" - `attributes.values.value` (object, required) 包含本地化值名称的对象。编码按照ISO 3166-1的规定。 Example: {"de":"Strategie","en":"Strategy"} - `bundle_type` (string) 捆绑包类型。使用standard创建包含商品的捆绑包,并指定捆绑包中所含商品的SKU。 使用partner_side_content创建一个空的捆绑包,并使用[Webhook](https://developers.xsolla.com/zh/zh/webhooks/operation/personalized-partner-catalog/)在己侧添加商品。此类型仅用于[合作伙伴侧的目录个性化](https://developers.xsolla.com/zh/doc/shop-builder/features/personalization/#guides_personalization_on_partner_side)。 Enum: "standard", "partner_side_content" - `content` (array) Example: [{"quantity":1,"sku":"com.xsolla.kg_1"}] - `content.quantity` (integer) 所选商品在捆绑包中的数量。 Example: 1 - `content.sku` (string, required) 唯一商品ID。 SKU只能包含大小写英文字母和数字字符、句点、破折号和下划线。 Example: "bundle_1" - `custom_attributes` (object) 包含商品属性和值的JSON对象。属性允许您向商品添加更多信息,例如玩家使用该商品所需的等级。属性可丰富游戏的内部逻辑,并且可以通过专用的GET方法和webhook进行访问。 - `description` (object,null, required) 包含本地化商品描述的对象。值接受以下两种格式之一:两个小写字母的语言代码(例如,en)或五个字符的区域设置代码(例如,en-US)。虽然两种格式都可作为输入接受,但响应会返回两个小写字母的语言代码。当为同一种语言提供了两种输入时(例如:en和en-US),将存储最后提供的值。您可以在[文档](/zh/doc/shop-builder/references/supported-languages/)中找到支持语言的完整列表。 - `groups` (array) 商品所属的组。 注:字符串值引用组external_id。 Example: ["honor"] - `image_url` (string,null) 图像URL。 Example: "https://image.example.com" - `is_enabled` (boolean) 如果禁用,则无法找到和购买该商品。 Example: true - `is_free` (boolean) 如果为true,则该商品为免费。 - `is_show_in_store` (boolean) 商品可供购买。 Example: true - `limits` (object) 商品限制。 - `limits.per_item` (integer,null) 全局商品限制。 Example: 10 - `limits.per_user` (any) 用于单独用户的商品限制。 - `limits.recurrent_schedule` (object,null) 限制次数刷新周期。 - `limits.recurrent_schedule.per_user` (any) 按指定小时间隔执行购买限制数重置。 - `long_description` (object,null) 包含商品详细本地化描述的对象。值接受以下两种格式之一:两个小写字母的语言代码(例如,en)或五个字符的区域设置代码(例如,en-US)。虽然两种格式都可作为输入接受,但响应会返回两个小写字母的语言代码。当为同一种语言提供了两种输入时(例如:en和en-US),将存储最后提供的值。您可以在[文档](/zh/doc/shop-builder/references/supported-languages/)中找到支持语言的完整列表。 - `media_list` (array,null) 捆绑包的附加资源。 Example: [{"type":"image","url":"https://cdn3.xsolla.com/img/misc/images/71ab1e12126f2103e1868076f0acb21a.jpg"}] - `media_list.type` (string) 媒体类型:image/video。 Enum: "image", "video" - `media_list.url` (string) 资源文件。 Example: "https://cdn3.xsolla.com/img/misc/images/71ab1e12126f2103e1868076f0acb21a.jpg" - `name` (object,null, required) 包含商品本地化名称的对象。值接受以下两种格式之一:两个小写字母的语言代码(例如,en)或五个字符的语言代码(例如,en-US)。虽然两种格式都可作为输入接受,但响应会返回两个小写字母的语言代码。当为同一种语言提供了两种输入时(例如:en和en-US),将存储最后提供的值。您可以在[文档](/zh/doc/shop-builder/references/supported-languages/)中找到支持语言的完整列表。 - `order` (integer) 列表中的捆绑包顺序优先级。 Example: 1 - `periods` (array,null) 商品促销时间段。 - `periods.date_from` (string) 指定商品促销开始的日期。 Example: "2020-08-11T10:00:00+03:00" - `periods.date_until` (string,null) 指定商品停止促销的日期。可以为null。 Example: "2020-08-11T20:00:00+03:00" - `prices` (array) 以真实货币表示的价格。 - `prices.amount` (string, required) 商品价格。 Example: "100.99" - `prices.country_iso` (string,null) 适用此价格的国家/地区。符合[ISO 3166-1 alpha 2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)的两字母代码。 Example: "US" - `prices.currency` (string, required) 商品价格货币。每[ISO 4217](https://en.wikipedia.org/wiki/ISO_4217)。 Example: "USD" - `prices.is_default` (boolean, required) 如果未指定用户货币下的价格,则使用默认价格来生成目录。 - `prices.is_enabled` (boolean, required) 价格已启用。 - `regions` (array) - `regions.id` (integer) Example: 1 - `vc_prices` (array,null) - `vc_prices.amount` (integer, required) - `vc_prices.is_default` (boolean, required) - `vc_prices.is_enabled` (boolean, required) ## Response 401 fields (application/json): - `errorCode` (integer) Example: 1020 - `errorMessage` (string) Example: "[0401-1020]: Error in Authentication method occurred" - `statusCode` (integer) Example: 401 ## Response 422 fields (application/json): - `errorCode` (integer) Example: 1102 - `errorMessage` (string) Example: "[0401-1102]: Unprocessable Entity. The property `property_name` is required" - `errorMessageExtended` (array) - `statusCode` (integer) Example: 422 - `transactionId` (string) Example: "x-x-x-x-transactionId-mock-x-x-x" ## Response 204 fields