How to Add Rule-Based Expenses (Automatic Order Costs)

Updated October 5, 2026

A rule-based expense adds a cost to every order automatically, calculated from a formula instead of typed in order by order. Use it for costs that grow with your order volume, such as a fulfillment fee per order, a marketplace commission, or a packaging charge.

Where
In the sidebar, open Expenses, then Rule-Based.
Who
Stores that pay a cost per order, per line of an order, or as a share of the order value.
Time
About 3 minutes per rule.
Updates
Saving a rule books it on every existing order it covers, right away. New orders are booked as they come in.

Is a Rule the Right Tool?#

You want to recordUse
A cost per order, or a percentage of the order valueA rule-based expense (this guide)
What you pay your supplier for the productsProduct costs, see How to Add Product Costs
A packaging or preparation cost for every unit soldHandling, see What Is the Handling Cost?
The fee of your payment providerTransaction fees, see How to Add Transaction Fees
A correction on one specific orderA manual order cost, see How to Manually Change the Cost of an Order
A flat recurring bill, for example $99 a month for an appAn operating expense: in the sidebar, Expenses > Operating

The Rule-Based Page#

The Rule-Based Page

Create a Rule#

Click Add Rule. The dialog has two pages, Details and Preview. Nothing is saved before the last click in the preview.

  1. 1

    Step 1 of 4

    Fill in the details#

    Fill in the details

    Calculation types. The example order has a total of $166.00 and contains three products, one of them twice: 3 lines, 4 units.

    Calculation TypeHow it is calculatedExample on the $166.00 order
    Fixed per orderThe same amount on every order$3.50 per order adds $3.50
    Fixed per itemAmount × number of lines in the order$0.75 per item adds 3 × $0.75 = $2.25
    Percentage of orderRate × the order value2.9% adds $166.00 × 0.029 = $4.81
    Percentage + fixed feeRate × the order value, plus a fixed amount2.9% + $0.30 adds $4.81 + $0.30 = $5.11

    Fixed per item counts the lines of an order, not the units. A line is one product variant in the order, whatever its quantity: 4 units of the same mug are 1 line. For a cost that applies to every unit sold, use handling instead: see What Is the Handling Cost?.

    For the percentage types, enter the rate as a percentage (2.9 for 2.9%) and choose the Percentage Basis: Total price (including tax/shipping) or Subtotal price (before tax/shipping).

  2. 2

    Step 2 of 4

    Choose what the rule applies to#

    Scroll down in the dialog to Applies to. This choice decides which existing orders are booked when you save, and whether new orders are covered.

    Choose what the rule applies to
    ChoiceOrders coveredPick it when
    All ordersEvery order since your first one, and every new orderThe cost has applied for as long as the store exists
    New orders onlyOrders placed from today onThe cost starts now and your past numbers should stay untouched
    From a dateOrders placed on or after the date, and every new orderThe cost started on a date you know
    Date rangeOrders placed between the two dates, both includedThe cost applied for a limited time, or you are ending a rule

    Dates follow the time zone of your store.

  3. 3

    Step 3 of 4

    Check Refund & Dispute Handling#

    Below Applies to, a table decides whether the cost still counts when an order is refunded. A ticked box in Cost counted keeps the cost, an unticked box sets it to zero for orders with that status.

    Check Refund & Dispute Handling

    Example for Prorate partial refunds: a rule adds $3.50 to an order of $100.00. Later $40.00 of that order is refunded. The cost becomes $3.50 × (1 − 40 ÷ 100) = $2.10.

    These settings also apply to orders that are refunded after the rule was booked.

  4. 4

    Step 4 of 4

    Preview and save#

    Click Next. The preview shows what saving does before anything is booked.

    Preview and save

    In the screenshot, a packaging cost of $0.40 per order applies from September 1. It covers 746 existing orders, so saving books 746 × $0.40 = $298.40.

    After you click the button, the dialog Applying expense rule shows the booking and closes when it is done. If it reports that the rule was saved but could not be applied, open the rule with Edit and save it again.

Where the Cost Appears#

On the order. In the sidebar, open Orders and click an order. The cost summary has a Rule Expenses line.

Where the Cost Appears

On the dashboard. The profit breakdown lists Rule Expenses below Transaction Fees. The amount shown for Transaction Fees includes the rule expenses.

Where the Cost Appears

In the Income Statement. Rule-based expenses have their own Rule Expenses row.

Change, Pause or Delete a Rule#

ActionWhat happens to orders that are already booked
EditEvery order the rule covers gets the new amount. Orders that are no longer covered lose the amount.
DisableThe amount is removed from every order, past ones included. Enable books it again on every covered order.
DeleteThe rule and all amounts it added are removed.

To stop a rule and keep what it has booked, give it an end date. Do not pause it.

Change, Pause or Delete a Rule

Example: your fulfillment fee rises from $3.50 to $3.90 on October 1.

  1. Edit the existing rule: Date range, end date September 30. Save.
  2. Create a second rule with $3.90: From a date, October 1. Save.

An order from September 28 keeps $3.50, an order from October 3 gets $3.90. If you changed the amount of the existing rule to $3.90 instead, every order since the start of the rule would be booked again at $3.90. With 1,000 earlier orders that is 1,000 × $0.40 = $400.00 of extra cost in months that are already closed.

Troubleshooting#

An order has no Rule Expenses line. Check three things. The order date must lie in the Effective Period of the rule. The rule must be Active. And the order must not be a Shopify test order: test orders are never booked.

The rule is on the order but not in your profit. Profit rules can leave rule-based expenses out for an order status, for example for unpaid orders. In the sidebar, open Store settings > Profit Rules and check the Rules column.

Past months changed after you edited a rule. Editing books the new amount on every covered order. Set the rule back to its old amount, give it an end date, and create a new rule for the new amount (see the example above).

The amounts disappeared after you paused a rule. Pausing removes the rule from all orders. Click Enable in the row menu to book it again, then give the rule an end date instead.

Fixed per item books less than you expect. It counts lines, not units. See the note under "Calculation types".

The rule is missing in the Expense Report. The Expense Report does not include rule-based expenses. Use the dashboard or the Income Statement.

If a number still looks wrong, contact support and send the name of the rule, one order number, and the amount you expect on that order.

Limits#

  • The Expense Report does not list rule-based expenses.
  • Shopify test orders are never booked.
  • Fixed per item counts the lines of an order, not the units.
  • A rule belongs to the store it was created in. Create it again in every store that has the cost.
  • A rule does not replace a handling cost that was changed by hand on an order. Both amounts count, and the preview warns you when covered orders have one.

Common questions

Related articles

Was this article helpful?

We value your privacy
We use cookies to enhance your experience. By continuing to use our site, you consent to our use of cookies.

By clicking "Accept All", you consent to our use of cookies.

Learn more
How to Add Rule-Based Expenses (Automatic Order Costs) - Profitario