For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
Dev Portal
DocsAPI ReferenceLearnCommunityChangelog
DocsAPI ReferenceLearnCommunityChangelog
    • Overview
  • Learning Plans
    • Developer Foundations
    • Composable Developer
    • Stencil Developer
    • B2B Developer
  • Courses
        • Order Transactions API
        • Order Refunds
        • Calculating Totals
      • Conclusion
    • Learning Changelog
Dev Portal
LogoLogo
On this page
  • Order Totals
CoursesCheckout and Orders APIModule 6: Order Transactions API

Calculating Totals

Was this page helpful?
Previous

Order Refunds

Next

Orders - Hands-on Lab

Built with
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.