Broadleaf Microservices
  • v1.0.0-latest-prod

Advanced Cart Operations

The following are operations used to transfer and reprice an existing cart.

Transfer a cart to a customer

Operation

CartClient#transferCart(cartId, options);

Parameters

Parameter Type Required? Description

cartId

string

✅

The id of the cart to transfer.

options

CartClientCallOptions

❌

Options passed to the HTTP request call to customize the request configuration.

Response

This function returns a Cart.

Example

Example of transfering a cart to an authenticated customer
const cart = await cartClient.transferCart('CART_ID', { accessToken });

console.log(cart);

Price a cart

Operation

CartClient#priceCart(cartId, options);

Parameters

Parameter Type Required? Description

cartId

string

✅

The id of the cart to price

options

CartClientCallOptions

❌

Options passed to the HTTP request call to customize the request configuration.

Response

This function returns a Cart.

Example

Example of pricing a cart
const cart = await cartClient.priceCart('CART_ID', { accessToken });

console.log(cart);