Commission as Code Explained: Why Your Commission Plans Should Be API-Managed

Commission as Code Explained: Why Your Commission Plans Should Be API-Managed

Commission as code means defining sales commission plans as structured JSON configs that are created, modified, versioned, and deployed via REST API. The same way engineering teams manage infrastructure as code. No proprietary UI required. No 6-week implementation. No "who changed this plan last quarter" mysteries.

What is commission as code?

Commission as code is the practice of managing sales commission plans as structured data through an API, rather than through vendor-specific graphical interfaces. It applies the same principles that transformed infrastructure management (Terraform, Pulumi) and CI/CD pipelines (GitHub Actions, CircleCI) to the world of sales compensation.

In a commission-as-code system, a commission plan looks like this:

{
  "name": "Q2 2026 AE Plan",
  "version": 1,
  "effectiveStart": "2026-04-01",
  "rules": [{
    "name": "Revenue Commission",
    "measure": "closed_won_revenue",
    "attainmentPeriod": "quarterly",
    "tierBy": "attainment",
    "tierMode": "full_rate",
    "tiers": [
      { "tierIndex": 0, "name": "Base",        "minThreshold": 0,    "rate": 0.08 },
      { "tierIndex": 1, "name": "On Target",   "minThreshold": 1.0,  "rate": 0.10 },
      { "tierIndex": 2, "name": "Accelerator", "minThreshold": 1.25, "rate": 0.14 }
    ]
  }]
}

This config is the source of truth. It is created via API (POST /api/plans), version-controlled (every update creates a new version), testable (dry-run simulation before going live), and auditable (full change history with author tracking).

Why does this matter?

1. Plan changes take minutes, not weeks

In legacy commission tools, changing a tier threshold or adding a bonus rule means navigating a proprietary UI, often with an implementation consultant. A simple accelerator change at CaptivateIQ or Spiff can take 2-4 weeks when you factor in scheduling, configuration, testing, and deployment.

With commission as code, the same change is a PATCH request:

curl -X PATCH https://app.compcode.ai/api/plans/plan_abc123 \
  -H "Authorization: Bearer ws_your_key" \
  -d '{ "rules": [{
    "name": "Revenue Commission",
    "tiers": [
      { "tierIndex": 2, "name": "Accelerator", "minThreshold": 1.2, "rate": 0.15 }
    ]
  }]}'

Done. New version created. Old version preserved. No implementation consultant required.

2. Every change is auditable

Commission disputes are one of the top reasons sales reps leave companies. When a rep questions their payout, you need to show exactly what plan was in effect, when it changed, and who changed it.

Commission as code provides this automatically. Every plan update creates a new version with a timestamp, author, and change message. You can diff version 3 against version 7 and see exactly what changed, just like a Git commit history.

3. Plans are testable before going live

Legacy tools make you deploy a plan and hope it is correct. Commission as code lets you simulate calculations against real deals before any money is committed:

POST /api/commissions/simulate
{
  "dryRun": true,
  "deals": [
    { "deal_value": 75000, "stage": "Won", "owner": "rep_123" }
  ]
}

The response shows exactly what each rep would earn, which tier applied, and the full calculation trace, without writing anything to the ledger.

4. Plans are portable and reproducible

A JSON commission plan can be stored in version control, shared across teams, templated for different segments, and deployed across multiple workspaces. Try exporting a CaptivateIQ plan config and importing it into another instance. You cannot.

The current state of commission APIs

As of 2026, no major commission management vendor offers API-driven plan configuration. Here is what the landscape looks like:

Vendor Plan Config via API Query Results via API Setup Time
CompCode Full REST API Yes 1-3 days
CaptivateIQ No (UI only) Limited 6-12 weeks
Spiff (Salesforce) No (UI only) Limited 4-8 weeks
QuotaPath No (UI only) Limited 1-2 weeks
Xactly No (UI only) Yes 8-16 weeks
Qobra No (UI only) Limited 2-4 weeks
Everstage No (UI only) Limited 4-8 weeks
Performio No (UI only) Limited 6-12 weeks

Some vendors offer read-only APIs for querying commission results, but none allow you to create or modify the plan itself through API. Every plan change requires their UI.

Who benefits from commission as code?

  • RevOps teams who change plans quarterly and are tired of 4-week implementation cycles
  • Finance teams who need audit trails for SOX compliance and commission disputes
  • Engineering teams building commission tracking into internal tools or CRM workflows
  • Startups who cannot afford $20K+/year for CaptivateIQ and do not want spreadsheets
  • Multi-CRM companies who need a CRM-agnostic commission engine

How CompCode implements commission as code

CompCode is built around four operating principles that flow directly from the commission-as-code thesis above. Each principle exists to keep the system honest: the API is the contract, the ledger is the source of truth, the engine is deterministic, and the CRM is replaceable. These four together are what let you treat commission plans like code in practice.

  1. API is the product. Every feature (plans, assignments, quotas, commissions, statements) is available via REST API. The dashboard is a UI on top of the API.
  2. Immutable ledger. Commission events are append-only. Corrections are compensating events, not edits. You can always trace exactly why a rep earned what they earned.
  3. Pure calculation engine. The commission calculation functions have zero side effects. Given the same inputs, they always produce the same outputs. This makes them testable, auditable, and trustworthy.
  4. CRM-agnostic. The engine works with plain objects. CRM-specific code (Attio, HubSpot) is isolated in adapters. Adding a new CRM does not require changing the calculation engine.

Getting started

The quickest path to commission as code: sign up at app.compcode.ai and connect your CRM (Attio or HubSpot). Then create a plan via API (POST /api/plans) or the AI plan builder that converts natural language to a plan config. Assign reps and set quotas via API. Commissions then calculate automatically when deals close in your CRM.

Full documentation is at compcode.ai/docs. The interactive API reference (Swagger UI) has request/response schemas for every endpoint.

Ship a plan change in minutes, not weeks

Get Started Free →