API reference · Custom Cart
Edit Custom Cart
https://api.sandbox.cws.digital/customCart/editDescription
Applies new items to an existing cart, without generating another link: the cartId and the URL stay the same.
The items follow the same identification forms and the same sellerDocument as Create Custom Cart. The store is the cart's own store.
Request body
application/jsonRequired| Field | Type | Required | Description | Value |
|---|---|---|---|---|
| cartId | integer | Yes | Cart id, as it came in | |
| updateType | string | Yes |
Allowed values: complementreplacement | |
| document | string | Yes | CPF or CNPJ of the cart customer, with or without punctuation. | |
| products | array of object | Yes | Items to apply. Up to 100 items. Fields in products[] | |
| sellerDocument | string | No | CPF or CNPJ of the seller who owns the stock of the items, as in the creation. | |
| cartName | string | No | Cart name, for you to identify it later. | |
| sellerEmail | string | No | E-mail of the seller responsible for the cart. | |
| cartTypeName | string | No | Cart type name. | |
| cartTypeExternalId | string | No | External id of the cart type, in your system. | |
| metadata | array of object | No | Free data pairs for you to attach to the cart. Fields in metadata[] |
products[]| Field | Type | Required | Description | Value |
|---|---|---|---|---|
| quantity | integer | Yes | Product quantity. Greater than zero. | |
| warehouseId | integer | Conditional | Id of the item's warehouse, from the seller who owns the stock. Goes together with any identification form. | |
| brand | string | Conditional | Manufacturer brand. Goes together with | |
| mfrPartCode | string | Conditional | Product code at the manufacturer. Goes together with | |
| composition | string | Conditional | Product composition (e.g. | |
| skuAttributeName | string | Conditional | Name of the product attribute. Goes together with | |
| skuAttributeValue | string | Conditional | Value of the product attribute. Goes together with | |
| partnerPartCode | string | Conditional | Your product code in the warehouse. Goes together with | |
| key | string | No | Your own key for the item. It identifies the item in the | |
| storeExternalId | string | No | Id of the item in your system, saved in the cart item. |
metadata[]| Field | Type | Required | Description | Value |
|---|---|---|---|---|
| key | string | No | Data name. | |
| value | string | No | Data value. | |
| type | string | No | Data type. |
Business rules
The two values of updateType
complement looks up the item by the same product and the same key and adds the quantity sent to the one already there; the new metadata is merged with the old one.
replacement deletes the items that were in the cart and stores only the ones you sent; the metadata is also replaced.
The values are compared exactly, in lowercase.
Carts that can be edited
Only a cart that has not become an order nor been canceled or deleted. The cart must belong to your store, or to a store you are linked to.
Responses
- 401
Missing, malformed or expired token.