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:[
           0: {
              Price: 35
                            Sku: "1234568999"
                            TaxClass: ""
                            TaxStatus: "taxable"
                            Title: "Black Framed Sunglasses"
                            addons_meta_data: ""
                            discount_amount: 0
                            excl_tax: 0
                            incl_tax: 4.565217391304344
                            isTaxable: true
                            product_id: 16425
                            psummary: ""
                            quantity: 1
                            variation_id: 0
            }
        ]
    }
}

Parameters:

Attribute NameAttribute TypeDescriptionEnumRequired (Binary)
commandstringHigh level command name to interact with Olivernull1
methodstringThese correspond to create, read, update, and delete (or CRUD) operationsnull1
versionstringThe version of the command usednull1

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 NameAttribute TypeDescriptionEnumRequired (Binary)
commandstringHigh level command name to interact with Olivernull1
methodstringThese correspond to create, read, update, and delete (or CRUD) operationsnull1
versionstringThe version of the command usednull1
dataJS objectProduct objectnull1
product_idintegerProduct IDnull1
qtyintegerQuantity of productnull1
namestringProduct namenull0
discountfloat, 2 decimal placesAmount of discount ($) applied on productnull0
typestringProduct type'simple', 'variable', 'composite'0