deleteCustomerAddress
Delete an existing customer address.
Import
import { deleteCustomerAddress } from "@evershop/evershop/customer/services";
Syntax
deleteCustomerAddress(uuid: string, context?: Record<string, unknown>): Promise<Address>
Parameters
uuid
Type: string
Address UUID to delete.
context (optional)
Type: Record<string, unknown>
Additional context for hooks.
Return Value
Returns Promise<Address> with deleted address data.
Examples
Basic Deletion
import { deleteCustomerAddress } from "@evershop/evershop/customer/services";
const deletedAddress = await deleteCustomerAddress('address-uuid');
console.log(`Deleted address: ${deletedAddress.address_1}`);
Hooks
Supports hooks via registry:
deleteCustomerAddressData- Hook deletion operation
Example hook:
import { hookBefore } from "@evershop/evershop/lib/util/hookable";
hookBefore('deleteCustomerAddressData', async (uuid, connection) => {
// Perform additional cleanup
console.log(`Deleting address: ${uuid}`);
});
See Also
- createCustomerAddress - Create address
- updateCustomerAddress - Update address
- validateAddress - Validate address