Skip to main content
Skip to main content

listAndCountShippingOptionRules - Fulfillment Module Reference

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

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

Example

To retrieve a list of shipping option rules using their IDs:

const [shippingOptionRules, count] =
await fulfillmentModuleService.listAndCountShippingOptionRules(
{
id: ["sorul_123", "sorul_321"],
}
)

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

const [shippingOptionRules, count] =
await fulfillmentModuleService.listAndCountShippingOptionRules(
{
id: ["sorul_123", "sorul_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 [shippingOptionRules, count] =
await fulfillmentModuleService.listAndCountShippingOptionRules(
{
id: ["sorul_123", "sorul_321"],
},
{
relations: ["shipping_option"],
take: 20,
skip: 2,
}
)

Parameters

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

Returns

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