Skip to main content
Skip to main content

updateAddresses - Customer Module Reference

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

updateAddresses(addressId, data, sharedContext?): Promise<CustomerAddressDTO>

This method updates an address.

Example

const address = await customerModuleService.updateAddresses(
"cuaddr_123",
{
first_name: "John",
last_name: "Smith",
}
)

Parameters

addressIdstringRequired
The address's ID.
The attributes to update in the address.
sharedContextContext
A context used to share resources, such as transaction manager, between the application and the module.

Returns

PromisePromise<CustomerAddressDTO>Required
The updated address.

updateAddresses(addressIds, data, sharedContext?): Promise<CustomerAddressDTO[]>

This method updates existing addresses.

Example

const addresses = await customerModuleService.updateAddresses(
["cuaddr_123", "cuaddr_321"],
{
first_name: "John",
last_name: "Smith",
}
)

Parameters

addressIdsstring[]Required
The IDs of addresses to update.
The attributes to update in the addresses.
sharedContextContext
A context used to share resources, such as transaction manager, between the application and the module.

Returns

PromisePromise<CustomerAddressDTO[]>Required
The updated addresses.

updateAddresses(selector, data, sharedContext?): Promise<CustomerAddressDTO[]>

This method updates existing addresses matching the specified filters.

Example

const addresses = await customerModuleService.updateAddresses(
{ first_name: "John" },
{
last_name: "Smith",
}
)

Parameters

The filters that specify which address should be updated.
The attributes to update in the addresses.
sharedContextContext
A context used to share resources, such as transaction manager, between the application and the module.

Returns

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