Skip to main content

customerAddressDelete

Overview

Remove an address from the customer's address book using its _id. Typically requires an authenticated customer token.

Mutation

mutation DeleteCustomerAddressesById($addressId: ID!) {
deleteCustomerAddressesById(addressId: $addressId) {
success
message
}
}

Variables

{
"addressId": "<ADDRESS_ID>"
}

Examples

curl -X POST \
https://subdomain.com\
-H "Content-Type": "application/json" \
-H "Authorization: Bearer <TOKEN>" \
--data-binary @- << 'EOF'
{
"query": "mutation DeleteCustomerAddressesById($addressId: ID!) { deleteCustomerAddressesById(addressId: $addressId) { success message } }",
"variables": { "addressId": "<ADDRESS_ID>" }
}
EOF

Notes

  • Attempting to delete an address not owned by the customer should return an error; handle success/message gracefully.
  • Use this together with createCustomerAddresses and findCustomerAddressByAccount for full CRUD flows.