FROM CACHE - en_header

How to update customer state disabled to enabled via API?

eCommExplorer
Tourist
6 0 1

I tried to change the customer state by calling the customer API, with PUT method. It is not working. Seems like getting the customer enabled is possible only by sending account activiation URL. How do i achieve this without  initiating accountactivation URL?

 

Replies 3 (3)
L_J_K
Shopify Staff
Shopify Staff
402 64 84

Hey @eCommExplorer 

Yes, customer state is a read only value in REST(docs) but you should be able to get there by trying this, a HTTP Post to customers.json

 

{
	"customer": {
		"first_name": "Steve",
		"last_name": "Lastnsameson",
		"email": "coolemail@email.com",
		"phone": "+15149146011",
		"verified_email": true,
		"addresses": [
			{
				"address1": "123 Oak St",
				"city": "Ottawa",
				"province": "ON",
				"phone": "555-1212",
				"zip": "123 ABC",
				"last_name": "Lastnameson",
				"first_name": "Mother",
				"country": "CA"
			}
		],
		"password": "newpass",
		"password_confirmation": "newpass",
		"send_email_welcome": false
	}
}

 

This workaround will return a customer with an enabled state. Hope that helps!

| Shopify |
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution!
eCommExplorer
Tourist
6 0 1

Hi, This is to create new user, I want to change existing customer state from "disabled" to "enabled" without sending an activation URL.

If this is not possible, is it possible to send a mobile app deep link as account activation URL? how do I initiate different deep link for andriod and IOS?

yash_agarwal
Shopify Partner
3 0 0

Hi, Did anyone find any solution to this? Possible to do this programatically?