addProductToCart
This app commands allows users to add products to the cart. Some products can have different variations such as colors or models with different prices. The variants attribute is an list array that contains the list of variations for the product added to cart. Each variant has a name, quantity and price.
POST
Description:
Add a product to the cart.
Request Body:
{
command: 'addProductToCart',
method: 'post',
version: '1.0',
product_id: 1125,
product_name: 'fridge',
total_quantity: 2,
total_price: 65.00
variants: [
{
name: 'Sleek black',
quantity: 1,
price: 40.00
},
{
name: 'ivory white',
quantity: 1,
price: 25.00
},
{
name: 'Sea blue',
quantity: 0,
price: 32.00
}
],
metadata: {
attr1: '...',
attr2: '...',
...
}
}
Remarks: Variants are printed and added as info in the cart view.
Response Body:
{
command: 'addProductToCart',
method: 'post',
version: '1.0',
status_code: 200,
error: null
}
Parameters:
Attribute Name | Attribute Type | Description | Enum | Required (Binary) |
---|---|---|---|---|
command | string | High level command name to interact with Oliver | null | 1 |
method | string | These correspond to create, read, update, and delete (or CRUD) operations | null | 1 |
version | string | The version of the command used | null | 1 |
product_id | integer | Product ID | null | 1 |
product_name | string | Product Name | null | 1 |
total_quantity | integer | Total quantity of products | null | 1 |
total_price | float, 2 decimal places | Total Price | null | 1 |
variants | array | List of variants of the product | null | 0 |
name | string | Name of each variant | null | if (variants) 1 |
quantity | integer | Quantity of each variant | null | 0 |
price | float, 2 decimal places | Price of each variant | null | 0 |
metadata | JS object | Optional metadata | null | 0 |
Updated 7 months ago