> For the complete documentation index, see [llms.txt](https://help.dollarlabs.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.dollarlabs.io/dollarback-store-credit/earning-cashback-programs/how-cashback-is-calculated.md).

# How cashback is calculated

{% embed url="<https://dollarlabs.neetorecord.com/watch/0ce8902f064b34906b10>" %}

\_This article's section starts at 0:00 in the video.\_

This is the full reference for the cashback engine: exactly how DollarBack turns an order into a credit amount. If a customer's credit ever looks "wrong", the answer is on this page, usually in discounts, program competition, or a cap.

## The pipeline at a glance

For every qualifying order, DollarBack:

1. Checks **eligibility gates**: if any fails, no math runs.
2. Computes a **base amount per order line**: line price minus discounts.
3. **Deducts** portions paid with store credit or gift cards, per your settings.
4. Lets your programs **compete for each line**: one winner per line.
5. Applies the winning program's **value**, then caps, rounding, and currency.

Everything below is per line item; cashback is never computed on the order as one lump.

## Step 1: Eligibility gates

Before any calculation:

* **Excluded customer tags**: tagged customers earn nothing ([Exclude customers from earning](/dollarback-store-credit/earning-cashback-programs/exclude-customers-from-earning.md)).
* **Sales channels**: a program restricted to specific channels (web, POS, draft orders) skips orders from other channels.
* **Program date windows**: a program outside its start/end dates doesn't participate.
* **Frequency limits**: a customer who has hit a program's limit is skipped by that program.

## Step 2: The base amount, per line

The base for each line is the **line price minus that line's discount allocations**:

* A discount targeted at a product reduces that line's base directly.
* An **order-level discount** (e.g. a 10%-off code) is spread proportionally across all lines, so every line's base shrinks by the same ratio. Every discount reduces cashback; there is no way to earn on the discounted-away amount.

**Order total vs order subtotal.** Your global **Base cashback on** setting decides what counts:

| Mode               | Taxes    | Shipping                                          |
| ------------------ | -------- | ------------------------------------------------- |
| **Order Total**    | Included | Included only if **Include shipping costs** is on |
| **Order Subtotal** | Excluded | Excluded                                          |

In total mode, each line is scaled by the tax-inclusive ratio so that the per-line amounts still sum to the checkout total.

## Step 3: Store credit and gift cards are deducted first

**No cashback on cashback.** Store credit spent on the order is deducted proportionally from every line before calculation, governed by the **When a customer pays with store credit** setting:

| Option                                       | Effect                                                                                |
| -------------------------------------------- | ------------------------------------------------------------------------------------- |
| No cashback                                  | Any store-credit use disqualifies the order entirely                                  |
| Cashback on full order amount                | Credit-paid portion still earns                                                       |
| Cashback on amount paid with real money only | Only the non-credit portion earns (the default mental model: no cashback on cashback) |

**Gift cards have two separate knobs:**

1. **When a customer pays with gift cards**: no cashback / full order amount / non-gift-card portion only.
2. **Give cashback when customers purchase gift card products**: when off, gift-card product lines are removed from the calculation entirely.

Defaults and exact labels: [Settings](/dollarback-store-credit/settings.md).

## Step 4: Which program claims each line

**Competition is winner-takes-all per line.** Programs never stack:

* Specific programs run first, in specificity order: **variant → product → collection**. A line claimed by a specific program is excluded from your all-products program.
* If two programs still match the same line, the **higher cashback wins** for that line.
* Different lines in one order can be claimed by different programs.

**Order goals pick the highest threshold met**: a $75/$150 ladder pays only the $150 reward on a $160 order, never both. When a goal program targets specific products, variants, or collections, only spend on the matching lines (after discounts) counts toward the threshold, and the reward is calculated on that same spend; see [Set up purchase cashback](/dollarback-store-credit/earning-cashback-programs/set-up-purchase-cashback.md).

**Tier multipliers are snapshotted per order.** If the customer is in a loyalty tier with a multiplier, the multiplier in force at calculation time is applied and recorded on the order. Changing tier settings later never retroactively changes past orders' cashback. See [Link cashback programs to tiers](/dollarback-store-credit/loyalty-tiers/link-cashback-programs-to-tiers.md).

## Step 5: Value, caps, and rounding

* **Percentage programs** apply their rate to the line's base.
* **Fixed-value programs** multiply the amount by the line's **quantity** (2 units = 2 × the fixed credit), and each line's cashback is **clamped so it never exceeds what the customer actually paid** for that line.
* **Maximum cashback per order**: if the order's total cashback exceeds the global cap, all programs and lines are **scaled down proportionally**, preserving their relative shares. Nothing is dropped; everything shrinks together.
* **Rounding**: amounts are truncated to 4 decimal places internally, and the **last line absorbs the remainder** so the total stays exact to the cent. If **Round up cashback** is on, the final total is rounded up to the nearest whole number as the very last step.

## Multi-currency

* Amounts are tracked in both your shop currency and the order's presentment currency. Fixed-value cashback converts using **the order's own conversion rate** (presentment ÷ shop), not today's market rate.
* The credit lands in the **customer's resolved currency**, so a customer shopping your EUR market is credited in EUR.

## Worked example (3-line cart with a discount code)

Settings: base = **Order Subtotal**, no cap, round-up off. Programs: **5% on all products** and **10% on the "Serums" collection**.

The customer's cart, with a 10%-off order code applied ($12.40 spread proportionally across $124 of items):

| Line                     | Price       | Discount allocation | Base        | Winning program                | Cashback  |
| ------------------------ | ----------- | ------------------- | ----------- | ------------------------------ | --------- |
| Serum 30 ml × 1 (Serums) | $58.00      | −$5.80              | $52.20      | 10% (specific claims the line) | $5.22     |
| Gel cleanser × 2         | $48.00      | −$4.80              | $43.20      | 5% (all products)              | $2.16     |
| Lip butter trio × 1      | $18.00      | −$1.80              | $16.20      | 5% (all products)              | $0.81     |
| **Total**                | **$124.00** | **−$12.40**         | **$111.60** |                                | **$8.19** |

Points to notice:

* The serum earned 10%, **not** 10% + 5%; the specific program claimed the line and excluded it from the all-products program.
* Every line's base was reduced by its share of the order-level code before any percentage applied.
* With **Round up cashback** on, the customer would receive $9.00 instead of $8.19.
* If a $5.00 **Maximum cashback per order** were set, each line would scale by 5 ÷ 8.19 (≈ $3.19 / $1.32 / $0.49).

## When the credit actually arrives

Calculation and issuance are separate: the trigger event (created / paid / fulfilled) and the holding period decide *when* the customer can spend the result; see [When credit is issued](/dollarback-store-credit/earning-cashback-programs/when-credit-is-issued.md). Refunds and order edits recalculate as a diff against what was issued; see [Refunds, cancellations & order edits](/dollarback-store-credit/spending-store-credit-and-rewards/refunds-cancellations-and-order-edits.md).

## Common issues

* "The customer earned less than my percentage": a discount code, store-credit payment, or gift card reduced the base; recheck Steps 2–3.
* "Two programs should both apply": they never stack; one wins per line (Step 4).
* "No credit at all": walk the gates in Step 1, then [A customer didn't receive cashback](/dollarback-store-credit/troubleshooting-and-faq/customer-didnt-receive-cashback.md).

## Related articles

* [Settings](/dollarback-store-credit/settings.md)
* [When credit is issued](/dollarback-store-credit/earning-cashback-programs/when-credit-is-issued.md)
* [Set up purchase cashback](/dollarback-store-credit/earning-cashback-programs/set-up-purchase-cashback.md)
* [Refunds, cancellations & order edits](/dollarback-store-credit/spending-store-credit-and-rewards/refunds-cancellations-and-order-edits.md)
