> ## Documentation Index
> Fetch the complete documentation index at: https://docs.gorules.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Commission calculations

> Build tiered commission structures with quotas, accelerators, and team splits.

This guide shows how to build commission rules that handle tiered rates, quota attainment, and complex payout structures.

## What you'll build

A commission decision that:

* Calculates base commission from tiered rates
* Applies accelerators for exceeding quota
* Handles multiple product types with different rates
* Supports team-based splits

> [!NOTE]
>
> Want to skip ahead? [Download the completed decision](https://docs.gorules.io/downloads/commissions.json) and import it directly.

### Decision flow

**Sales Commission Calculation**

## Example: Sales commission

### Input data

```json theme={null}
{
  "rep": {
    "id": "SR-1234",
    "role": "account_executive",
    "quota": 100000
  },
  "period": {
    "sales": 125000,
    "newBusiness": 45000,
    "renewals": 80000
  },
  "deal": {
    "amount": 15000,
    "type": "new_business",
    "productLine": "enterprise"
  }
}
```

## Step 1: Base commission rates

Define rates by product and deal type:

Inputs

Outputs

## Step 2: Quota attainment tiers

Calculate quota percentage and tier:

Then apply accelerators based on attainment:

Inputs

Outputs

## Step 3: Calculate commission

Combine base rate with attainment multiplier:

## Step 4: Role-based caps

Apply maximum commission by role:

Inputs

Outputs

## Output structure

```json theme={null}
{
  "dealAmount": 15000,
  "baseRate": 0.12,
  "baseCommission": 1800,
  "attainmentPercent": 125,
  "tier": "accelerator_2",
  "multiplier": 1.5,
  "adjustedCommission": 2700,
  "finalCommission": 2700,
  "capped": false
}
```

## Variations

### Team splits

Split commission between reps:

Inputs

Outputs

### Spiffs and bonuses

Add special incentives:

Inputs

Outputs

### Clawbacks

Handle commission recovery:

Inputs

Outputs

## Best practices

**Version commission plans** - Keep history when plans change mid-year.

**Show calculations** - Output intermediate values for transparency.

**Handle edge cases** - Zero quota, partial periods, mid-month starts.

**Audit trail** - Log all inputs and outputs for disputes.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.