Update cart (integrity + replace)
curl --request POST \
--url https://api.mannco.store/cart/update \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{}'import requests
url = "https://api.mannco.store/cart/update"
payload = {}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({})
};
fetch('https://api.mannco.store/cart/update', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"err": false,
"success": true,
"content": {
"integrity": {
"valid": false,
"invalidItems": [
{
"cartId": 42,
"assetId": "987654321",
"reason": "price_changed",
"currentPrice": 16000,
"expectedPrice": 15000
}
]
},
"replaced": [
{
"cartId": 42,
"oldAssetId": "987654321",
"newAssetId": "987654999",
"reason": "price_changed"
}
],
"removed": [],
"cart": [
{
"cartId": 42,
"assetId": "987654999",
"count": 1,
"item_id": 5678,
"price": 15000
}
]
}
}{
"err": true,
"success": false,
"content": "Error message"
}{
"err": true,
"success": false,
"content": "forbidden"
}{
"err": true,
"success": false,
"content": "Internal server error"
}Cart
Update cart (integrity + replace)
Runs cart integrity checks and optionally fixes the cart: verifies each item still exists, is for sale, and has the same price; replaces invalid plain items with equivalent listings at the same price; deletes empty rows. Use before checkout.
Permission: Connected + API.
POST
/
cart
/
update
Update cart (integrity + replace)
curl --request POST \
--url https://api.mannco.store/cart/update \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{}'import requests
url = "https://api.mannco.store/cart/update"
payload = {}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({})
};
fetch('https://api.mannco.store/cart/update', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"err": false,
"success": true,
"content": {
"integrity": {
"valid": false,
"invalidItems": [
{
"cartId": 42,
"assetId": "987654321",
"reason": "price_changed",
"currentPrice": 16000,
"expectedPrice": 15000
}
]
},
"replaced": [
{
"cartId": 42,
"oldAssetId": "987654321",
"newAssetId": "987654999",
"reason": "price_changed"
}
],
"removed": [],
"cart": [
{
"cartId": 42,
"assetId": "987654999",
"count": 1,
"item_id": 5678,
"price": 15000
}
]
}
}{
"err": true,
"success": false,
"content": "Error message"
}{
"err": true,
"success": false,
"content": "forbidden"
}{
"err": true,
"success": false,
"content": "Internal server error"
}Authorizations
JWT obtained from POST /user/login
Body
application/json
The body is of type object.
Response
Updated
Standard Mannco.store response envelope. err and success flag the outcome; the payload (or error message) is always under content.