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.
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 |
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 |
required | Array of objects non-empty | ||||||||
Array (non-empty)
| |||||||||
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 | |||||||||
The cart with items was successfully returned.
Basic authentication not passed or wrong. Make sure you used basic authentication or correct credentials.
The user was not found. Make sure the x-user-for
or x-user-id
token is correct.
Invalid cart. Check that cart exists, not empty, and all items in it are not free.
{- "currency": "USD",
- "items": [
- {
- "sku": "cup01",
- "quantity": 2,
- "amount": "5.99",
- "amount_without_discount": "5.99"
}, - {
- "sku": "t-shirt01",
- "quantity": 1,
- "amount": "3.99",
- "amount_without_discount": "4.99"
}, - {
- "sku": "cup01",
- "quantity": 1,
- "amount": "0",
- "amount_without_discount": "5.99"
}, - {
- "sku": "hat01",
- "quantity": 1,
- "amount": "2.99",
- "amount_without_discount": "2.99"
}
]
}
{- "cart_id": "cart_id",
- "is_free": false,
- "items": [
- {
- "attributes": [ ],
- "description": "The cup of tea",
- "groups": [
- {
- "external_id": "cups",
- "name": "Cups"
}
], - "is_free": false,
- "is_bonus": false,
- "name": "Cup",
- "price": {
- "amount": "5.99",
- "amount_without_discount": "5.99",
- "currency": "USD"
}, - "quantity": 2,
- "sku": "cup01",
- "type": "physical_good",
- "virtual_prices": [ ],
- "promotions": [ ],
- "can_be_bought": true,
- "vp_rewards": [
- {
- "item_id": 175232,
- "sku": "value_point_1",
- "amount": 130,
- "name": "Value point",
}
], - "limits": {
- "per_user": {
- "available": 3,
- "recurrent_schedule": {
- "interval_type": "weekly",
- "reset_next_date": 1746057600
}, - "total": 5
}
}, - "periods": [
- {
- "date_from": "2020-08-11T10:00:00+03:00",
- "date_until": "2020-08-11T20:00:00+03:00"
}
]
}, - {
- "attributes": [ ],
- "description": "Wonderful white T-shirt",
- "groups": [ ],
- "is_free": false,
- "is_bonus": false,
- "name": "White T-shirt",
- "price": {
- "amount": "3.99",
- "amount_without_discount": "4.99",
- "currency": "USD"
}, - "quantity": 1,
- "sku": "t-shirt01",
- "type": "physical_good",
- "virtual_prices": [ ],
- "promotions": [
- {
- "name": "Bonus promotion",
- "date_start": "2020-04-15T16:16:00+03:00",
- "date_end": "2026-04-15T16:16:00+03:00",
- "discount": {
- "percent": "50.00"
}, - "bonus": [
- {
- "quantity": 1,
- "name": "Xsolla Minigun",
- "sku": "minigun_1",
- "type": "virtual_good"
}
]
}
], - "can_be_bought": true,
- "vp_rewards": [
- {
- "item_id": 175232,
- "sku": "value_point_1",
- "amount": 130,
- "name": "Value point",
}
], - "limits": {
- "per_user": {
- "available": 3,
- "recurrent_schedule": {
- "interval_type": "weekly",
- "reset_next_date": 1746057600
}, - "total": 5
}
}, - "periods": [
- {
- "date_from": "2020-08-11T10:00:00+03:00",
- "date_until": "2020-08-11T20:00:00+03:00"
}
]
}, - {
- "attributes": [ ],
- "description": "Wonderful white T-shirt",
- "groups": [
- {
- "external_id": "clothes",
- "name": "Clothes"
}
], - "is_free": true,
- "is_bonus": false,
- "name": "Cat's cup",
- "price": null,
- "quantity": 1,
- "sku": "cup01",
- "type": "physical_good",
- "virtual_prices": [ ],
- "promotions": [ ],
- "can_be_bought": true,
- "vp_rewards": [
- {
- "item_id": 175232,
- "sku": "value_point_1",
- "amount": 130,
- "name": "Value point",
}
], - "limits": {
- "per_user": {
- "available": 3,
- "recurrent_schedule": {
- "interval_type": "weekly",
- "reset_next_date": 1746057600
}, - "total": 5
}
}, - "periods": [
- {
- "date_from": "2020-08-11T10:00:00+03:00",
- "date_until": "2020-08-11T20:00:00+03:00"
}
]
}
], - "warnings": [
- {
- "sku": "hat01",
- "quantity": 1,
- "errorCode": 4001,
- "errorMessage": "[0401-4001]: Item with Project Id = 44056 and Sku = hut01 not found"
}
], - "price": {
- "amount": "15.97",
- "amount_without_discount": "22.96",
- "currency": "USD"
}, - "promotions": [
- {
- "name": "Bonus promotion",
- "date_start": "2020-04-15T16:16:00+03:00",
- "date_end": "2026-04-15T16:16:00+03:00",
- "discount": {
- "percent": "50.00"
}, - "bonus": [
- {
- "quantity": 1,
- "name": "Xsolla Minigun",
- "sku": "minigun_1",
- "type": "virtual_good"
}
]
}
]
}