Skip to main content
Skip to main content

listAddresses - Customer Module Reference

This documentation provides a reference to the listAddresses method. This belongs to the Customer Module.

This method retrieves a paginated list of addresses based on optional filters and configuration.

Example

To retrieve a list of addresses using their IDs:

const addresses = await customerModuleService.listAddresses({
id: ["cuaddr_123", "cuaddr_321"],
})

To specify relations that should be retrieved within the addresses:

const addresses = await customerModuleService.listAddresses(
{
id: ["cuaddr_123", "cuaddr_321"],
},
{
relations: ["customer"],
}
)

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 addresses = await customerModuleService.listAddresses(
{
id: ["cuaddr_123", "cuaddr_321"],
},
{
relations: ["customer"],
take: 20,
skip: 2,
}
)

Parameters

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

Returns

PromisePromise<CustomerAddressDTO[]>Required
The list of addresses.
Was this section helpful?