Constructor

Cart

new Cart(cartId)

Constructor for Cart.

Parameter

Name Description

cartId

Optional

string

Optional unique identifier for the cart.

Methods

addLineItems

addLineItems(items) returns Cart

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

Parameter

Name Description

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

Name Description

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.

Parameters

Name Description

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

Name Description

notes

string

Notes.

Returns

Cart Returns current constructed Cart.