And now another order that doesn't add up came through. This time it appears to be a rounding error.
Order.total_discounts is 135.99 but there are two discounts application of 68.00.
(2 x 68 = 136) != 135.99
This is not great and I'd appreciate if you could look into this one as well.
Order id is 527794110523.
We've only deployed this change for a few minutes ago so I'm assuming more of these might come through.
I will not report them anymore if they look like similar to those two cases...
The first order was created with bad data using Orders API. total_discounts was sent alongside discount_codes.amount with different values. At the time, we did not do any validation / recalculation if the two values were not synced. In other words, the client could send anything and it would just be persisted as is. We changed that on April 9th, discount_codes.amount now has precendence and total_discounts is calculated from ther former so this won't happen with orders created after that date.
As for the second issue, we are working on a fix for all orders. I will keep you posted.