Dear all ,
It can be deleted using following API. It worked for me.
https://shopify.dev/docs/admin-api/rest/reference/customers/customer?api[version]=2020-04#destroy-2020-04
Procedure as follows.
Goto your Shopify store Admin.
There is a “Apps” option at left side(https://famzon-development.myshopify.com/admin/apps )
Click on “Apps” and it will open the respective things at right side.
In right side find “Manage private apps” Hyper link.
On click of that, will open “Private apps” screen in which you can find “Create new private app” button.
Now click on “Create new private app” button and create the new private APP and get API key and password.
And below of “API key” and “Password” field, you can find “ADMIN API PERMISSIONS” heading.
provide “read and Write” permission for “Customers”. and save that App.
Now copy that “Example URL” provided below that Password field. And append customer account delete API as follows.( In API_KEY and PASSWORD, replace with your private app’s credentials)
[https://{API_KEY}:{PASSWORD}@famzon-development.myshopify.com//admin/api/2020-04/customers/{customer_id}.json](http://var%20target=“https://b19009c5c728de2c94b711895eaf847b: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@famzon-dev-msc.myshopify.com/admin/api/2020-04/customers/{{customer.id}}.json” Shopify.postLink(target, { parameters: { _method: ‘DELETE’ } })
Now using this API, make your AJAX call as follows to Delete customer account.
var target="https://API_KEY:PASSWORD@famzon-dev-msc.myshopify.com/admin/api/2020-04/customers/{{customer.id}}.json"
Shopify.postLink(target, {
parameters: { _method: 'DELETE' }
});
{{customer.id}} is mandatory. Because, the information you are deleting based on each user(Customer). So inputting customer ID is mandatory.
This call will delete your customer info.
Regards,
Pon.