How to get customer id from API header bearer token Magento 2?

You can fetch the customer ID from the Web API Header Authorization Token in Magento 2.

At the development time of a custom module, you are required to fetch the customer ID from the Bearer token passed in the Header.

You can just follow the given code snippet to fetch the customer ID from the current payload. Continue reading “How to get customer id from API header bearer token Magento 2?”

Magento 2 Update Product Stock Inventory by Rest API.

You can Update Product Stock related information by REST API with the use of endpoint URL /V1/products/:productSku/stockItems/:itemId.

You can manage Stock Inventory related data with REST API with the given payload as below.

Action: PUT

Header: Authorization: Bearer <ADMIN_TOKEN> Continue reading “Magento 2 Update Product Stock Inventory by Rest API.”

How to get Product Stock Item by REST API V1/stockItems/:SKU Magento 2?

You can fetch product stock-related data like Qty, status, manage stock by REST API V1/stockItems/:SKU

URL: <BASE_URL>/rest/V1/stockItems/:SKU (https://magento246.test/rest/V1/stockItems/MySku)

Header: Authorization:Bearer <ADMIN_TOKEN> Continue reading “How to get Product Stock Item by REST API V1/stockItems/:SKU Magento 2?”