MDVA-37478: Can’t create partial invoice via REST API

The MDVA-37478 patch fixes the issue when you’re unable to create a partial invoice via REST API for an order placed with payment method Payment on Account. This patch is available when the Quality Patches Tool (QPT) 1.0.23 is installed. The patch ID is MDVA-37478. Please note that the issue is scheduled to be fixed in Adobe Commerce version 2.4.3.

Affected products and versions

  • The patch was designed for Adobe Commerce on cloud infrastructure 2.3.3-p1
  • The patch is also compatible with Adobe Commerce on-premises and Adobe Commerce on cloud infrastructure 2.3.0-2.3.7
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

Prerequisite:

Adobe Commerce with installed B2B module

Steps to reproduce:

  1. Enable B2B company.

  2. Enable Payment on Account payment method.

  3. Create 2 simple products.

  4. Create a company account.

  5. Add company credits exceeding the total price of 2 products created.

  6. Login to the frontend using the company account created.

  7. Add the 2 products created to the cart, and checkout using the Payment on Account payment method.

  8. Try to create a partial invoice for the order created via REST API:

    code language-php
    POST /rest/V1/order//invoice
    {
      "items": [
        {
          "order_item_id": 2,
          "qty": 1
        }
      ]
    }
    

Expected results:

The partial invoice is created for an order made using the Payment on Account payment method, as expected.

Actual results:

The following error is returned from the REST API:

{"message":"Invoice Document Validation Error(s):\nAn invoice for partial quantities cannot be issued for this order. To continue, change the specified quantity to the full quantity."}

Apply the patch

To apply individual patches, use the following links, depending on your Adobe Commerce product:

To learn more about Quality Patches Tool, refer to:

For info about other patches available in QPT tool, refer to the Patches available in QPT tool section.

recommendation-more-help
8bd06ef0-b3d5-4137-b74e-d7b00485808a