Calculating Totals

Lesson 19 of 26 · 15 min

Order Totals

Order subtotal and total calculate automatically. Edits to the following properties trigger a recalculation:

  • Products
  • Shipping cost, excluding tax
  • Shipping cost, including tax
  • Handling cost, excluding tax
  • Handling cost, including tax
  • Wrapping cost, excluding tax
  • Wrapping cost, including tax
  • Billing address
  • Shipping address

You can override calculated values such as product prices, subtotals, and totals by sending a fixed value in the request. If you do not supply values for these properties, they will be automatically calculated based on the preset store values and tax rules.

If it is necessary to override the subtotal or total, the system will not recalculate both so you must override both values.

To add a manual discount, overwrite the product price or discount_amount.