The affiliate program — the frozen terms, and how every rupee is counted

Who this guide is for: PARTNER-SIDE businesses — an affiliate, or a business considering enrolling — and anyone who needs to see precisely how affiliate earnings are derived. Enrollment and claim actions are administrator actions.

The commercial terms are frozen — they are not invented here, and the running product does not get to reinterpret them.

The frozen terms, verbatim from the approved commercial decision record (docs/delivery/zcode-commercial-and-content-implementation-2026-10-09.md, the affiliate lines of the terms block, cross-consistent with section 3 of docs/reviews/2026-10-09-commercial-and-management-decision-packet.md):

Affiliate: recurring 20% of eligible collected ex-GST software revenue. … One share per collection: no stacked affiliate, reseller and wholesale commissions. Exclude GST, Meta, unpaid/refunded/reversed sums. Calendar-month statements, T+15 settlement, no minimum payout. Trace late refund adjustments without editing final statements … preserve paid access/data/earned share on cancellation/partner exit.

Enrollment itself is ₹0: "Partner enrollment/platform fee ₹0; platform owner separately provisions authority."

About the numbers. Every business, plan, payment, refund and credit note in the runs behind this guide is synthetic. The plan price (₹1,499 → taxable ₹1,499.00 + 18% GST = ₹1,768.82 gross), the payment transport that "collects" it, and every affiliate code are test fixtures. No live payment occurred, no gateway was involved, and no real money moved.

Enrolling (administrator action)

A business that has not enrolled sees the honest empty program: no affiliate, no referrals, zero totals — and the stacking policy stated in plain words: "One share per collection: affiliate earnings never stack with managed-reseller or wholesale shares."

Being referred: claiming a code

A referred business's administrator claims the affiliate's code. The refusals first:

Situation Answer
Unknown code 404 AFFILIATE_CODE_UNKNOWN
Malformed code 400
Member seat (not admin) 403
Your own affiliate code 422 AFFILIATE_SELF_REFERRAL
Already attributed to another affiliate 409 AFFILIATE_ALREADY_ATTRIBUTED
The affiliate's enrollment is disabled 409 AFFILIATE_CODE_INACTIVE

Attribution is permanent and one-per-business: replaying the same code returns the same referral; a different affiliate's code is refused. Even two affiliates' codes claimed simultaneously leave exactly one binding — one claim wins, the other gets the 409.

How earnings are derived — the frozen math, proven row by row

The example: a plan priced ₹1,499 excl. GST, collected as ₹1,768.82 inclusive. The GST-inclusive gross is not commissionable.

  1. Eligible revenue = collected ex-GST taxable only. First collection: eligible ₹1,499.00; earnings 20% = ₹299.80; the referral's status flips to "earning" with the first-collection date set.
  2. Unpaid businesses stay "referred". A business that was quoted but never collected shows earnings ₹0 — attribution alone earns nothing.
  3. Recurring: a second collected month accrues on the same binding — the example's two months totalled eligible ₹2,998.00, earnings ₹599.60. (The product has no automatic renewal; each period is a deliberate choice.)
  4. Refund continuity, row-accurate against the original collection: - A half service credit (₹884.41 incl. GST → ₹749.51 ex-GST) reduces the original row to eligible ₹749.49 / earnings ₹149.89 — the original collection date stays visible. - A later cash refund that settles that credit causes no second clawback: the row stays ₹749.49 / ₹149.89. A refunded amount is subtracted exactly once. - A full payment reversal zeroes the payment exactly once (replay-safe even under two simultaneous status syncs): the row turns "reversed", eligible ₹0, earnings ₹0 — recorded, not erased. - Partial credit then full reversal ends at exactly ₹0.

One share per collection — proven in both directions

Isolation, immutability, and disabling

The enrollment card through the real screen — supplementary proof

A supplementary browser run drove the real partner screen and proved the enrollment journey above as a user lives it:

  1. Opening the card raises no extra verification prompt — the card view is a member-scope read (this is the honest recorded behavior; see the evidence section below).
  2. The card first shows the honest not-enrolled state.
  3. Clicking Enroll raises the real verification prompt — the privileged action, not the read, is what demands the factor.
  4. After the factor, the enrollment succeeds exactly once.
  5. The referral code appears and persists: refreshing the card re-reads the same code, character for character.
  6. The earnings summary renders with it.

After the action-raised factor: the enrolled affiliate card showing the persistent referral code and the earnings summary

The screenshot is a byte-exact capture of the supplementary passing run (SHA256 and provenance in assets/ASSETS-MANIFEST.json). It is supplementary evidence — the SHA-bound journey 4 remains FAILED at its entry expectation and defect FULL3747-B-02 stays open. A small related UI fix (46fb35c8) lives on the browser lane's branch, not on this guide branch's base. All data is synthetic.

What this guide does NOT claim (kept honest)


Evidence record (kept for honesty). The FULL3747-PG lane executed the mounted affiliate suite against a real ordinary-role (FORCE RLS) throwaway PostgreSQL 16 cluster over real loopback HTTP, on the combined candidate:

Standing: combined-candidate, local evidence; the affiliate routes are mounted in the candidate's app.ts. Chief acceptance and publication are OPEN. The run also proved pre-mount honesty: without the router, the same read answered a plain 404 — the program is never half-exposed. No live or Main-built deployment is claimed.