Setting up Order Management Rules: Accumulating Packaging Costs with Custom Fields [Guide]

Last updated: October 12, 2026

You can use Order Management Rules (OMR) to accumulate packaging or material costs automatically as an Order is processed. By combining a For Each Package iteration with the Add to operation, you can add a fixed amount to a registered numeric Custom Field for every Package without writing a formula.

This guide covers how to configure a per-Package packaging cost, verify the accumulated Order total, prevent unintended accumulation when a rule runs again, and adapt the same pattern to a quantity-based Line scenario in techSHIP.

Before configuring this workflow, make sure your Location has a registered Custom Field with Type = Number. You can use a customer-managed field or a suitable field provided by your Host System. For information about creating and managing these fields, refer to 📄 Managing Location Custom Fields [Guide].

To learn how to build and configure a Rule Set, refer to 📄 What's New in Order Management Rules (OMR) for Rule Sets in techSHIP [Guide]. For a complete reference to supported Action fields and operations, refer to 📄 Order Management Rules (OMR) Available Actions [Information].

Understanding Packaging Cost Accumulation

When you place an Action inside a For Each Package iteration, techSHIP executes that Action once for every Package processed by the loop. To accumulate all Package costs into a single Order total, configure the Action at the Order level rather than the Package level.

For example, you can use the following packaging-cost scenario:

  • Packaging cost per Package: 0.25

  • Number of Packages: 4

  • Starting Order value: No existing value

  • Resulting Order total: 1.00

An unset arithmetic target starts from zero, so you do not need a separate initialization Action for the first execution. If the same field already contains 2.00, however, four additional Package iterations at 0.25 each result in 3.00, because Add to continues from the existing value.

The Action remains at Level = Order because every Package contributes to the same Order-level total. A registered Location Custom Field does not gain a separate Package-level value simply because the Action runs inside a Package iteration.

Configuring Packaging Cost Accumulation

Configure the Package Iteration

In your Rule Set, add a For Each Package iteration so the enclosed logic runs once for every Package associated with the Order.

Place the packaging-cost Action inside the Package iteration. This placement determines how many times the amount is added: an Order with four Packages reaches the Action four times.

Once the Package iteration is in place, its contents will execute once per Package. Next, configure the Action that updates your Order-level Custom Field.

Configure the Packaging Cost Action

Inside the For Each Package iteration, add a new Action and configure it with the following values:

  • Name: Enter a descriptive name, such as Add Packaging Cost.

  • Level: Select Order.

  • Operation: Select Add to.

  • Field: Select your registered Number Custom Field, such as Packaging Cost.

  • Value: Enter 0.25.

  • Description: Optionally, describe the purpose of the packaging-cost Action.

Select Add to place the Action in the iteration, then save your Rule Set through the normal Rule Set workflow. The configured Action now adds 0.25 to the same Order-level field each time the Package loop reaches it.

Verify the Expected Result

Process an Order with four Packages and no existing value in the selected packaging-cost field. Because Add to treats an unset target as zero, the Action produces the following progression: 0.25, 0.50, 0.75, and finally 1.00.

This calculation is once per Package, not once per unit contained in the Package. The number of units packed does not cause the Action to execute additional times.

This workflow demonstrates calculating and storing a value inside techSHIP. Configuring or populating the field does not, by itself, establish that the amount is transmitted to your Host System, posted as a billing charge, or included on a downstream invoice.

Once you confirm the 1.00 Order-level result, the packaging-cost accumulation is working as expected. If the same Order can pass through the workflow more than once, review the recalculation behavior before relying on the total.

Preventing Repeated Accumulation

The automatic zero starting point applies only when the target field has no current value. If an Order already contains a packaging total and the Rule Set executes again, Add to continues accumulating from that existing value.

If your workflow can process the same Order more than once, a previously calculated total can be increased again. For example, rerunning the four-Package example after the field already contains 1.00 can add another 1.00 instead of recomputing the same total from zero.

If you need each execution to recalculate the total from scratch, add an Order-level Set value Action that resets the target Custom Field to 0 before the For Each Package iteration. Alternatively, use an appropriate workflow guard that prevents the accumulation from running again after the total has already been calculated.

With the reset or guard positioned before accumulation, your Rule Set can produce a deterministic total on repeated processing. You can then continue with any downstream workflow that uses the stored value.

Business Use Case: Adding Handling Costs for High-Quantity Lines

You can apply the same Add to pattern when a fixed handling cost should be added for each Line that exceeds an item-quantity threshold. In this variation, use a Line iteration, evaluate the current Line's Item quantity, and add the fee to an Order-level numeric Custom Field only when the Line qualifies.

For example, configure the Line-based scenario as follows:

  • Iteration: Use a Line iteration.

  • Condition: Evaluate Item quantity > 5 for the current Line.

  • Action Step: Place a new Action step in the True branch.

  • Action Level: Select Order.

  • Operation: Select Add to.

  • Field: Select a registered Number Custom Field representing the handling total (e.g., Handling Total).

  • Value: Enter 2.00.

If two Lines satisfy the Item quantity > 5 condition, the Order-level handling field increases by 4.00. The fixed 2.00 amount is applied once for each qualifying Line.

A Line with Item quantity = 10 still reaches the fixed Action only once; it does not add the amount ten times. If you need a true per-unit calculation, you need quantity-aware logic beyond a fixed Add to Action because this workflow does not multiply the entered amount by the Line quantity.

You can use Subtract from as a variation when you need to decrease a supported numeric target by a fixed amount. The same execution-frequency principle applies: the subtraction occurs once each time the Action is reached.

Once your Line condition and Action are saved, each qualifying Line contributes the configured fixed amount to the same Order-level total. For detailed Condition-field and operator behavior, refer to 📄 Order Management Rules (OMR) Available Conditions [Information].