We have encountered an issue with duty calculations when editing orders through the Shopify Order Editing API, specifically when using the actions to remove a duty-bearing line item and then add the same variant back. When this sequence happens, Shopify sometimes recalculates a lower customs (dutiable) value than what was used during the initial checkout. As a result, both the calculated import duty and the total cost of the order go down, despite no discounts being applied—the `currentTotalDiscountsSet` remains at zero throughout the whole process.
To give a specific example, the product in question is an apparel item (HS code 6203420736) originating from China. The total import duty rate applied is 34.1%, made up of multiple surcharges and tariffs.
To reproduce the issue: first, place an order for this product and proceed through checkout. Then, edit the order through the API by removing the line item and adding the exact same variant back, finally committing the changes. After completing these steps, compare the new import duty amount and the order total to their original values.
What we observe is that, after the above API edits, the import duty drops from $29.11 to $26.52, and the base value used for customs calculations (the “dutiable base”) falls from roughly $85.37 to $77.76. Shipping and order totals also decrease slightly, while taxes on the order actually increase. Other values like discounts and authorized total remain unchanged.
Looking closer, all relevant product attributes such as duty rate, HS code, and country of origin stay the same. The only change is this revised dutiable value, which is being calculated differently when the item is re-added via the editing API. Specifically, it appears that Shopify re-extracts duty from a duty-inclusive price, ending up with a lower base for the calculation compared to checkout. As a result, the same product can end up with a different customs value simply depending on whether it’s added via checkout or through subsequent order edits.
For completeness, we have verified that shipping costs are not included in the duty base calculation in either the checkout or the editing API scenarios. If shipping were included, we would expect the duty amount to increase, not decrease.
One final detail: in Shopify’s internal ledger, the duty for the re-added line is still recorded as the original $29.11, matching the amount at checkout. However, both the order’s current duty field and what’s shown in the Admin interface reflect the lower $26.52 amount. This mismatch between the ledger and the actual order money fields could point to a second, related inconsistency.