# Create bundle

Creates a bundle — a set of items sold as a single unit. A bundle can contain virtual items, virtual currency packages, game keys, and other bundles. For more information, refer to the Bundles section.


NoticeAll items in the content array must be created in your project in advance. The system returns an error if the specified SKU doesn't exist.

Endpoint: POST /v2/project/{project_id}/admin/items/bundle
Version: 2.0.0
Security: basicAuth

## Path parameters:

  - `project_id` (integer, required)
    Project ID. You can find this parameter in your Publisher Account next to the project name and in the browser address bar when working with a project. The URL has the following format: https://publisher.xsolla.com//projects/.
    Example: 44056

## Request fields (application/json):

  - `sku` (string, required)
    Unique item ID. The SKU may contain only lowercase and uppercase Latin alphanumeric characters, periods, dashes, and underscores.

  - `name` (object,null, required)
    Object with localizations for item’s name. Accepts value in one of two formats: two-letter lowercase language codes (e.g., en) or five-character language codes (e.g., en-US). While both formats are accepted as input, responses return two-letter lowercase language codes. When both options for the same language are provided (e.g., en and en-US), the last provided value is stored. You can find the full list of supported languages in the [documentation](/doc/shop-builder/references/supported-languages/).

  - `groups` (array)
    Groups the item belongs to.
Note. The string value refers to group external_id.

  - `attributes` (array)
    List of attributes.
Attention. You can't specify more than 20 attributes for the item. Any attempts to exceed the limit result in an error.

  - `attributes.external_id` (string, required)
    Unique attribute ID. The external_id may contain only lowercase and uppercase Latin alphanumeric characters, dashes, and underscores.

  - `attributes.name` (object)
    Object with localizations for attribute's name. Keys are specified in ISO 3166-1.

  - `attributes.values` (array, required)
    Attention. You can't create more than 6 values for each attribute. Any attempts to exceed the limit result in an error.
    Example: [{"external_id":"strategy","value":{"en":"Strategy","de":"Strategie"}},{"external_id":"action","value":{"en":"Action","de":"Aktion"}}]

  - `attributes.values.external_id` (string, required)
    Unique value ID for an attribute. The external_id may only contain lowercase Latin alphanumeric characters, dashes, and underscores.
    Example: "value_external_id"

  - `attributes.values.value` (object, required)
    Object with localizations of the value's name. Keys are specified in ISO 3166-1.

  - `description` (object,null, required)
    Object with localizations for item’s description. Accepts value in one of two formats: two-letter lowercase language codes (e.g., en) or five-character locale codes (e.g., en-US).  While both formats are accepted as input, responses return two-letter lowercase language codes. When both options for the same language are provided (e.g., en and en-US), the last provided value is stored. You can find the full list of supported languages in the [documentation](/doc/shop-builder/references/supported-languages/).

  - `long_description` (object,null)
    Object with localizations for long description of item. Accepts value in one of two formats: two-letter lowercase language codes (e.g., en) or five-character locale codes (e.g., en-US).  While both formats are accepted as input, responses return two-letter lowercase language codes. When both variants for the same language are provided (e.g., en and en-US), the last provided value is stored. You can find the full list of supported languages in the [documentation](/doc/shop-builder/references/supported-languages/).

  - `image_url` (string,null)
    Image URL. For the image to display correctly and load quickly on the payment UI, check our image and URL guidelines:Supported formats: WebP (recommended), PNG, JPG.File size: ≤ 50 KB (for WebP) or ≤ 150 KB (for PNG and JPG).Image size: 280 x 280 px.Color space: sRGB.Protocol: HTTPS with long-lived caching for versioned URLs.

  - `prices` (array)
    Prices in real currencies.

  - `prices.amount` (string, required)
    Item price.

  - `prices.currency` (string, required)
    Item price currency. Three-letter code per [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217).

  - `prices.is_default` (boolean, required)
    Default price is used to build a catalog if no price in the user's currency is specified.

  - `prices.is_enabled` (boolean, required)
    The price is enabled.

  - `prices.country_iso` (string,null)
    Country where this price is available. Two-letter code per [ISO 3166-1 alpha 2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2).
    Example: "US"

  - `vc_prices` (any)

  - `bundle_type` (string)
    Bundle type. Use standard to create a bundle with items and specify the SKUs of the items included in the bundle.
Use partner_side_content to create an empty bundle and add items on your side using a [webhook](https://developers.xsolla.com/webhooks/operation/personalized-partner-catalog/). This type is used only for [Catalog personalization on partner side](https://developers.xsolla.com/doc/shop-builder/features/personalization/#guides_personalization_on_partner_side).
    Enum: "standard", "partner_side_content"

  - `content` (array)
    Array of items included in the bundle. Each entry specifies the item SKU and quantity. All items must be created in your project in advance. The system returns an error if the specified SKU doesn't exist.
    Example: [{"sku":"com.xsolla.kg_1","quantity":1}]

  - `content.sku` (string, required)
    SKU of an item to include in the bundle. The item must be created in your project in advance. The system returns an error if the specified SKU doesn't exist. Allowed characters: a–z, A–Z, 0–9, period (.), hyphen (-), underscore (_).
    Example: "com.xsolla.kg_1"

  - `content.quantity` (integer)
    Quantity of the selected items in the bundle.
    Example: 1

  - `is_free` (boolean)
    Whether the item is free.

  - `is_paid_randomized_reward` (boolean)
    Whether the item is a randomized paid reward, e.g., a loot box.

  - `is_enabled` (boolean)
    If disabled, the item can't be found and purchased.

  - `is_show_in_store` (boolean)
    Item is available for purchase.

  - `media_list` (any)

  - `order` (integer)
    Bundle's order priority in the list.

  - `regions` (array)

  - `regions.id` (integer)
    Example: 1

  - `limits` (object)
    Item limits.

  - `limits.per_user` (any)
    Item limitation for a separate user.

  - `limits.per_item` (integer,null)
    Global item limitation.

  - `limits.recurrent_schedule` (object,null)
    Limit refresh period.

  - `limits.recurrent_schedule.per_user` (any)
    Reset of the purchase limit performed at the specified time interval in hours.

  - `periods` (array,null)
    Item sales period.

  - `periods.date_from` (string)
    Date when the specified item will be available for sale.
    Example: "2020-08-11T10:00:00+03:00"

  - `periods.date_until` (string,null)
    Date when the specified item will become unavailable for sale. Can be null.
    Example: "2020-08-11T20:00:00+03:00"

  - `custom_attributes` (object)
    A JSON object containing item attributes and values. Attributes allow you to add more info to items like the player's required level to use the item. Attributes enrich your game's internal logic and are accessible through dedicated GET methods and webhooks.

## Response 201 fields (application/json):

  - `sku` (string)
    Unique item ID. The SKU may contain only lowercase and uppercase Latin alphanumeric characters, periods, dashes, and underscores.

## Response 401 fields (application/json):

  - `statusCode` (integer)
    Example: 401

  - `errorCode` (integer)
    Example: 1020

  - `errorMessage` (string)
    Example: "[0401-1020]: Error in Authentication method occurred"

## Response 422 fields (application/json):

  - `statusCode` (integer)
    Example: 422

  - `errorCode` (integer)
    Example: 1102

  - `errorMessage` (string)
    Example: "[0401-1102]: Unprocessable Entity. The property `property_name` is required"

  - `transactionId` (string)
    Example: "x-x-x-x-transactionId-mock-x-x-x"

  - `errorMessageExtended` (array)


