Broadleaf Microservices
  • v1.0.0-latest-prod

Quote Operations

Retrieve Quotes

Operation

QuoteClient#retrieveRequestedQuotes(cq, options);

Parameters

Parameter Type Required? Description

cq

string

RSQL filter params

options

QuoteClientCallOptions

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

Response

This function returns a list of Carts.

Example

Example of retrieving quotes
const quotes = await quoteClient.retrieveQuotes(
    <CQ_FILTER_STRING>,
    { accessToken }
);

console.log(quotes);

Change Quote Status

Operation

QuoteClient#changeQuoteStatus(request, options);

Parameters

Parameter Type Required? Description

request

QuoteProcessRequest

The request to update the status of a quote

options

CartClientCallOptions

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

Response

This function returns a Cart.

Example of changing the quote status

const cart = await quoteClient.changeQuoteStatus(
      {
        cartId: <CART_ID>,
        targetQuoteStatus: <TARGET_STATUS>,
      },
      {
        accessToken,
        version: <CART_VERSION>,
      }
);

console.log(cart);

Delete Quote

Operation

QuoteClient#deleteQuote(quoteId, options);

Parameters

Parameter Type Required? Description

request

string

The id of the quote to delete

options

CartClientCallOptions

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

Response

This function returns void.

Example of deleting a quote

await quoteClient.deleteQuote(
      <QUOTE_ID>,
      { accessToken }
);

Create Note

Operation

QuoteClient#createNote(cartNote, options);

Parameters

Parameter Type Required? Description

cartNote

CartNoteCreateRequest

The request to create the CartNote

options

ClientCallOptions

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

Response

This function returns the persisted CartNote.

Example of creating a cart note

const cartNote =  await quoteClient.createNote(
    {
      "cartId": <CART_ID>;
      "note": <NOTE_CONTENT>;
    },
    { accessToken }
);

console.log(cartNote);

Create Note for Item

Operation

QuoteClient#createNoteForItem(cartItemId, cartItemNote, options);

Parameters

Parameter Type Required? Description

cartItemId

string

The ID of the cart item to add the CartNote to.

cartItemNote

CartNoteCreateRequest

The request to create the CartNote

options

ClientCallOptions

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

Response

This function returns the persisted CartNote.

Example of creating a cart item note

const cartItemNote =  await quoteClient.createNoteForItem(
    <CART_ITEM_ID>,
    {
      "cartId": <CART_ID>;
      "note": <NOTE_CONTENT>;
    },
    { accessToken }
);

console.log(cartNote);

Read all Notes for Cart

Operation

QuoteClient#readAllNotesForCart(cartItemId, cartItemNote, cq, options);

Parameters

Parameter Type Required? Description

cartId

string

The ID of the cart whose notes to retrieve

cartLevelOnly

boolean

Whether to only fetch the cart’s notes or also the items'. Defaults to false.

options

NumberedPageableClientCallOptions

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

Response

This function returns a page of CartNotes.

Example of reading all cart notes

const Page<CartNote> cartNotes =  await quoteClient.readAllNotesForCart(
    <CART_ID>,
    <CART_LEVEL_ONLY>,
    undefined,
    { accessToken }
);

console.log(cartNotes);

Read all Notes for Cart Item

Operation

QuoteClient#readAllNotesForCartItem(cartItemId, cartItemId, cq, options);

Parameters

Parameter Type Required? Description

cartId

string

The ID of the cart whose notes to retrieve

cartItemId

string

The ID of the cart item whose notes to retrieve

cq

string

RSQL filter params

options

NumberedPageableClientCallOptions

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

Response

This function returns a page of CartNotes.

Example of reading all cart item notes

const Page<CartNote> cartItemNotes =  await quoteClient.readAllNotesForCart(
    <CART_ID>,
    <CART_ITEM_ID>,
    <CQ_FILTER_STRING>,
    { accessToken }
);

console.log(cartItemNotes);

Update Note

Operation

QuoteClient#updateNote(cartNote, options);

Parameters

Parameter Type Required? Description

cartNote

CartNote.

The cart note to update

options

ClientCallOptions

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

Response

This function returns the updated CartNote.

Example of updating the cart note

const CartNote cartNote =  await quoteClient.updateNote(
    {
      "cartId": <CART_ID>;
      "note": <NOTE_CONTENT>;
    },
    { accessToken }
);

console.log(cartNote);

Delete Note

Operation

QuoteClient#deleteNote(cartNote, options);

Parameters

Parameter Type Required? Description

cartNote

CartNote.

The cart note to delete

options

ClientCallOptions

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

Response

This function returns void.

Example of deleting the cart note

await quoteClient.deleteNote(
    <CART_NOTE>,
    { accessToken }
);

Read Quote Properties

Operation

QuoteClient#readQuoteProperties(options);

Parameters

Parameter Type Required? Description

options

NumberedPageableClientCallOptions

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

Response

This function returns the QuoteProperties containing the quote configuration.

Example of reading all cart notes

const QuoteProperties quoteProperties =  await quoteClient.readQuoteProperties(
    { accessToken }
);

console.log(quoteProperties);