Claude Templates / B-tier · Situational

Growth & SEO

The Affiliate Program Playbook

Referral tracking, commission ledger, payouts: the standalone pattern.

AFFILIATE-PROGRAM-PLAYBOOK.md · 13 sections · 2,118 words · 17 KB · markdown

By Moe Ameen, founder of BILT · Published · Updated

The Affiliate Program Playbook builds a self-hosted affiliate system on Stripe for one app. Claude Code adds ?ref= link capture, first-click attribution within 30 days locked at signup, commissions from Stripe invoice.paid events that stay pending through a 30-day refund window, a $50 default payout threshold, an affiliate dashboard and asset library, and fraud checks for self-referral, IP clustering and click-stuffing.

Key takeaways

  • Defaults: first-click attribution, 30-day window, locked at signup.
  • Commissions stay pending until the refund window passes.
  • Payouts via Stripe Connect or a manual pipeline (Wise, PayPal, ACH).
  • Fraud rules cover self-referral, IP clusters, click-stuffing and refund rate.

A self-hosted affiliate system modeled on what Rewardful, PartnerStack, and FirstPromoter actually do. Click attribution, a commission ledger, an affiliate dashboard, payout thresholds, and the deliberate choice to keep each app's program standalone rather than federated.

What does the Affiliate Program Playbook build?

It builds signup, dashboard and asset pages for affiliates, Stripe webhook handlers for paid invoices and refunds, and a monthly payout batch job.

The file suggests 30% recurring for 12 months or 20% lifetime as starting commission tiers; set your own.

When should you start an affiliate program?

Start after launch, once you have paying users who might recommend you.

Each app's program stays standalone rather than shared across a portfolio.

What do you need first?

You need Stripe Billing and Customer Analytics, Stripe keys, and either Stripe Connect or a manual payout method.

Decide commission tier, attribution model, refund window and payout minimum before you build.

What's inside

What does the playbook give you?

When to use it

Post-launch. You need users before you need affiliates.

Straight from the file

What does the writing look like?

Canonical pattern drawn from Rewardful / PartnerStack / Tolt / FirstPromoter. BKE itself does not implement a full affiliate system yet; this playbook is the reference for any new app in the operator's portfolio (Kompozy, Cold Email Engine, Cold SMS, Cold DM, Cold WA/Telegram, Giveaway, Lead Scraper, AI Cold Caller) that adds one.

Table of contents

Which sections does the file cover?

  1. 0. Use this spec
  2. 1. Architecture
  3. 2. Schema
  4. 3. Code generation
  5. 4. Click capture
  6. 5. Attribution
  7. 6. Commission calculation
  8. 7. Payouts
  9. 8. Affiliate dashboard
  10. 9. Creative asset library
  11. 10. Fraud detection
  12. 11. Common pitfalls
  13. 12. Kickoff prompt

How do you run it?

Drop AFFILIATE-PROGRAM-PLAYBOOK.md into your repo, then tell Claude Code: “Read AFFILIATE-PROGRAM-PLAYBOOK.md and implement it in this codebase.” It's written for an agent to execute end to end. Search the file for angle-bracket placeholders and swap in your own project names, domains, and keys before the first run.

↓ Download the playbook

Who is this for, and who should skip it?

Best for

  • SaaS apps with paying users and creators who recommend them
  • Founders who want commission data in their own database
  • Apps already billing through Stripe

Not ideal for

  • Pre-launch apps with no customers
  • Teams that prefer a hosted affiliate platform
  • Multi-level or override commission structures (not covered)
  • Builders who won't adapt paths: the file points to a reference app you won't have

What else do people ask?

What defaults does the Affiliate Program Playbook use?

The Affiliate Program Playbook defaults to first-click attribution within 30 days, locked at signup, a 30-day refund clearance window and a $50 minimum payout. For commission it recommends 30% recurring for the first 12 months or 20% lifetime, and the schema defaults commission_pct to 30.00.

Is it taken from a live production system?

No. The Affiliate Program Playbook says its reference app doesn't run a full affiliate system yet, so it lays out a pattern drawn from Rewardful, PartnerStack, Tolt and FirstPromoter instead.

Can I pay affiliates without Stripe Connect?

Yes. The Affiliate Program Playbook describes a manual fallback for roughly your first 10 affiliates: pay through Wise or PayPal, leave stripe_transfer_id null and log the payout reference in metadata. Collect a W-9 (US) or W-8BEN (international) before the first manual payment.

What is in the Affiliate Program Playbook download?

The Affiliate Program Playbook is a markdown file of about 2,100 words. It has SQL for five tables (affiliates, clicks, attributions, commissions, payouts) and the first-click attribution trigger, TypeScript for code generation, the invoice.paid and charge.refunded handlers and the monthly payout batch, a seven-signal fraud table and eight pitfalls.

Can affiliate codes double as Stripe coupon codes?

No. The Affiliate Program Playbook keeps them apart, because a coupon changes what the customer pays and an affiliate code changes who gets credit. If you want a discount as an incentive, attach a separate coupon to the affiliate's link with a second querystring parameter.

How do we know this?

This page is based on the playbook file itself, AFFILIATE-PROGRAM-PLAYBOOK.md, which Moe Ameen wrote from the Kompozy codebase (called BKE in the file). We read the file on November 4, 2026; the facts here come from it, not from independent testing in other codebases.

More growth & seo playbooks

← All 28 Claude templates