API reference · Custom Cart
Edit Custom Cart
- Method
- PUT
- Route
-
/customCart/edit - Base URL
https://ws.autorei.net- Token
- Requires Bearer token
Opens this request in the public API documentation, the official source of the reference.
Description
Applies new items to a cart that has already been created, without generating another link: the cartId and the URL stay the same.
Request body (JSON)
| Field | Type | Required | Description |
|---|---|---|---|
cartId |
integer | Yes | Cart id, as it came in cartId on creation. |
updateType |
string | No | complement adds the quantities to the items already in the cart; replacement discards the old items and keeps only the ones sent. Always in lowercase. If omitted, each item sent enters as a new line. |
document |
string | Yes | CPF or CNPJ of the cart's customer. |
products |
array | Yes | Items to apply. |
cartName · sellerEmail · cartTypeName · cartTypeExternalId · metadata |
— | No | Same fields as in creation. |
Inside each item of products:
| Field | Type | Required | Description |
|---|---|---|---|
stockId |
integer | Yes | Id of the product's inventory in your store. It is the identification the cart accepts. |
quantity |
integer | Yes | Product quantity. |
virtualQuantity |
integer | No | Quantity in virtual inventory. |
warehouse |
integer | No | Id of the item's source warehouse. |
storeExternalId |
string | No | External id of the item's store. |
skuId |
integer | No | SKU id. |
partnerPartCode |
string | No | Your product code. |
key |
string | No | The item's own key. |
Business rules
The two values of updateType
complement looks up the item by stockId and adds the quantity sent to the one that was already there; new metadata is merged with the old. replacement erases the items that were in the cart and saves only the ones you sent; the metadata is also replaced.
The values are compared exactly, in lowercase. Any other text does not go down either path: the item sent becomes a new line in the cart and the old ones remain there.
Response · 200
Same structure as creation — status, message with the URL and cartId. The cartId and the URL are those of the cart you changed, not of a new one.
Errors
| Code | When |
|---|---|
| 400 | The change was not applied. The message comes from the cart service. |
| 401 | Token missing, malformed or expired. |
Example request
curl --request PUT 'https://ws.autorei.net/customCart/edit' \
--header 'Authorization: Bearer {{access_token}}' \
--header 'Content-Type: application/json' \
--data '{
"cartId": 4470001,
"updateType": "complement",
"document": "700.413.648-56",
"products": [
{
"stockId": 4410002,
"quantity": 5
}
]
}' Example responses
200Success — items applied to the cart
{
"status": "ok",
"message": "https://lojaexemplo.cws.digital/carrinho-personalizado/k7m2p9x4t1c6b8v3n5q0w7z2y4d6f8h1",
"cartId": 4470001
} Used in
- Use casesB2B customer portal: the typical path through the API
- Use casesB2B procurement and supplies: the typical path through the API
- Use casesGuided selling and counter sales: the typical path through the API
Related endpoints
Generated from the public API collection, published on 2026-09-04: api-docs.cws.digital.