How to bulk delete customer addresses

Brian_Kidd
Excursionist
35 0 8

Per the documentation, multiple addresses can be deleted using a PUT and providing the address ids:  https://shopify.dev/docs/admin-api/rest/reference/customers/customer-address#destroy-2020-07

I'm using this: https://<my-subdomain>/admin/api/2020-07/customers/<customer-id>/addresses/set.json?address_ids[]=<a...

but only the first address is deleted.  Is comma (,) the separator or should I be doing something else?  I am receiving a 200 response.  Thanks.

Replies 2 (2)
Jonas_Detlefsen
Shopify Partner
8 0 0

I am running into the same problem, i am trying to delete multiple addresses through this endpoint, but the documentation only provides an example with a single address id.

I tried different formats:

'/customers/{customerId}/addresses/set.json?address_ids[]=1234,2345,3456&operation=destroy'
'/customers/{customerId}/addresses/set.json?address_ids[]=[1234,2345,3456]&operation=destroy'
'/customers/{customerId}/addresses/set.json?address_ids[]=1234;2345;3456&operation=destroy'

 but neither of these worked. In each format only the first address got deleted.  I am quite sure it is just a matter of passing the ids in the correct format, but the documentation is lacking in this regard.

Would be great if someone who knows the format can enlighten me here, thanks in advance!

albinl
New Member
1 0 1

It should be like this

 

?address_ids[]=1234&address_ids[]=2345&address_ids[]=4567