---
title: Calculate orders
slug: commerce-connect-15/docs/calculate-orders
docTags: 
createdAt: 2026-07-30T20:34:41.000Z
---

The following calculation services are available to calculate order totals at different levels:

- [Line item calculator](docId\:XM6e8GWezmAFx9SiNhQB2) – Calculates extended price, discounted price, line item price, and sales tax for an item.
- [Shipping calculator](docId:3soer3De8xtK6cC-9Spfu) – Calculates shipping cost, shipping taxes, and total amount for items in a shipment.
- [Tax calculator](docId\:hFOeyjvnI3iegwdiC6Jzy) – Calculates taxes based on tax value and retrieves tax values.
- [Order form calculator](docId\:GvwYa1Utahs8YuhDwMOjO) – Calculates totals, discount total, and tax total on an order form.
- [Order group calculator](docId:9Wc9zT1qjL09UAbUCcLE-) – Calculates totals, discount total, and tax total on an order.
- [Return line item calculator](docId\:S9TBpCCK5wkBPZ_zXl4Bm) – Calculates extended price, discounted price, and sales tax for a return item.
- [Return order form calculator](docId\:pz8STk1TdOwsPIvKgGNlJ) – Calculates totals, discount total, and tax total on a return order form.
- [Return purchase order calculator](docId\:QVAtCfoRO-4in_d5zlicv) – Calculates totals and discount total on a return purchase order.

## Improvements to calculator behavior

Starting in Commerce Connect 12, the order calculation functionality was improved as follows:

- Avoid unnecessary recalculations – Previously, calculators recalculated prices and taxes even if an order had no changes, or if the changes did not affect results. This was inefficient, especially when using an external tax service, and it caused problems with stale data, such as old orders, deleted products, and expired or newly added promotions. In Commerce Connect 12, if an order has no changes that affect results, no recalculation occurs. Instead, the previously calculated values are returned.
- `TaxCategoryId` property on `LineItem` – A new `TaxCategoryId` property on `LineItem` stores the tax category for the line item. As a result, Commerce Connect retains tax information for later order processing even if the product is deleted.
- Store results on relevant objects – In Commerce Connect 12, when a calculation requires expensive work, such as calling an external tax service or reading from a database, the result is stored on the relevant object. If any of the following properties change, the result is recalculated and saved with the corresponding object.
  - `OrderGroup` or `SerializableCart` (calculates tax total)
    - `MarketId`
    - `CurrencyCode`
  - `Shipment` or `SerializableShipment` (calculates shipping tax and shipping cost)
    - `ShippingMethodId`
    - `ShippingAddress`
    - `LineItems` (adding or removing a line item)
    - `ShipmentDiscount`
  - `LineItem` or `SerializableLineItem` (calculates sales tax)
    - `PlacedPrice`
    - `Quantity`
    - `OrderAmount`
    - `EntryAmount`
    - `TaxCategoryId`

## Shipment is required for correct calculation

When you create an order (cart, purchase order, or payment plan) through [IOrderRepository](docId\:l7BMVAuVvca9lqVuuJl07), a shipment is created automatically. Order calculators only calculate line items that belong to a shipment — this is a change from the prior workflow-activity behavior.
