422 Unprocessable Entity when trying to delete a customer

Topic summary

Attempting to delete a customer via Shopify Admin REST API (DELETE {{STOREURL}}/admin/api/2022-10/customers/{id}.json) returns HTTP 422 Unprocessable Entity with no detailed error.

Context: The customer has orders that are closed and over a year old.

Key finding: Per the API reference, a customer cannot be deleted if they have any existing orders. “Closed” orders still count as existing, regardless of age.

Implication: The 422 response indicates the deletion is blocked due to the presence of orders, not an endpoint or version issue.

Resolution status: The cause is identified; no workaround or alternative (e.g., deleting orders) is provided in the thread. No additional method to retrieve more detailed error information is discussed.

Summarized with AI on January 31. AI used: gpt-5.

Hey,
I’m calling DELETE {{STOREURL}}/admin/api/2022-10/customers/XXXXXX.json
and getting a 422 Unprocessable Entity response with no details as to why.
The customer does have orders but they are closed and have been for over a year.
Is there any way to get information on why this is happening?

The API reference states “A customer can’t be deleted if they have existing orders.”

1 Like