Skip to main content
Skip to main content

listShippingOptionsForContext - Fulfillment Module Reference

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

This method retrieves a paginated list of shipping options based on the provided context.

Example

To retrieve a list of shipping options matching a context:

const shippingOptions =
await fulfillmentModuleService.listShippingOptionsForContext(
{
fulfillment_set_id: ["fuset_123"],
address: {
country_code: "us",
},
}
)

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

const shippingOptions =
await fulfillmentModuleService.listShippingOptionsForContext(
{
fulfillment_set_id: ["fuset_123"],
address: {
country_code: "us",
},
},
{
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 =
await fulfillmentModuleService.listShippingOptionsForContext(
{
fulfillment_set_id: ["fuset_123"],
address: {
country_code: "us",
},
},
{
relations: ["fulfillments"],
take: 20,
skip: 2,
}
)

Parameters

The context of the how the shipping option is being used. It acts as a filter for the retrieved shipping options.
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[]>Required
The list of shipping options.
Was this section helpful?