How to update customer state disabled to enabled via API?

eCommExplorer
New Member
6 0 0

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 2 (2)
L_J_K
Shopify Staff
358 53 65

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!

| API Support @ Shopify |
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution!
eCommExplorer
New Member
6 0 0

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?