Skip to main content
Skip to main content

retrieveLineItem - Cart Module Reference

This documentation provides a reference to the retrieveLineItem method. This belongs to the Cart Module.

This method retrieves a line item by its ID.

Example

A simple example that retrieves a line item by its ID:

const lineItem =
await cartModuleService.retrieveLineItem("cali_123")

To specify relations that should be retrieved:

const lineItem = await cartModuleService.retrieveLineItem(
"cali_123",
{
relations: ["cart"],
}
)

Parameters

itemIdstringRequired
The item's ID.
The configurations determining how the line item is retrieved. Its properties, such as select or relations, accept the attributes or relations associated with a line item.
sharedContextContext
A context used to share resources, such as transaction manager, between the application and the module.

Returns

PromisePromise<CartLineItemDTO>Required
The retrieved line item.
Was this section helpful?