# Fill cart with items Fills the current cart with items. If the cart already has an item with the same SKU, the existing item will be replaced by the passed value. Endpoint: PUT /v2/admin/project/{project_id}/cart/fill 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 name of the project. Example: 44056 ## Query parameters: - `locale` (string) Response language. Two-letter lowercase language code per ISO 639-1. ## Header parameters: - `x-user-for` (string) User identifier can be transferred by using the Xsolla Login User JWT or the Pay Station access token. Example: "ACCESS_TOKEN/LOGIN_JWT" - `x-user-id` (string) You can use your own user ID when selling a cart with games. Example: "UNIQUE_ID" ## Request fields (application/json): - `country` (string) Two-letter uppercase country code per [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2). Check the documentation for detailed information about [countries supported by Xsolla](https://developers.xsolla.com/doc/shop-builder/references/supported-countries/). Example: country=US Example: "US" - `currency` (string) The item price currency displayed in the cart. Three-letter code per [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). Check the documentation for detailed information about [currencies supported by Xsolla](https://developers.xsolla.com/doc/pay-station/references/supported-currencies/). Example: "USD" - `items` (array, required) - `items.sku` (string, required) Unique item ID. The SKU may contain only lowercase and uppercase Latin alphanumeric characters, periods, dashes, and underscores. Example: "t-shirt" - `items.quantity` (number, required) Quantity of the item. Example: 2 ## Response 200 fields (application/json): - `cart_id` (string) Cart ID. Pass it to query for buy page or payment API endpoints. Example: "cart_id" - `price` (object,null) Cart price. - `price.amount` (string) - `price.amount_without_discount` (string) - `price.currency` (string) - `is_free` (boolean) If true, a cart is free. - `items` (array) - `items.sku` (string) - `items.groups` (array) - `items.groups.external_id` (string) - `items.groups.name` (string) - `items.attributes` (array) List of attributes and their values corresponding to the item. Can be used for catalog filtering. 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) Unique attribute ID. The external_id may contain only lowercase and uppercase Latin alphanumeric characters, dashes, and underscores. Example: "attribute_1" - `items.attributes.name` (string) Name of attribute. Example: "Genre" - `items.attributes.values` (array) - `items.attributes.values.external_id` (string) Unique value ID for an attribute. The external_id may only contain lowercase Latin alphanumeric characters, dashes, and underscores. Example: "attribute_value" - `items.attributes.values.value` (string) Value of attribute. Example: "Strategy" - `items.type` (string) - `items.description` (string) - `items.image_url` (string) - `items.quantity` (integer) - `items.is_free` (boolean) If true, the item is free. - `items.is_bonus` (boolean) - `items.promotions` (array) Applied promotions for specific items in the cart. The array is returned in the following cases: * A discount promotion is configured for a specific item. * A promo code with the Discount on selected items setting is applied. If no item-level promotions are applied, an empty array is returned. - `items.promotions.date_start` (string,null) - `items.promotions.date_end` (string,null) - `items.promotions.discount` (object,null) - `items.promotions.discount.percent` (string,null) - `items.promotions.discount.value` (string,null) - `items.promotions.bonus` (array) - `items.promotions.bonus.type` (string) Bonus item type. Enum: "virtual_good", "virtual_currency", "bundle", "physical_good", "game_key", "nft" - `items.promotions.bonus.name` (string) Bonus item name. Not available for physical_good bonus item type. - `items.promotions.bonus.image_url` (string) Bonus item image URL. Not available for physical_good bonus item type. - `items.promotions.bonus.bundle_type` (string) Bonus bundle item type. Available only for bundle bonus item type. Enum: "standard", "virtual_currency_package" - `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.can_be_bought` (boolean) If true, the user can buy an item. Example: true - `items.vp_rewards` (array) Value point item reward. - `items.vp_rewards.item_id` (integer) Internal unique item ID. Example: 1 - `items.vp_rewards.sku` (string) Unique value point ID. - `items.vp_rewards.amount` (integer) Amount of value points. - `items.vp_rewards.name` (string) Value point name. - `items.vp_rewards.image_url` (string) Image URL. Example: "https://image.example.com" - `items.vp_rewards.is_clan` (boolean) Whether the value point is used in clan reward chains. Example: true - `items.limits` (object,null) Item limits. - `items.limits.per_user` (object,null) Item limits for a user. - `items.limits.per_user.total` (integer) Maximum number of items a single user can purchase. Example: 5 - `items.limits.per_user.available` (integer) Remaining number of items the current user can purchase. Example: 3 - `items.limits.per_user.recurrent_schedule` (object) Item limits recurrent refresh period for a user. - `items.limits.per_user.recurrent_schedule.interval_type` (string) Recurrent refresh period type. Enum: "daily", "weekly", "monthly", "hourly" - `items.limits.per_user.recurrent_schedule.reset_next_date` (integer) Date and time when limits reset (Unix Timestamp). Example: 1677553200 - `items.limits.per_user.limit_exceeded_visibility` (string) Determines the visibility of the item in the catalog after the purchase limit is reached, until the next limit reset. Applies to items for which recurring limit resets are configured in the recurrent_schedule array. If limit resets are not configured, the item doesn't appear in the catalog after the purchase limit is reached, regardless of the limit_exceeded_visibility value. Enum: "show", "hide" - `items.limits.per_item` (object,null) Item limits for an item. - `items.limits.per_item.total` (integer) Maximum number of items all users can purchase. Example: 5 - `items.limits.per_item.available` (integer) Remaining number of items all users can purchase. Example: 3 - `items.periods` (array,null) Item sales period. - `items.periods.date_from` (string) Date when the specified item will be available for sale. Example: "2020-08-11T10:00:00+03:00" - `items.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" - `items.price` (object,null) Item price. - `items.virtual_prices` (array) Virtual prices. - `items.virtual_prices.amount` (integer) Item price in virtual currency with a discount. Example: 100 - `items.virtual_prices.amount_without_discount` (integer) Item price in virtual currency. Example: 200 - `items.virtual_prices.sku` (string) Virtual currency item SKU. Example: "gold" - `items.virtual_prices.is_default` (boolean) Whether the price is default for an item. Example: true - `items.virtual_prices.image_url` (string,null) Image of virtual currency. Example: "http://image.png" - `items.virtual_prices.name` (string) Virtual currency name. Example: "Gold" - `items.virtual_prices.type` (string) Virtual currency type. Example: "virtual_currency" - `items.virtual_prices.description` (string,null) Virtual currency description. Example: "Most popular gold" - `promotions` (array) Applied promotions for the entire cart. The array is returned in the following cases: * A promotion affects the total cart amount, such as a promo code with the Discount on purchase setting. * A promotion adds bonus items to the cart. If no order-level promotions are applied, an empty array is returned. - `warnings` (array) - `warnings.errorCode` (integer) - `warnings.errorMessage` (string) ## Response 401 fields (application/json): - `statusCode` (integer) Example: 401 - `errorCode` (integer) Example: 1020 - `errorMessage` (string) Example: "[0401-1020]: Error in Authentication method occurred" ## Response 404 fields (application/json): - `statusCode` (integer) Example: 404 - `errorCode` (integer) Example: 5008 - `errorMessage` (string) Example: "[0401-5008]: Could not find User" ## Response 422 fields (application/json): - `errorCode` (integer) Example: 1401 - `statusCode` (integer) Example: 422 - `errorMessage` (string) Example: "[0401-1401]: Invalid cart"