Affiliate & Referral Partner Ledger
Build your own internal tool that imports partners and conversions, attributes sales by code, computes commissions, and locks in payouts behind a manager approval gate - with a clean AP-ready export.
A private, login-protected ledger where partners and conversions are imported, attributed by code, commissions are computed, a manager approves the payout batch, and finance gets an AP-ready payout CSV.
Before you start
- A partner list (name, code/link, commission rate, payout details) as a CSV or Google Sheet
- A conversions export (code, order/value, date) as a CSV
- Free accounts for Vercel, Supabase, and Resend (the plan walks you through them)
The problem this kills
Affiliate and referral programs almost always start in a spreadsheet, and they almost always end in a headache. You paste in a list of partners, you paste in a list of orders, and then you spend a weekend with VLOOKUPs trying to figure out who drove what, what the commission should be, and how much you actually owe. Then a refund comes in three weeks later and quietly breaks every total. Then the same order shows up twice in two different exports and you almost pay for it twice. Then a "partner" turns out to be an employee using their own code on their own purchase.
By the time you're done, nobody fully trusts the number, finance asks you to re-explain it, and you have no clean record of who approved the payout or why. The spreadsheet has no memory, no guardrails, and no audit trail.
This Implementation Plan replaces that whole mess with a small, private internal tool that does the matching, the math, the duplicate-checking, and the approval - and keeps a permanent record of every step.
What you'll build
A login-protected web app for your partner/marketing ops team that:
- Imports your partners (name, unique code or link, commission rate, payout details).
- Imports your conversions (the orders or signups attributed to a code, with their value and date).
- Attributes each conversion to the right partner by code, and computes the commission using your rules.
- Handles the messy reality: refunds and clawbacks, duplicate conversions (so the same order is never paid twice), and self-referral / fraud flags.
- Groups everything into a payout batch that a manager must review and approve before any money is marked payable.
- Exports an AP-ready payout CSV in the exact columns your finance system expects.
It's built to fit your program, because the very first thing it does is interview you about how your program actually works.
What's inside the Implementation Plan
The plan is a single file you paste into an AI coding agent (Claude Code), and it builds the tool with you step by step. No prior coding needed.
- It starts by interviewing you about your business. Before writing a line of code, the plan has the agent ask about your current process, your spreadsheets and systems, the exact field names and code conventions in your data, your typical and peak volumes, your commission and approval rules, and your real edge cases. Then it reads back a short tailored spec and waits for your thumbs-up. You get a tool shaped to your program - not a generic template.
- A clear definition of done so you know exactly what "finished" looks like.
- Every build step ends with a ready-to-copy prompt you paste into the agent.
- A "No API yet?" fallback so you can build the whole thing today using CSV/Google Sheet imports and a clean CSV export - no integration with your shopping cart or affiliate platform required.
- A verification checklist so you can prove it works before anyone relies on it.
The governance it includes (this is the point)
This isn't a toy. Every runbookify plan builds in the controls that make an internal money tool safe to use:
- Login so only your team can open it.
- Row-level security so each organization only ever sees its own partners and payouts.
- A complete audit trail - who imported, who matched, who approved, and when.
- A hard human-in-the-loop approval gate - the tool computes the commissions, but nothing becomes payable until a manager reviews the batch and approves it. The AI drafts; a person commits.
- Duplicate guards keyed on partner code + order ID, so a single conversion can never be paid twice.
Who it's for
Partner and marketing ops people who run a referral or affiliate program out of spreadsheets and are tired of the monthly reconciliation scramble. If you can keep a clean spreadsheet, you can run this tool - and you'll finally have a defensible, auditable record of every payout.
You've got this - paste the first prompt and let the agent interview you.