Xsolla-logoXsolla Developers
or
To Publisher Account

Fill cart by cart ID with itemsServer-side

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.

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 contain only lowercase and uppercase Latin alphanumeric characters, periods, dashes, and underscores.

quantity
required
number >= 1

Quantity of the item.

country
string = 2 characters

Two-letter uppercase country code per ISO 3166-1 alpha-2. Check the documentation for detailed information about countries supported by Xsolla.
Example: country=US

currency
string = 3 characters

The item price currency displayed in the cart. Three-letter code per ISO 4217. Check the documentation for detailed information about currencies supported by Xsolla.

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": []
}