Skip to main content
Skip to main content

listAndCountShippingOptions - Fulfillment Module Reference

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

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

Example

To retrieve a list of shipping options using their IDs:

const [shippingOptions, count] =
await fulfillmentModuleService.listAndCountShippingOptions({
id: ["so_123", "so_321"],
})

To specify relations that should be retrieved within the shipping option:

const [shippingOptions, count] =
await fulfillmentModuleService.listAndCountShippingOptions(
{
id: ["so_123", "so_321"],
},
{
relations: ["fulfillments"],
}
)

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 [shippingOptions, count] =
await fulfillmentModuleService.listAndCountShippingOptions(
{
id: ["so_123", "so_321"],
},
{
relations: ["fulfillments"],
take: 20,
skip: 2,
}
)

Parameters

filtersOmit<FilterableShippingOptionProps, "context">
Construct a type with the properties of T except for those in type K.
The configurations determining how the shipping option is retrieved. Its properties, such as select or relations, accept the attributes or relations associated with a shipping option.
sharedContextContext
A context used to share resources, such as transaction manager, between the application and the module.

Returns

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