Broadleaf Microservices
  • v1.0.0-latest-prod

Order History

A common requirement for eCommerce storefronts is for a customer to be able to view their order history. The following operations allow you to retrieve the authenticated customer’s order history.

Note

To view on the customer’s order history, they must be authenticated and their access token must be provide to the function call.

List Order History

Operation

CustomerClient#listCustomerOrderHistory(options);

Parameters

Parameter Type Required? Description

options

PageableClientCallOptions

Options passed to the HTTP request call to customize the request configuration. Including paging related options.

Response

This function returns a page of OrderWithFulfillmentsAndReturns.

Example

Example of retrieving the authenticated customer’s order history
const orderHistory = await customerClient.listCustomerOrderHistory({ accessToken });

console.log(orderHistory);

Get Customer Order

Operation

CustomerClient#getCustomerOrder(orderRef, options);

Parameters

Parameter Type Required? Description

orderRef

string

Provide an order id or order number

options

ClientCallOptions

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

Response

This function returns an OrderWithFulfillmentsAndReturns.

Example

Example of retrieving an order by its id for the authenticated customer
const order = await customerClient.getCustomerOrder('ORDER_ID', { accessToken });

console.log(order);