Can we update password for a User or Customer that already exists in Shopify using the Shopify API?
Can we update password for a User or Customer that already exists in Shopify using the Shopify API?
PUT /admin/customers/#{id}.json
{
"customer": {
"id": 207119551,
"password": "newpass",
"password_confirmation": "newpass",
"send_email_welcome": false
}
}
If You want to update password of your store's customer using shopify Api then yes it is possible. Here is Sample Code:-
$password = array(
"customer"=>array(
'id'=>$customerid,
'password'=> $new_password,
'password_confirmation'=>$confirm_password
)
);
$customer = $shopify("PUT /admin/customers/$customerid.json" , $password);
You can update shopify store's customer password this way. But if you are talking about user then this API us only available for shopify plus store.check this link:- https://help.shopify.com/api/reference/plus/user
Thanks
If you want to update the password of your user using the shopify API please try to use the below code:-
$updatePassword = array(
"customer"=>array(
'id'=>$userId,
'password'=> $updatedPassword,
'password_confirmation'=>$confirm_updatedPassword,
'send_reset_password_email': true
)
);
$updateCustomer = $shopify("PUT /admin/customers/$userId.json" , $updatePassword);