How statefull property used with knockout JS to keep form data without losing on reload Magento 2?

Magento 2 Keep form data without losing it on reloading the page, One of the useful Magento statefull properties from the UI module is used to save the state in the local storage of the browser.

A statefull object is used to set the state of the property.

You can see statefull: {} defined under the defaults object from the vendor/magento/module-ui/view/base/web/js/lib/core/element/element.js Continue reading “How statefull property used with knockout JS to keep form data without losing on reload Magento 2?”

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?”