Delete customer address in GraphQL Admin API

We are currently migrating from the REST Admin API to the GraphQL Admin API.

There seems to be some missing features regarding managing customer addresses via the GraphQL API.

As an example, how are we supposed to delete customer addresses?

REST Admin API docs for this:

We’re missing a mapping here. You can remove the addresses using the customerUpdate mutation. Not including the address will remove it.

Will made a note to add an example into the docs

So the solution to replace the request for deleting an address with a certain id is to make a request to update the customer with all of their address data, except the one being deleted?

Yes that is the current solution. Longer term, there are plans to add CRUD operations for customerAddress, but the team is focussed on higher priority items atm

1 Like

Hi all - this one has been an issue with the GraphQL Admin API for a few years now - see this post originally from April 2022:

Running the query in the way you suggested Darius would also be incredibly risky, as if not populated correctly it would clear a customers entire address list, so not really a viable option.

Perhaps some more priority could be applied to this issue given how long it has been outstanding and how destructive it could be to customer data? I know the community would appreciate anything you guys could do to resolve this given the push to move all requests over to GraphQL.

Michael, incase you havent found the workaround, the only one we can see is just reverting back to using the REST API → Customer Address - REST. So you can safely CRUD the address.

Hi Dave, thanks for the answer!

For now, we’ll be keeping the customer address management via the REST API as well. Let’s hope there’s a better way to do this before they retire that API completely.