CartItem
The cart item can be a product OR a coupon. The property type defines which one it is. The key coupon is not set if the type is product and vice versa.
| Field | Type | Required | Description |
|---|---|---|---|
id |
string |
yes | Unique identifier of the cart item. It can be used to remove/manipulate the respective cart item. |
quantity |
number |
yes | Quantity of the cart item. |
type |
string |
yes | one of: product, coupon |
coupon |
CartItemCoupon | ||
product |
CartItemProduct | ||
messages |
array[Message] | All messages specific to the current cart item. |
Example
Section titled “Example”{ "id": "a84de7d7-2b7d-4aa8-a64d-9558ca791b86", "quantity": 5, "type": "product", "coupon": { "code": "20OFF", "description": "Reduces the cost of all products by 20%.", "label": "20% off of all products.", "savedPrice": {} }, "product": { "id": "10080466570", "name": "Awesome T-Shirt", "addtionalInfo": [ {} ], "featuredImageUrl": "https://myshop.example/images/product_xyz_featured.png", "properties": [], "price": {}, "appliedDiscounts": [] }, "messages": [ { "type": "error", "code": "EUNKNOWN", "message": "Some error occurred.", "translated": false } ]}
