Cart
This app command allows users to manipulate items in the cart. Each item object consists of product id, quantity, name, amount of discount applied and product type.
GET
Description:
Get all items inside a cart and their information such as product id, quantity, name, discount applied and type of product.
Request Body:
{
command: 'Cart',
method: 'get',
version: '1.0'
}
Response Body:
{
command: 'Cart',
method: 'get',
version: '1.0',
status_code: 200,
error: null,
data: {
items:[
{
product_id: 6411,
qty: 1,
name: 'Haribo Gummy bears (500g)',
discount: 0,
type: 'simple'
},
{
product_id: 1524,
qty: 2,
name: 'Grey Goose Vodka',
discount: 4.00,
type: 'variable'
},
{
product_id: 2155,
qty: 1,
name: '12 packs shot glasses',
discount: 0,
type: 'simple'
}
]
}
}
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 |
POST
Description:
Add new item(s) into the cart.
Request Body:
{
command: 'Cart',
method: 'post',
version: '1.0',
data: {
{
product_id: 3341,
qty: 1,
name: 'Samsung Galaxy Z Flip',
discount: 0,
type: ‘variable’
},
{
product_id: 1120,
qty: 1,
name: 'Samsung Galaxy Buds',
discount: 0,
type: 'variable'
}
}
}
Response Body:
{
command: 'Cart',
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 |
data | JS object | Product object | null | 1 |
product_id | integer | Product ID | null | 1 |
qty | integer | Quantity of product | null | 1 |
name | string | Product name | null | 0 |
discount | float, 2 decimal places | Amount of discount ($) applied on product | null | 0 |
type | string | Product type | 'simple', 'variable', 'composite' | 0 |
PUT
Description:
Edit existing item in the cart.
Request Body:
{
command: 'Cart',
method: 'put',
version: '1.0',
data: {
{
product_id: 3341,
qty: 2,
discount: 200.00,
type: 'variable'
}
}
}
Response Body:
{
command: 'Cart',
method: 'put',
version: '1.0',
status_code: 200,
error: null,
data: {
{
product_id: 3341,
qty: 2,
name: 'Samsung Galaxy Z Flip',
discount: 200.00,
type: 'variable'
},
{
product_id: 1120,
qty: 1,
name: 'Samsung Galaxy Buds',
discount: 0,
type: 'variable'
}
}
}
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 |
data | JS object | Product object | null | 1 |
product_id | integer | Product ID | null | 1 |
qty | integer | Quantity of product | null | 0 |
name | string | Product name | null | 0 |
discount | float, 2 decimal places | Amount of discount ($) applied on product | null | 0 |
type | string | Product type | 'simple', 'variable', 'composite' | 0 |
DELETE
Description:
Delete item from the cart.
Request Body:
{
command: 'Cart',
method: 'delete',
version: '1.0',
product_id: 1120
}
Response Body:
{
command: 'Cart',
method: 'delete',
version: '1.0',
status_code: 200,
error: null,
data: {
{
product_id: 3341,
qty: 2,
name: 'Samsung Galaxy Z Flip',
discount: 200.00,
type: 'variable'
}
}
}
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 |
Updated 10 months ago