MDVA-43605: Order data returns negative values for row totals when using Rest API

The MDVA-43605 patch fixes the issue where the order data returns negative values for row totals when using Rest API. This patch is available when the Quality Patches Tool (QPT) 1.1.14 is installed. The patch ID is MDVA-43605. 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

Compatible with Adobe Commerce versions:

  • Adobe Commerce (all deployment methods) 2.3.1 - 2.4.4
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 order data returns negative values for row totals when using Rest API.

Steps to reproduce:

  1. Enable free shipping.

  2. Navigate to Configuration > Catalog > Price > and set Catalog Price Scope = Website.

  3. Navigate to Configuration > Sales > Tax and update:

    • Tax Class For Shipping = Taxable Goods

    • Calculation Settings:

      • Catalog Price = Including Tax
      • Shipping Price = Including Price
      • Applying Discount On Prices = Including Tax
    • Price Display Settings: Including Tax (all fields)

    • Shopping Cart Display Settings: Including Tax (all fields)

    • Orders, Invoices, Credit Memos:

      • Display shipping Amount = Including Tax
  4. Create a tax rate for US (State = ‘*’), Rate Percent = 24.00

  5. Create a Tax Rule with the Tax Rate above.

  6. Create a cart price rule with a specific coupon, and Discount = $50 of the Fixed amount for the whole cart.

  7. Create four products with the following prices: $8.90, $5.90, $6.90, and $5.95.

  8. Create an admin order including four of these products using the coupon code created in the previous step. Use the free shipping.

  9. Payment should not be required as the coupon code covers the cart total.

  10. Retrieve the order that was just created via Rest API endpoint:

    code language-json
    GET rest/V1/orders/1
    

Expected results:

The values of base_row_total and base_row_total_incl_tax in the response are zero.

Actual results:

The base_row_total and base_row_total_incl_tax fields in the response have negative values.

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 Patches available in QPT in our developer documentation.

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