API reference · Custom Cart
Create Custom Cart
- Method
- POST
- Route
-
/customCart/create - 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
Creates a cart with preselected products for a customer and returns the cart's access link, for you to send to the customer. The customer opens the link and completes the purchase with the items already assembled.
Request body (JSON)
| Field | Type | Required | Description |
|---|---|---|---|
cartName |
string | Yes | Cart name, so you can identify it later. |
document |
string | Yes | Customer's CPF or CNPJ. The customer must exist in your store. |
products |
array | Yes | Cart items. |
sellerEmail |
string | No | Email of the sales rep responsible for the cart. |
cartTypeName |
string | No | Cart type name. |
cartTypeExternalId |
string | No | External id of the cart type, in your system. |
metadata |
array | No | Free data pairs for you to attach to the cart. |
metadata[].key · metadata[].value · metadata[].type |
string | — | Key, value and type of the data. |
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 cart link comes in the message field
The response has no dedicated field for the URL: the link arrives in message. The final part of the link is the cart key — it is what appears in queries as access_hash.
Response · 200
| Field | Type | Description |
|---|---|---|
status |
string | ok on success. |
message |
string | Cart URL to send to the customer. |
cartId |
integer | Cart id. Use it to change or delete. |
Errors
| Code | When |
|---|---|
| 400 | The cart was not created. The message comes from the cart service — for example account not found when the document does not match a customer in your store, or stockId incorreto when the item is not from your store. |
| 401 | Token missing, malformed or expired. |
Example request
curl --request POST 'https://ws.autorei.net/customCart/create' \
--header 'Authorization: Bearer {{access_token}}' \
--header 'Content-Type: application/json' \
--data '{
"cartName": "Proposta Ana Paula - setembro",
"document": "700.413.648-56",
"sellerEmail": "integracao@lojaexemplo.com.br",
"products": [
{
"stockId": 4410001,
"quantity": 2
},
{
"stockId": 4410002,
"quantity": 1
}
]
}' Example responses
200Success — cart created
{
"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.