> For the complete documentation index, see [llms.txt](https://docs.wandreferrals.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.wandreferrals.com/programs-and-commissions/commission-base.md).

# Commission base and rounding

## What it does

The **commission base** is the amount a percentage commission is applied to. By default it is the product subtotal of the attributed order (line-item price × quantity), **excluding** discounts, shipping, and tax. You can choose to fold any of those three back in.

## When to use

* Include discounts if you want affiliates paid on the pre-discount value (more generous).
* Include shipping/tax only if your accounting treats them as commissionable revenue (uncommon).

## Configure the base

On the program's commission settings, three independent toggles control the base (each is **off by default**):

| Setting                  | Off (default)                        | On                                  |
| ------------------------ | ------------------------------------ | ----------------------------------- |
| Include discount in base | Base uses the post-discount subtotal | Base uses the pre-discount subtotal |
| Include shipping in base | Shipping excluded                    | Shipping added to the base          |
| Include taxes in base    | Tax excluded                         | Tax added to the base               |

### How the base is assembled

1. Start with the line-items subtotal (excluding any [excluded products/collections](https://github.com/wand-referrals-app/wand-referrals/tree/codex/gitbook-docs-foundation/docs/manual/programs/commission-types/README.md#excluding-products-or-collections)).
2. Subtract order discounts — unless *Include discount in base* is on, in which case the pre-discount subtotal is used.
3. Add shipping only if *Include shipping in base* is on.
4. Add tax only if *Include taxes in base* is on.

Each order commission stores the full breakdown (`orderSubtotalCents`, `orderDiscountCents`, `orderShippingCents`, `orderTaxCents`, and the final `commissionBaseCents`) so you can audit every calculation on the sale's detail page.

## Rounding

All money is **integer cents**. Rounding happens once, at calculation time (`Math.round`), never as a float. Percentages divide by 100; basis-point rates divide by 10,000.

## Tax withholding (recorded figure)

If a program has tax withholding enabled, each commission also stores a `taxWithheldCents` figure — computed as `round(commissionAmount × withholdingRate ÷ 100)`. Note:

* This is a **recorded** figure for reporting; the campaign-level withholding value is **not** deducted from the commission owed at award time.
* Actual money withheld from payouts is handled separately at payout time (US backup withholding and foreign withholding) — see [Tax forms & withholding](https://github.com/wand-referrals-app/wand-referrals/tree/codex/gitbook-docs-foundation/docs/manual/payouts/tax-forms/README.md). A dual-withholding guard ensures the payout-time regime takes precedence so tax is never double-counted.

## Maximum payout limit (cap)

A program can set a **maximum payout amount** per campaign. This is enforced at **payout-batch time**, not per order: if an affiliate's already-paid amount plus the new batch's contribution for that campaign would exceed the cap, the batch is refused with a clear message. Remove the offending commissions from the batch or raise the cap to proceed. See [Payout methods & batches](https://github.com/wand-referrals-app/wand-referrals/tree/codex/gitbook-docs-foundation/docs/manual/payouts/payout-methods-and-batches/README.md).

## Related

* [Commission types](https://github.com/wand-referrals-app/wand-referrals/tree/codex/gitbook-docs-foundation/docs/manual/programs/commission-types/README.md)
* [How attribution works](https://github.com/wand-referrals-app/wand-referrals/tree/codex/gitbook-docs-foundation/docs/manual/attribution/how-attribution-works/README.md)
* [Tax forms & withholding](https://github.com/wand-referrals-app/wand-referrals/tree/codex/gitbook-docs-foundation/docs/manual/payouts/tax-forms/README.md)
