MDVA-39993: Inventory changes done through API are not reflected on storefront

The MDVA-39993 patch solves the issue where the inventory changes done through API are not reflected on the storefront. This patch is available when the Quality Patches Tool (QPT) 1.1.12 is installed. The patch ID is MDVA-39993. Please note that the issue is scheduled to be fixed in Adobe Commerce 2.4.5.

Affected products and versions

The patch is created for Adobe Commerce version:

  • Adobe Commerce (all deployment methods) 2.4.2-p1

Compatible with Adobe Commerce versions:

  • Adobe Commerce (all deployment methods) 2.3.5 - 2.3.7-p2, and 2.4.0 - 2.4.3-p1
NOTE
The patch might become applicable to other versions with new Quality Patches Tool releases. To check if the patch is compatible with your Adobe Commerce version, update the magento/quality-patches package to the latest version and check the compatibility on the Quality Patches Tool: Search for patches page. Use the patch ID as a search keyword to locate the patch.

Issue

The inventory changes done through API are not reflected on the storefront product page.

Prerequisites:

Inventory modules installed.

Steps to reproduce:

  1. Make sure the queue is set to execute with cron and cron is installed and running.

  2. Create a configurable product (COC001), with two colors (Black and Red), and two sizes (M and L).

  3. Make one option out of stock (COC001-Red-M).

  4. Load the configurable product page on the storefront and try clicking on each color. When you click Red, the size M should be crossed out because it is out of stock.

  5. Make COC001-Red-M in stock using the following API endpoint and the payload:

    code language-json
    POST http://{domain}/rest/V1/inventory/source-items
    
    {
      "sourceItems": [
        {
          "sku": "COC001-Red-M",
          "source_code": "default",
          "quantity": 1000,
          "status": 1
        }
      ]
    }
    
  6. Check this simple product from the backend and verify that it is updated to In Stock.

  7. Load the configurable product from the frontend and click on each color. Notice the size M when you click on Red.

Expected results:

COC001-Red-M option is not crossed out because we have updated it to In Stock through API.

Actual results:

COC001-Red-M option is still crossed out, even though it is In Stock.

Apply the patch

To apply individual patches, use the following links depending on your deployment method:

To learn more about Quality Patches Tool, refer to:

For info about other patches available in QPT, refer to Quality Patches Tool: Search for patches in the Quality Patches Tool guide.

recommendation-more-help
c2d96e17-5179-455c-ad3a-e1697bb4e8c3