Customer address management for delivery locations
Overview
The Customer Addresses API provides comprehensive address management functionality for customers, including creating, updating, deleting, and managing delivery addresses. This system supports multiple addresses per customer with default address selection and geographic information.Location:convex/customers/addresses.ts
Create Address
Create a new delivery address for a customer.
Id<'customers'>
required
The ID of the customer to create the address for
string
required
A descriptive name for the address (e.g., “Home”, “Office”)
string
required
The complete address string
Id<'cities'>
required
The ID of the city for this address
Id<'areas'>
required
The ID of the area within the city
string
Flat or villa number
string
Building name or number
string
Nearby landmark for easier location
string
GPS latitude coordinate
string
GPS longitude coordinate
boolean
Whether this should be the default address for the customer
// Get addresses for authenticated userconst addresses = await convex.query("customers.addresses.getCustomerAddresses", {});// Get addresses for specific customerconst specificAddresses = await convex.query("customers.addresses.getCustomerAddresses", { customerId: "k123456789"});