Xsolla-logo

Fill cart by cart ID with items and prices

put/v2/admin/project/{project_id}/cart/{cart_id}/fill

Fills the cart by cart ID with items. If the cart already has an item with the same SKU, the existing item will be replaced by the passed value.

SecuritybasicAuth
Request
path Parameters
project_id
required
integer

Project ID. You can find this parameter in your Publisher Account next to the name of the project.

Example: 44056
cart_id
required
string

Cart ID.

Example: custom_id
query Parameters
locale
string
Default: "en"

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 <= 32 characters

You can use your own user ID when selling a cart with games or physical goods.

Example: UNIQUE_ID
Request Body schema: application/json
required
Array of objects non-empty
Array (non-empty)
sku
required
string non-empty

Unique item ID. The SKU may only contain lowercase Latin alphanumeric characters, periods, dashes, and underscores.

quantity
required
number >= 1

Quantity of the item.

amount
string^([0-9]*[.])?[0-9]+$

Discounted item price. This parameter should be used to pass the discounted item price if you keep the item prices on your side. It will only work if enabled for your account. Contact us to enable it.

amount_without_discount
string^([0-9]*[.])?[0-9]+$

Item price. This parameter should be used to pass the item price if you keep the item prices on your side. It will only work if enabled for your account. Contact us to enable it.

country
string = 2 characters

Country format should follow the ISO 3166-1 alpha-2 standard.

currency
string = 3 characters

Purchase currency. Three-letter code per ISO 4217.

object
limit_method_count
integer [ 0 .. 16 ]

Number of displayed shipping methods.

free_method_count
integer [ 1 .. 16 ]

Number of free shipping methods.

Responses
200

The cart with items was successfully returned.

401

Basic authentication not passed or wrong. Make sure you used basic authentication or correct credentials.

404

The user was not found. Make sure the x-user-for or x-user-id token is correct.

422

Invalid cart. Check that cart exists, not empty, and all items in it are not free.

Request samples
application/json
{
  • "currency": "USD",
  • "items": [
    ]
}
Response samples
application/json
{
  • "cart_id": "cart_id",
  • "is_free": false,
  • "items": [
    ],
  • "warnings": [
    ],
  • "price": {
    },
  • "promotions": []
}