How we can disable a customer via REST API?

ntiwari1309
Visitor
3 0 4

We are using Celigo integrator app (third-party app) which connects our ERP platform of NetSuite with Shopify.

Celigo is trying to build the API for disabling a customer - the flow is if anyone disables a customer in NetSuite (which is the source of truth for us for customer records) then Celigo's API call will mark the customer as "disabled" in Shopify.

We did see that there is a parameter called "state" on the customer records in Shopify.

We did a test in our shopify's sandbox store and did a before and after comparison for the json of the customer record.

state was "enabled" before disabling the customer and it got updated to "disabled" after we disabled the customer record manually in Shopify.

But the question is more in regards to the API. If there is a way to update the customer's "state" parameter from "enabled" to "disabled" via an API. We did refer the below two articles-

Article 1- https://help.shopify.com/en/api/graphql-admin-api/reference/enum/customerstate

In this article, we see under Enum there is a customerState (on the left panel) But we don't have like a sample way to call it through the API.

Article 2- https://help.shopify.com/en/api/reference/customers/customer

If you see in this article, it actually says "Read-only" for the "state" parameter. But this is for customer's REST API. The question is can we perhaps call the customerState from article 1, instead of calling the "state" from article 2?

 

shopify_state_screenshot.JPG

 

Replies 4 (4)

Visely-Team
Shopify Partner
1843 210 488

The option to disable/enable a customer account is limited to the store's staff and admin. Unfortunately, there is no API to manage the state available to date.

Sergiu Svinarciuc | CTO @ visely.io
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution!
- To learn more about the awesome stuff we do head over to visely.io or our blog
Reynaldo_Zabala
Excursionist
11 0 9

This seems to be a MAJOR, MAJOR flaw in the API. I cannot think of a good reason not to support the ability to mutate the state of  customer state. I'm sure I'm not alone in wanting to disable customer accounts for things like fraudulent actions or potentially fraudulent data situations. Let's say customer A placed an order that was caught by fraud check. That same user can still transact. The minute our software knows there is a shady set of circumstances going, we want to automatically change the state of their account to be "disabled" 

 

Thoughts?

GeorgeHoffman
Shopify Partner
19 0 3

do you expect that shopify actually thought out their apis? psha

GeorgeHoffman
Shopify Partner
19 0 3

I second that this is (one of many) api flaws. makes it quite impossible to migrate users from one store to another. Shopify is not good at the enterprise level. Otherwise they would have this type of capability. Also they have things like mutipass id for shopify plus users but of course none of their apis support the multipass id.