Class: cart

cart(domainOrOptionsopt)

new cart(domainOrOptionsopt)

Parameters:
Name Type Attributes Description
domainOrOptions string | object <optional>
The project domain or options object. If object, see the object's optional properties.
Properties
Name Type Attributes Description
domain string <optional>
The project domain
token object <optional>
auth token - object with value property and optional headerOrQueryName and isQuery properties
Source:

Methods

delete(xShopperId, xPrivateLabelId)

Clears contents of the target Shopper's Cart
Parameters:
Name Type Description
xShopperId string Shopper ID whose Cart should be modified, if it differs from authenticated
xPrivateLabelId integer PrivateLabelId to operate as, if different from JWT
Source:

deleteGroup(groupKey, xPrivateLabelId)

Removes the specified CartGroup from the target Shopper's Cart
Parameters:
Name Type Description
groupKey string CartGroup key to be deleted
xPrivateLabelId integer PrivateLabelId to operate as, if different from JWT
Source:

deleteItem(xShopperId, xPrivateLabelId, itemId)

Removes the specified CartItem from the target Shopper's Cart
Parameters:
Name Type Description
xShopperId string Shopper ID whose Cart should be modified, if it differs from authenticated
xPrivateLabelId integer PrivateLabelId to operate as, if different from JWT
itemId integer CartItem ID to be deleted
Source:

deleteMultipleItems(xShopperId, xPrivateLabelId, itemIds)

Removes multiple specified CartItems from the target Shopper's Cart
Parameters:
Name Type Description
xShopperId string Shopper ID whose Cart should be modified, if it differs from authenticated
xPrivateLabelId integer PrivateLabelId to operate as, if different from JWT
itemIds array IDs of CartItems to be deleted
Source:

get(xShopperId, xPrivateLabelId, xMarketId, xCurrencyId, includes)

Get contents of the target Shopper's Cart
Parameters:
Name Type Description
xShopperId string Shopper ID whose Cart should be retrieved, if it differs from authenticated
xPrivateLabelId integer PrivateLabelId to operate as, if different from JWT
xMarketId string Unique identifier of the Market in which the request is happening
xCurrencyId string Currency in which pricing information should be accepted and/or returned
includes array Optional properties to be included in the response. Including errors performs Product-specific extended validation, such as TLD-based Contact, Eligibility, and Presence requirements
Source:

productSchema(pfid, xPrivateLabelId)

Retrieves the schema which must be completed in order to purchase the specified product
Parameters:
Name Type Description
pfid integer Product ID whose schema should be retrieved
xPrivateLabelId integer PrivateLabelId to operate as, if different from JWT
Source:

renderVirtual(body, xShopperId, xPrivateLabelId, xMarketId, xCurrencyId)

Expands listings and adds prices the supplied virtual cart
Parameters:
Name Type Description
body CartUpdateBulk A virtual cart to expand and price
xShopperId string Shopper ID who owns this virtual cart, if it differs from authenticated
xPrivateLabelId integer PrivateLabelId to operate as, if different from JWT
xMarketId string Unique identifier of the Market in which the request is happening
xCurrencyId string Currency in which pricing information should be accepted and/or returned
Source:

replace(encryptedSourceShopperId, xShopperId)

Replace the target Shopper's Cart with source Shopper's Cart
Parameters:
Name Type Description
encryptedSourceShopperId string Encrypted source Shopper ID
xShopperId string Shopper ID whose Cart should be replaced by source Shopper's Cart,if it differs from authenticated
Source:

setToken(value, headerOrQueryName, isQuery)

Set Token
Parameters:
Name Type Description
value string token's value
headerOrQueryName string the header or query name to send the token at
isQuery boolean true if send the token as query param, otherwise, send as header param
Source:

update(xShopperId, xPrivateLabelId, xMarketId, body)

Applies the specified additions/changes to the target Shopper's Cart
Parameters:
Name Type Description
xShopperId string Shopper ID whose Cart should be modified, if it differs from authenticated
xPrivateLabelId integer PrivateLabelId to operate as, if different from JWT
xMarketId string Unique identifier of the Market in which the request is happening
body CartUpdateBulk The modifications to make to the target Shopper's Cart
Source:

validate(xShopperId, xMarketId, xPrivateLabelId)

Performs product specific validation on the item metadata in the target Shopper's Cart
Parameters:
Name Type Description
xShopperId string Shopper ID whose Cart should be retrieved, if it differs from authenticated
xMarketId string Unique identifier of the Market in which the request is happening
xPrivateLabelId integer PrivateLabelId to operate as, if different from JWT
Source: