How to Update product using REST API /V1/products/:sku in Magento 2?

In Magento 2, You can update already existing products using REST API. You need to call the updated product request URL to perform the update action.

For Update Product, you need to call the PUT method as action Type.

Action: PUT

Request URL: <YOUR_SITE_URL>/rest/V1/products/<SKU>

Replace YOUR_SITE_URwith the actual site URL and SKU with your product SKU which you want to update data.

Continue reading “How to Update product using REST API /V1/products/:sku in Magento 2?”

Create a product by REST API /V1/products programmatically in Magento 2.

Create a New product by Magento REST API, you need first to generate an access token. The access token is used to create a product in the admin panel. Check the link for Generate Access Token Magento 2

Once you got the Access Token for Magento, You can call REST API for creating a product from a third-party system.

Continue reading “Create a product by REST API /V1/products programmatically in Magento 2.”

Get Product collection Using GraphQL Magento 2.

From Magento version 2.3, one of the latest features for the storefront API called GraphQL is introduced.

Out of the Box Magento Products Query with all the possible fields by clicking on the link, Use Product Query GraphQl in Magento to display all the products-related fields.

This example is just for learning purposes. Getting all the product collections using GraphQL in Magento 2 You need to create a simple module for achieving it.

We need to create a Resolver model and add our custom logic for getting all the Product collection.

You can add a custom condition for getting specific Products in the Resolver PHP file based on your requirements. We will display all the products in the response.

Continue reading “Get Product collection Using GraphQL Magento 2.”