Out now! Check out the Poll results: Do you have a Shopify store?
Our Partner & Developer boards on the community are moving to a brand new home: the .dev community forums! While you can still access past discussions here, for all your future app and storefront building questions, head over to the new forums.

DeleteCustomer account using Graphql api

DeleteCustomer account using Graphql api

Kart1
Visitor
2 0 0

I want to implement a button on click it user will delete the user , for that we need graphql api , I got this documentation but it is not working on postman , https://shopify.dev/api/admin-graphql/2022-10/mutations/customerDelete But it is not working it is saying customerDelete mutation does not exist , we use custom storefront api.

Reply 1 (1)

davebeauchemin
Shopify Partner
5 0 2

You can't delete a customer with the Storefront API. You need to use the GraphQL Admin API. You should hit this url https://{shop}.myshopify.com/admin/api/2021-07/graphql.json and write the query inside the body section (you can choose GraphQL for the type of data in Postman). And remember that GraphQL Admin API use different accessToken than the Storefront API.

 

Also you should install the GraphiQL App in your Shopify Store to test your mutation: https://shopify.dev/apps/tools/graphiql-admin-api