Skip to main content
Skip to main content

listAndCountServiceZones - Fulfillment Module Reference

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

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

Example

To retrieve a list of service zones using their IDs:

const [serviceZones, count] =
await fulfillmentModuleService.listAndCountServiceZones({
id: ["serzo_123", "serzo_321"],
})

To specify relations that should be retrieved within the service zone:

const [serviceZones, count] =
await fulfillmentModuleService.listAndCountServiceZones(
{
id: ["serzo_123", "serzo_321"],
},
{
relations: ["shipping_options"],
}
)

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 [serviceZones, count] =
await fulfillmentModuleService.listAndCountServiceZones(
{
id: ["serzo_123", "serzo_321"],
},
{
relations: ["shipping_options"],
take: 20,
skip: 2,
}
)

Parameters

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

Returns

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