Skip to main content
Skip to main content

listAndCountFulfillments - Fulfillment Module Reference

This documentation provides a reference to the listAndCountFulfillments method. This belongs to the Fulfillment Module.

This method retrieves a paginated list of fulfillments along with the total count of available fulfillments satisfying the provided filters.

Example

To retrieve a list of fulfillments using their IDs:

const [fulfillments, count] =
await fulfillmentModuleService.listAndCountFulfillments(
{
id: ["ful_123", "ful_321"],
},
{
relations: ["shipping_option"],
take: 20,
skip: 2,
}
)

To specify relations that should be retrieved within the fulfillment:

const [fulfillments, count] =
await fulfillmentModuleService.listAndCountFulfillments(
{
id: ["ful_123", "ful_321"],
},
{
relations: ["shipping_option"],
}
)

By default, only the first 15 records are retrieved. You can control pagination by specifying the skip and take properties of the config parameter:

const [fulfillments, count] =
await fulfillmentModuleService.listAndCountFulfillments({
id: ["ful_123", "ful_321"],
})

Parameters

The filters to apply on the retrieved fulfillment sets.
The configurations determining how the fulfillment is retrieved. Its properties, such as select or relations, accept the attributes or relations associated with a fulfillment.
sharedContextContext
A context used to share resources, such as transaction manager, between the application and the module.

Returns

PromisePromise<[FulfillmentDTO[], number]>Required
The list of fulfillments along with their total count.
Was this section helpful?