How to delete customer group id by REST Web API Magento 2?

Customer is assigned to customer group id in Magento. By default when you create a customer, it has assigned to Default (General) Customer group id.

If you want to delete a customer group id without going to the admin panel, you need to help of REST web API to delete it.

Magento REST Web API provides the Out of the box feature to delete customer group id by its Id.

You have to pass Header as Admin Token to delete customer group id in Magento.

INTERESTING FACTS:
You can’t delete customer group id with 0 (NOT LOGGED IN) and 1 (DEFAULT(GENERAL)).

EndPoint URL: <HOST_URL>/rest/V1/customerGroups/:id
(http://127.0.0.1/magento243/rest//V1/customerGroups/5 Where 5 is the customer group id to delete.)

Action: DELETE

Header: Authorization Bearer <Admin_TOKEN>

Payload Body: None

Response: True/False.

Once you delete the customer group id, the customer has been assigned automatically to the Default(General).

How to delete customer addresses by REST Web API Magento 2?

Customer Addresses is an integral part for any eCommerce store to deliver customer’s order item.

Sometimes you need to delete a given customer address from the customer account using the WebAPI.

Magento REST Web API provides the Out of the box feature to delete customer addresses by their Id. Continue reading “How to delete customer addresses by REST Web API Magento 2?”

How to delete customer by REST Web API Magento 2?

Customer Delete using REST Web API in Magento 2 comes with URL endpoint  V1/customers/:customerId and DELETE Action.

You need to replace  :customerId in the URL with the actual customer id. Continue reading “How to delete customer by REST Web API Magento 2?”