Building a SaaS affiliate program: what a custom build takes, and when to use RelayWonder
A development shop's breakdown of affiliate program systems: attribution, per-invoice commission, clawbacks, append-only ledgers, cross-border payouts and tax forms, fraud and partner portals. Then how RelayWonder connects, what it costs and where it falls short.
- An affiliate program needs attribution, rules, event handling, a ledger, payouts, fraud controls and a portal.
- Subscription commissions must be calculated on every paid invoice, not just the first checkout.
- Keep the commission ledger append-only: refunds write negative rows and commissions wait out a hold.
- Build your own when checkout is not on Stripe or commission rules need product data.
- RelayWonder is Stripe-only with 0% revenue share; its network is early, so bring your own partners.
Every subscription SaaS or DTC brand selling overseas reaches the point where it wants an affiliate program: bloggers, review sites, newsletter writers and niche creators recommend the product, and they get paid when someone buys. The requirement fits in one sentence. Give each partner a link, and record a commission when a sale comes in. Once you try to build it, though, that sentence turns into attribution, recurring billing, refunds, cross-border payouts, tax forms, fraud and a self-service portal, and each one has its own failure modes. When we take on platform and systems development work, clients often ask whether they should build this themselves or buy it. This article breaks down what a custom build involves from a development shop's point of view, then looks at RelayWonder, a partner network for SaaS and DTC brands: how it connects, what it costs, and what it cannot do yet.
Disclosure: InsightWonder and RelayWonder are run by the same team as this site; this article is based on each product's public pages, and prices and features may change.

What an affiliate program actually is, in system terms
To the business, an affiliate program means finding people to promote you and splitting revenue on sales. To the engineering team, it means at least seven modules that depend on each other. Skip any of them and it comes back after launch as a reconciliation dispute or an angry partner email.
- Attribution: partner links, a landing-page script, cookies and coupon codes, plus a rule for who gets credit when several partners touched the same buyer.
- Commission rules: first-sale bounties, recurring percentages and their duration, tiers and milestones.
- Payment event handling: consuming the payment provider's webhooks and turning purchases, renewals, refunds, disputes and cancellations into commission actions.
- The commission ledger: a full record of every commission from creation to clawback to payout, and the balances derived from it.
- Payouts and tax forms: cross-border batch payments, minimum thresholds, and collecting and storing tax documents.
- Fraud controls: self-referrals, click inflation, suspicious refunds and payout holds.
- The partner portal: sign-up, links and codes, reporting, tax forms and statements.
Where a custom build gets hard
Attribution: cookies get lost, coupon codes fill the gap
The usual approach is a query parameter on the partner link. A script on the landing page reads it, stores it in a cookie, and the checkout passes the partner ID into the payment session. The chain breaks easily. A buyer taps the link inside a social app's built-in browser, then pays on a laptop three days later. Or they clear cookies, or switch browsers. Coupon codes are the backstop because the buyer types the partner's code at checkout and no browser state is needed. Which one wins when they conflict, and whether last touch or first touch gets credit when several partners reached the same buyer, have to be written into the rules and published to partners. Otherwise every dispute becomes a manual judgement call.
With Stripe Checkout, the partner ID typically goes into client_reference_id. According to Stripe's Checkout Session API reference, the field is a unique string you can use to reconcile the session with your internal systems, such as a customer or cart ID, up to 200 characters. It is a reconciliation hook and nothing more. Stripe does not decide who earned the sale or how much they are owed. All of that is yours to build.
Recurring revenue: commission per invoice
Subscription commissions are not one-off events. Common structures include a first-sale bounty, a share of recurring revenue for a set number of months or for life, performance tiers and milestone bonuses. The system has to calculate a commission after every paid renewal invoice, not just once at the first checkout. Upgrades, downgrades, proration, trial conversions and discounted invoices all change what was actually collected, so the commission base has to be the amount paid on each invoice. If it is not, finance will not reconcile at month end.
Webhooks: duplicated and out of order
All of this is driven by events pushed from the payment provider. Stripe's webhook documentation is blunt about it: delivery order is not guaranteed, the same event can arrive more than once, and you should log processed event IDs to skip duplicates. Your handler should verify the signature, return a 2xx quickly and push heavy work onto an asynchronous queue. A lot of homegrown affiliate systems have their first production incident right here, either by double-counting the same invoice or by receiving a refund before the payment it reverses and finding nothing to claw back.
Hold periods and clawbacks
When a buyer refunds or disputes a charge, the commission has to come back. That usually takes two mechanisms. A hold period keeps new commissions pending until the window passes, and only then do they become payable. A clawback writes a negative entry when a refund lands, rather than deleting or editing the original row. Set the hold too short and you have already paid out money you cannot recover. Set it too long and partners lose patience.
An append-only ledger
The commission ledger should be append-only. Every accrual, reversal, manual adjustment and payout is a new row, and balances are the sum of rows. That way any number can be traced back to an invoice, an event and whoever adjusted it, and you can hand a partner a full statement when they question a figure. Updating a balance column in place is quicker to write at first and impossible to audit once something goes wrong.
Cross-border payouts and tax forms
Partners are spread across countries and are usually paid through PayPal or Wise. Batch payouts mean generating files in each provider's format and dealing with minimum thresholds, currencies and failed payments. For brands selling into the US, tax forms come with the territory. The IRS describes Form W-9 as the way to give the party filing an information return your correct taxpayer identification number, and Form W-8BEN as the form a foreign individual who is the beneficial owner of the income gives to the payer when asked. You need collection, expiry reminders, encrypted storage and access logging, because this is sensitive personal data. Whether and which year-end information returns you must file depends on your entity, so ask your own tax adviser.
Fraud
Affiliate programs attract abuse by design. Partners buy through their own links to earn commission, inflate clicks, or watch their codes get reposted on coupon aggregators that then steal credit from other partners. Some buy, collect, and refund. At minimum you need self-referral blocking, click anomaly flags and the ability to hold payouts for risky partners.
The partner portal and disclosure
Partners need a self-service portal for signing up, getting links and codes, seeing clicks and earnings, submitting tax forms and downloading statements. It works best on the brand's own subdomain, where partners are more likely to trust it. One compliance point is often missed. The FTC expects endorsers to disclose their relationship with the brand clearly, and the FTC's endorsement guides Q&A says a label such as "paid link" placed right next to an affiliate link is an adequate disclosure. Your program terms should require it, and the portal should remind partners.
Add up all seven modules and a custom affiliate system you would trust in production is usually measured in months, depending on how complex your commission rules are, how many payout rails you support and how polished the portal needs to be. After launch someone still has to maintain event handling, reconciliation and partner support.
When building your own makes sense
An off-the-shelf platform saves you the generic parts. In these situations the generic parts do not fit, and a custom build is the better call:
- Your checkout is not on Stripe, for example a custom checkout, Paddle, WooCommerce, or WeChat Pay and Alipay for buyers in mainland China. A Stripe-based platform cannot plug in, so you build or you wait.
- Commission rules depend on product data, such as seats, usage or customer segment, which lives outside the payment provider.
- Referral payouts are a feature of your own product, for example rewarding your users for bringing in other users, so the data and money flow must stay inside your system.
- Compliance or procurement requires that data stays in your own systems, or requires a vendor with full contracts and privacy terms in place.
In those cases each of the seven modules needs its own design, the boundaries between them should be defined as API contracts, event handling should always run through a queue and the ledger should stay append-only. There is no shortcut for this kind of build, but clear module boundaries mean a rule change later does not ripple through everything.
When to use a platform instead: what RelayWonder covers
If you check out on Stripe and your rules follow common subscription patterns, most of a custom build is reinventing things that already exist. RelayWonder is a partner network for SaaS and DTC brands that runs affiliate, creator and publisher programs from one account. Its platform page describes five stages: recruit, activate, track, commission and optimize. Several of its design choices map directly onto the hard parts above:
- Tracking is tied to Stripe invoices, so renewals earn commission per invoice. Last touch is the default and first touch is optional, and the site states that coupon codes beat cookies.
- The ledger is append-only. Refunds write a negative row, with hold periods and clawbacks built in.
- Payouts run monthly as PayPal Payouts or a Wise batch CSV from the brand's own account. The platform never holds the money.
- Commission options include recurring percentages for a set number of months or for life, first-sale bounties, tiers and milestones.
- Fraud controls include self-referral blocking and click anomaly flags, with payout holds on the Scale plan.
- Partners keep one account and one balance across every brand, and there is a public program marketplace.
To estimate commission costs before you commit, try its commission calculator. For setting recurring rates and durations there is a guide to subscription commission structures, and the end-to-end process is in how to start a SaaS affiliate program. Payout rails and W-9 or W-8BEN handling are covered in the guide to affiliate payouts, PayPal, Wise and tax forms.
Installation: one script and two settings
According to the install docs, setup has three steps:
- Add a script tag to your site so that visitors arriving through a partner link get an rw_ref recorded.
- Pass rw_ref as client_reference_id when you create the Stripe Checkout Session.
- Authorise Stripe Connect to link the brand's Stripe account.
The site says a developer adds one line in about ten minutes. One note from the development side: how long it really takes depends on your existing checkout code. If your backend creates the Checkout Session, the rw_ref read in the browser has to reach that backend call. If checkout does not run through your own code at all, check first that the field can be passed in. To test, append ?via=test to a link and run through a purchase.
Once connected, it listens for five Stripe events:
- checkout.session.completed, for the first purchase.
- invoice.paid, which drives recurring commission.
- charge.refunded, which triggers a clawback.
- charge.dispute.created, for disputes.
- customer.subscription.deleted, for cancellations.
The reasoning behind attributing on invoices rather than on checkout is laid out in a post on Stripe invoice attribution, which is worth reading even if you end up building your own.

White-label portal, tracking domain and API boundaries
The partner portal can be white-labelled at partner.yourbrand.com with a single CNAME and automatic HTTPS. A custom tracking domain such as go.yourbrand.com sets the rw_ref cookie on your root domain. Partners see your domain, and the tracking cookie lives on your domain too. For common approaches to DNS and multi-site setups, see our cross-border growth solutions.
For developers, the permission model matters more. RelayWonder offers an MCP endpoint and a REST API with scoped keys: read, campaigns and invite. Approving payouts, changing bank details, adding team members and rotating keys are not exposed as tools, and the site says they never will be. In practice that means an AI agent can recruit partners, draft briefs and send invitations, but anything touching money or account access has to be done by a person in the dashboard. Details are in the post on the MCP endpoint for agents.
Hunter, the AI recruiting tool, mines YouTube, blogs, newsletters, Reddit and competitors' affiliate footprints for prospects. Each one gets an A, B or C grade, a score from 0 to 100, a written reason and a risk flag. It is capped at 150 prospects per rolling seven days, only lists prospects with a public business email, and does not check audiences on Instagram or TikTok. Hunter is available on Scale and above only.
Content campaigns are the other notable feature. Briefs are generated from gaps in AI search answers, partners earn a bounty per delivered piece on top of sales commission, and content URLs are tracked through to the sale. On Scale, the AI search gaps come from InsightWonder and delivered content gets AI citation tracking.
Pricing and defaults
The pricing page states 0% of affiliate revenue on every plan, and partners are always free:
- Free at $0, for up to $1,000 a month in affiliate revenue: one program, unlimited partners, link and coupon tracking on Stripe, a monthly PayPal or Wise payout file, a marketplace page, and statements and tax forms.
- Growth at $49 a month, for up to $10,000 a month: unlimited programs and team members, content campaigns with bounties, partner invitations and outreach drafts.
- Scale at $129 a month, for up to $50,000 a month: AI search gaps from InsightWonder, AI citation tracking on delivered content, the MCP endpoint and API keys, click-fraud checks with payout holds, and Hunter.
- Enterprise, priced on request.
Yearly billing gives two months free. The defaults are a 60-day cookie, a 30-day hold and a $50 minimum payout.

For alternatives, the comparison pages date every competitor price they quote: Rewardful and FirstPromoter from $49 (checked 2026-09-18), Partnero from $59 a month with no free plan (2026-09-19), and PartnerStack quote-based (2026-09-26). The Partnero page also concedes that if you need web discovery this week, Partnero already has it running.
Current limits to check before you commit
- Stripe only. Shopify is marked as coming soon, and WooCommerce, Paddle and custom checkouts are not supported yet. In those cases, build your own or wait.
- The network is early. The marketplace currently shows two programs and zero affiliates. For now you will be bringing your own partners, so do not count on the platform for traffic.
- There are no About, Terms or Privacy pages yet, and the contact is support@relaywonder.com. If your legal or procurement review is strict, settle the contract terms before you sign.
- The platform does not issue 1099s. That stays with the brand.
- Hunter is limited to Scale and above, and it does not verify Instagram or TikTok audiences.
- It is built for the US market, with W-9 and W-8BEN forms and USD pricing. It does not fit businesses selling to mainland China buyers through WeChat Pay or Alipay.
There is also a post on what they are not building: no managed payouts, no Amazon channel, no agency services, no percentage of your commission and no fake activity. When you evaluate a vendor, a list of things it refuses to do is as useful as its feature list.
A decision order you can follow
- Is your checkout on Stripe? If not, build or wait, and the remaining questions do not matter yet.
- Do commission rules need data from outside the payment provider? If so, lean towards building.
- How much affiliate revenue do you expect? Start on Free, run links, coupons, webhooks and a payout file end to end, then decide whether to upgrade.
- Do you need AI recruiting, an API or agents in the loop? Then look at Scale.
- What will legal and procurement require? Until the terms pages exist, confirm contract details by email first.
Whichever route you take, write the program terms before launch: commission rate and duration, attribution rules, hold period, refund clawbacks, payout threshold and disclosure requirements. RelayWonder has a program terms generator that outputs English and Chinese, though the site notes it has not been legally reviewed, so have a lawyer check it before use.
If you decide to build, or your checkout is not on Stripe and you need custom integration with existing order and membership systems, our engagement process starts with a requirements pass that pins down commission rules, event handling and the ledger structure before any code is written.
FAQ
How much code does RelayWonder need?
According to its install docs, three steps: add a script tag, pass rw_ref as client_reference_id when creating the Stripe Checkout Session, and authorise Stripe Connect. The site estimates about ten minutes. If your backend creates the session, you also need to forward the rw_ref read in the browser to that backend call, so the real time depends on your existing checkout code.
Can I use RelayWonder without Stripe?
Not yet. The site says only Stripe is live. Shopify is marked as coming soon, and WooCommerce, Paddle and custom checkouts are not supported. If you are on one of those, you either build your own affiliate system or wait for support. Businesses selling to mainland China through WeChat Pay or Alipay are also outside its scope.
What usually breaks first in a homegrown affiliate system?
Event handling and the ledger. Stripe webhooks can arrive more than once and out of order, so without deduplicating on event IDs you will double-count commissions. If refunds edit the original row instead of writing a negative entry, you cannot trace what happened when a partner disputes a figure. Keep the ledger append-only and pay commissions only after a hold period.
Sources
- Create a Checkout Session · Stripe Docs
- Receive Stripe events in your webhook endpoint · Stripe Docs
- About Form W-9, Request for Taxpayer Identification Number and Certification · Internal Revenue Service
- About Form W-8 BEN, Certificate of Foreign Status of Beneficial Owner (Individuals) · Internal Revenue Service
- FTC's Endorsement Guides: What People Are Asking · Federal Trade Commission