How to update product images by REST Web API Magento 2?

You can upload product images by REST API Magento with the PUT action and the help of /V1/products/<sku>.

Action: PUT

URL: <BASE_URL>/rest/V1/products/<SKU>
(Example URL: https://magento.test/rest/V1/products/my-sku)

Header: Authorization: Bearer <ADMIN TOKEN> Continue reading “How to update product images by REST Web API Magento 2?”

Get All Sales/Cart rules associated with product by REST API Magento 2.

You can retrieve all the Sales rules that are related to the given product by Cart Price Rule Search REST API in Magneto.

Let’s say product SKU “A10001” is associated with two different cart price rules and you want to fetch a list of all the sales rules that are associated with the given SKU.

Magento native supports Cart Rule Search Rest API which will be helpful to fetch products associated with cart rules. Continue reading “Get All Sales/Cart rules associated with product by REST API 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).