How to

How to build a commission calculator

Every month a spreadsheet decides what people get paid, and every month somebody disputes it. Here is the model behind a calculator that shows its working, the prompts to build it, and what it takes to run it.

The short answer

A commission calculator needs four things: the plan expressed as versioned rules, a clean set of qualifying transactions, a calculation that records its own working line by line, and a statement each rep can read without asking a question. The requirement people underestimate is explainability. A number with no visible derivation generates a dispute for every rep every period, and answering those disputes costs more than the calculation itself. Build the audit trail first and the arithmetic second.

commission.helix-app.ai

Commission

112%

Your attainment

38,400

Commission this period

2

Lines you have queried

Frozen

Q2, paid 14 July

4%
7%
9%
4%
-7%
Tier 1, to 70%Tier 2, to 100%Tier 3, over 100%Renewal rateClawback

Marginal tiers: the 9% applies only to attainment above 100%, not to everything. Whether a plan is marginal or whole-amount is the single most common source of disputes.

A sketch of the plan the statement was calculated under. Showing the tier a rate came from is what turns a number into something a rep can check rather than query.

What matters here

  • A commission calculator is four parts: versioned plan rules, qualifying transactions, a calculation that records its working, and a readable statement.
  • Explainability is the requirement, not the feature. Every figure needs a line-by-line derivation a rep can follow without asking.
  • Version the plan with effective dates. Recalculating an old period against a new plan is the fastest way to lose trust in the whole system.
  • Clawbacks, splits and ramps are where real plans live. A calculator that only handles a flat rate on closed won will not survive its first month.
  • Freeze a period once it is paid. Later corrections belong in the next period as an adjustment with a reason, never as a silent rewrite.
  • A commission calculator decides what people are paid, so scoped access, managed credentials and a named owner are part of the build.

Who this is for

You run sales compensation, revenue operations or finance. You already know your plans. What you want is a calculation you can defend line by line, and a month end that does not disappear into reconciling a spreadsheet.

How it works in practice

What happens between a deal closing and someone getting paid, and why the working matters more than the total.

  1. 1

    The plan is a version, not a document

    Rates, tiers, caps and ramp, with the dates each version applies to. Changing a plan makes a new version and leaves old periods alone.

  2. 2

    Deals qualify, and the reason is recorded

    Which transactions count for this period, on which date, under which rule. Splits are apportioned and validated to 100 percent.

  3. 3

    The calculation writes down its own working

    Per deal: the plan version, the tier, the rate, the split, the arithmetic, and the amount. The total is just the last line.

  4. 4

    A rep reads a statement, not a number

    Attainment, every qualifying deal with its commission line, adjustments with reasons, and the period total.

  5. 5

    Disputes happen on a line, not in an email

    A rep queries a specific line, it routes to the plan administrator, and the resolution is recorded against it.

  6. 6

    The period freezes on approval

    Later corrections become adjustments in the next period. Nothing silently rewrites a period somebody has already been paid for.

What a commission calculator is made of

A commission calculator is not a rate multiplied by revenue. It is four parts, and the third is the one that decides how much of your month end it consumes.

Versioned plan rules

Each plan as data: base rate, accelerators and their thresholds, caps, quota period, split rules, ramp treatment, clawback conditions, and the dates the version applies to.

Qualifying transactions

What counts: closed won deals, bookings, recognised revenue or cash collected, depending on the plan. With the qualification date and the rule that decided it recorded on each row.

A calculation with its working

Not a total. Per transaction: which plan version applied, which tier the attainment fell in, what rate was used, what was multiplied by what, and the resulting amount.

A statement

What the rep sees: attainment against quota, every qualifying transaction, the commission on each, adjustments with reasons, and the period total. Readable without a phone call.

These prompts start from a Helix project, which is what handles sign-in, credentials and hosting. Start with Helix

The prompts

Paste these into Claude Code, Codex or Cursor in order. Each one leaves you with something that runs, so you can stop after any step.

  1. The plan, versioned properly

    Getting the thing everyone argues about into a shape you can reproduce.

    In this Helix project, build me a commission calculator.
    
    Start with plans, and get one detail right that causes more disputes than
    anything else. For each tier, I need to say whether the rate applies only
    to the portion of attainment inside that band, or to the whole amount once
    that band is reached. Both models exist in real plans and confusing them
    is the classic commission bug. Make it an explicit choice per tier.
    
    A plan has an effective-from date, a quota period, a base rate, its tiers,
    and any cap. Never edit a published plan version. Editing creates a new
    version, and old periods keep pointing at the version they were calculated
    under.
    
    Then assign reps to plans with a quota, a start date and a ramp. And give
    me a preview: type an attainment figure and show me what it would pay and
    why.
    
    I sign in through Helix, so do not build a login page. Read the signed-in
    user from the runtime. And do not put any key or connection string in the
    code: if this needs to reach another system, tell me and I will create the
    connection in my workspace.

    Worth knowing. Marginal versus whole-amount tiering is the single most common source of commission disputes. Making it an explicit field removes the ambiguity permanently.

  2. What counts, before what it pays

    Qualification, splits and clawbacks, which is where real plans live.

    Now decide what actually counts.
    
    Load transactions with their booking, close, recognition and cash dates,
    and let the plan say which event and which date qualifies a deal for a
    period. Record on every row which rule qualified it and on what date.
    
    Handle splits: a deal apportioned across several reps by percentage, with
    the total validated to 100.
    
    And handle clawbacks properly. If a qualified deal is later cancelled or
    refunded, create a negative adjustment in the current open period. Do not
    go back and edit the closed period. That period was correct given what was
    known at the time, and it needs to stay that way or nobody can reconcile a
    payment against a statement.
  3. Show the working

    The requirement people underestimate, and the one that decides your month end.

    Now calculate, and treat the working as the output rather than the total.
    
    For each rep and period, store a line per step. Attainment, with ramp
    applied and shown as its own line. Then for each deal: the plan version
    used, the tier the attainment fell in, the rate, the split, the
    calculation performed, and the resulting amount. Then adjustments,
    clawbacks, draws and guarantees, each with a reason and an approver.
    
    The period total is derived from those lines and never entered directly.
    
    Store the derivation as rows rather than computing it on demand. That is
    what lets me answer a question about a period six months after the plan
    changed, which is exactly when it gets asked.

    Worth knowing. A number with no visible derivation produces a dispute from every rep, every period. Answering those costs more than the calculation.

  4. Statements, disputes, and closing the period

    Making it trustworthy enough that people stop rebuilding it in a spreadsheet.

    Give each rep a statement: attainment against quota, every qualifying deal
    with its commission line, adjustments with reasons, and the total.
    Downloadable, and readable without an explanation.
    
    Let them query a specific line rather than emailing about the total. The
    query routes to the plan administrator and the resolution is recorded
    against that line.
    
    Add a review step before payment showing period totals by team, the
    largest payouts, and anything that changed since the last run. Then freeze
    the period on approval. After that, corrections become adjustments in the
    next open period, with a reason, never a silent rewrite.
    
    Finally, an export for payroll, and a record of what was exported and
    when.
  5. Connect it to real systems

    The step that turns a working prototype into something with your data in it.

    Now connect it to the systems we actually run, so it works on real data
    rather than the rows you seeded.
    
    Anything in angle brackets is a placeholder. Swap it for whatever we use
    instead, and have the app name the connection it wants rather than assume
    a vendor, so changing my mind later is a config change and not a rewrite.
    
    <Salesforce>. Read closed deals with their amounts, dates and splits,
    which is what qualifies a transaction.
    
    <NetSuite>. Check invoices and cash received, if your plan pays on
    collection rather than closure.
    
    <Workday>. Read plan assignments and quotas, and export the approved
    period for payment.
    
    <Gmail>. Send each rep their statement, so a dispute happens on a line
    rather than in a thread.
    
    <Snowflake>. Read closed bookings from the warehouse, where the CRM data
    has already been cleaned up.
    
    <Gusto>. Export the approved period to payroll, and record exactly what
    was sent and when.
    
    <Okta>. Authenticate reps and read the manager relationship, which is what
    lets the app show a statement to its owner and their manager and nobody
    else.
    
    Only write where I have said to write. Everything else is read only.
    
    Do not write a key, a token or a connection string anywhere in the code,
    and do not ask me to paste one. Tell me which connections you need and I
    will create each as an authentication in my Helix workspace. Reference
    them by alias.

    Worth knowing. Every name in angle brackets is a placeholder for whatever you run. Helix holds the credential as a workspace authentication, so the app references an alias and never the secret itself.

  6. Ship it

    The last step of every build: a URL, and the right people on it.

    Deploy my app.

    Worth knowing. Your assistant runs helix deploy underneath and the app comes back as a URL. Compensation is among the most sensitive data you hold, so set Access Control before sharing and scope it so a rep sees only their own statement.

What it connects to

This app decides what people get paid, so what it reads and what it writes both matter more than usual.

  • Salesforce

    Read closed deals with their amounts, dates and splits, which is what qualifies a transaction.

  • NetSuite

    Check invoices and cash received, if your plan pays on collection rather than closure.

  • Workday

    Read plan assignments and quotas, and export the approved period for payment.

  • Gmail

    Send each rep their statement, so a dispute happens on a line rather than in a thread.

  • Snowflake

    Read closed bookings from the warehouse, where the CRM data has already been cleaned up.

  • Gusto

    Export the approved period to payroll, and record exactly what was sent and when.

  • Okta

    Authenticate reps and read the manager relationship, which is what lets the app show a statement to its owner and their manager and nobody else.

Each line says whether the app reads, writes or both. Anything not described as writing should be read only.

Named systems are the ones most teams actually run, not a list of the only ones that work. Swap in whatever you use.

Each connection is an authentication in your Helix workspace, referenced by alias. The app names the connection it wants and never holds the credential, so nothing here ends up in your code and any of it can be rotated or revoked without a redeploy.

Running it for real

The build gets you a working calculator. It decides what people are paid, holds compensation data, and reads from your CRM and finance systems, so how it is run is part of the design.

AI Deployment

Get it to a URL people can open

One command takes the app from your assistant to a live address, so the people who need it get a link rather than instructions for running it locally.

App Security

Put your identity provider in front of it

Compensation is among the most sensitive data in a company. SSO means people sign in with their existing account, and access is scoped so a rep sees only their own statement.

App Security

Connect the system of record with managed credentials

Pulling closed deals and pushing payroll exports needs real access to those systems. Granting it to the app rather than pasting keys into it means credentials can be rotated or revoked without a redeploy.

App Registry

Put a name on it

Every app carries a named owner and an entry IT can see, so the tool does not become nobody's problem when the person who built it changes role.

Cost Management

Know what it costs to run

Per-app spend visibility, with budgets and caps, so an internal tool cannot quietly become a line item nobody can explain.

Questions people ask

What is a commission calculator?

It applies versioned compensation plan rules to qualifying transactions and produces a per-rep statement showing how every figure was derived. The calculation matters less than the derivation, because the derivation is what prevents disputes.

What is the difference between marginal and whole-amount tiers?

A marginal tier applies its rate only to the portion of attainment inside that band. A whole-amount tier applies the rate reached to everything. Both exist in real plans, and confusing them is the most common commission calculation error, so make it an explicit field per tier.

How should I handle a plan change mid-year?

Create a new plan version with an effective-from date rather than editing the existing one, and keep old periods pointing at the version they were calculated under. Recalculating a paid period against a new plan destroys trust in every other number the system produces.

How do clawbacks work in a commission system?

As a negative adjustment in the current open period, with a reason attached, rather than a rewrite of the closed period the original transaction fell in. The closed period was correct given what was known at the time, and it needs to stay that way.

Why does freezing a period matter?

Because once a rep has been paid against a statement, that statement is a record. If later corrections silently change it, nobody can reconcile a payment against a period, and every dispute becomes unresolvable.

Can I build this without an engineering team?

Yes. The prompts here are written for Claude Code, Codex or Cursor and stage the build. What no tool decides for you is your qualifying event, your tier model, and how ramp is treated, and those three choices are most of the plan.

Last reviewed September 2026.

Build it, then run it properly

Helix is the governed runtime for AI-built apps. Deploy what you build, put SSO in front of it, connect it to your systems with managed credentials, and give it a named owner.