Skip to main content
Skip to main content

retrieve - Cart Module Reference

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

This method retrieves a cart by its ID.

Example

A simple example that retrieves a cart by its ID:

const cart = await cartModuleService.retrieve("cart_123")

To specify relations that should be retrieved:

const cart = await cartModuleService.retrieve("cart_123", {
relations: ["shipping_address"],
})

Parameters

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

Returns

PromisePromise<CartDTO>Required
The retrieved cart.
Was this section helpful?