- Get Started
- Product
- Resources
- Tools & SDKs
- Framework
- Reference
- Get Started
- Product
- Resources
- Tools & SDKs
- Framework
- Reference
Manage Customer Addresses in Storefront
In this document, you'll learn how to manage a customer's addresses in a storefront.
List Customer Addresses#
To retrieve the list of customer addresses, send a request to the List Customer Addresses API route:
The List Customer Addresses API route accepts pagination parameters to paginate the address.
It returns in the response the addresses
field, which is an array of addresses.
Add Customer Address#
To add a new address for the customer, send a request to the Add Customer Address API route:
The Add Address API route returns in the response a customer
field, which is a customer object.
Edit an Address#
To edit an address, send a request to the Update Customer Address API route:
The Update Address API route returns in the response a customer
field, which is a customer object.
Delete Customer Address#
To delete a customer's address, send a request to the Delete Customer Address API route:
1fetch(2 `http://localhost:9000/store/customers/me/addresses/${3 addrId4 }`,5 {6 credentials: "include",7 headers: {8 "x-publishable-api-key": process.env.NEXT_PUBLIC_MEDUSA_PUBLISHABLE_KEY || "temp",9 },10 method: "DELETE",11 }12)13.then((res) => res.json())14.then(({ parent: customer }) => {15 // use customer...16 console.log(customer)17})
The Delete Customer Address API route returns a parent
field in the response, which is a customer object.