Constructor

Cart

new Cart(cartId)

Constructor for Cart.

Parameter

cartId

Optional

string

Optional unique identifier for the cart.

Properties

id

string

ID for the cart. Optional.

lineItems

Array of LineItem

Items held in the order cart.

merchant

Object

Merchant providing the cart.

notes

string

Optional notes about the cart.

otherItems

Array of LineItem

Non-line items.

Methods

addLineItems

addLineItems(items) returns Cart

Adds a single item or list of items to the cart.

Parameter

items

(LineItem or Array of LineItem)

Line Items to add.

Returns

Cart Returns current constructed Cart.

addOtherItems

addOtherItems(items) returns Cart

Adds a single item or list of items to the non-items list of this cart.

Parameter

items

(LineItem or Array of LineItem)

Line Items to add.

Returns

Cart Returns current constructed Cart.

setMerchant

setMerchant(id, name) returns Cart

Set the merchant for this cart.

Parameter

id

string

Merchant ID.

name

string

Name of the merchant.

Returns

Cart Returns current constructed Cart.

setNotes

setNotes(notes) returns Cart

Set the notes for this cart.

Parameter

notes

string

Notes.

Returns

Cart Returns current constructed Cart.