Quantcast
Channel: Opinion: Shopify Community - Shopify APIs & SDKs
Viewing all articles
Browse latest Browse all 25503

How to change default address for Customer? by Dmitry Ezhov

$
0
0

I have a Customer that has 3 addresses (1st is default). I'd like to switch default address from 1st to 2nd. I send 
 

PUT https://{{host}}/admin/customers/{{customerId}}.json
{"customer": {"id": {{customerId}},"addresses": [
			{"id": {{addr1Id}},"default": false
			},

			{
				"id": "{{addr2Id}}","default": true
			},

			{
				"id": "{{addr3Id}}","default": false
			},
		]
	}
}

This won't helps. Then I decided to provide other fields for all addresses. It also won't work. Next attempt was trying to remove addresses completely by
 

PUT https://{{host}}/admin/customers/{{customerId}}.json
{"customer": {"id": {{customerId}},"addresses": []
	}
}

it also won't work - customer still has all his addresses.

Please, let me know is it possible (and how):
1) setup already existing address as new default one;
2) delete one of customers addresses (by addressId?);
3) store some alias for customers address (i.e. 'home', 'work', 'aunt home')  - it will allow easy switching in 'create-order-form'


Viewing all articles
Browse latest Browse all 25503

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>