Rounding is done at each calculation and each line item. The rounded line-item totals are used to calculate order totals. Rounding is the standard to the nearest two decimals where;
#.005 — #.009 rounds up to #.01
#.004 and below round down to #.00.
Taxes are calculated per line after the quantity and tax are summed. The sum of the tax per line is used for the order tax subtotal.
Promotions & Discounts
There are lots of discount features possible in your store but they are applied in one of two ways in an order:
Product Group Discounts - are applied per line after the quantity is summed but before tax is calculated. In this example the discounts are applied at the line level.
The Discount Amount (the API field is order.item.coupon_discount) is the amount discounted off the line subtotal. This Discount Amount is calculated on the row subtotal (which is price multiplied by quantity) using the promotion rules.
Subtotal Discounts - are based on the whole order so they are applied as separate line items in the order. The number of discount lines will be based on the number of tax bands represented on the order so that the tax affect will be proportionally allocated to the correct tax bands. In this example the discount column isn't used and instead the Subtotal Discount is applied as one line item for the 10% tax band.
It's also possible to have a combination of discounts which may apply discounts at the line and the order level where applicable.
Item Price for ERP Integrations
The item price on an order should be correctly mapped to the ERP using one of the following two methods. The method to choose is determined by the ERP which may or may not support a line discount field.
If the ERP supports a Line Discount Field then set the ERP item price using order.items.item_price AND set the ERP line discount amount as the order.items.coupon_discount value.
If the ERP does not support a Line Discount Field then set the ERP item price as the result of order.items.subtotal divided by the order.items.quantity. This will include the line item discount amount in the item price.
Summary subtotals and the order total are based on the sum of all line item calculations. The tax paid, for example, is a total of the tax values of each line item. We do not calculate tax at the order summary level.
🎓 Learn more about all the ways you can discount products in our Rewards and Discounts articles!