Docs Affiliate Programs

Affiliate Programs

Launch a powerful affiliate program to grow your sales. stryhub supports flexible commissions with automatic payouts via Stripe Express — no manual tracking or payments needed.

Overview

The affiliate system in stryhub allows you to recruit partners who promote your products in exchange for commissions. When a customer purchases through an affiliate's unique link, the affiliate earns a percentage of the sale.

Key features:

Creating an Affiliate Program

To create an affiliate program:

  1. In the admin dashboard, go to Affiliate Program
  2. Click Create Program (or configure the existing one)
  3. Set your program details:
    • Program name: Displayed to affiliates during registration
    • Commission rates: Set default percentage and customize per product
    • Cookie duration: How long referral cookies last (default: 30 days)
  4. Save and activate the program
Tip: Start with competitive rates (15-30%) to attract affiliates. You can always adjust rates later without affecting existing commissions.

Commission Structure

stryhub supports a flexible commission structure with three levels of configuration:

Level Description Example Rate
Program Default Base commission rate applied to all products and affiliates 20%
Per Product Override the default rate for specific products or prices 15%
Per Affiliate Set custom rates for individual affiliates on specific products 25%

The most specific rate always wins: if an affiliate has a custom rate for a product, that rate is used. Otherwise, the product rate applies. If neither is set, the program default is used.

You can also choose the commission type:

Automatic calculation: stryhub calculates commissions automatically on every sale. No manual tracking needed.

Affiliate Registration

Affiliates can register through a dedicated signup page linked to your program. The registration process:

  1. Share your affiliate registration link with potential partners
  2. Affiliates create an account with their email and details
  3. They connect a Stripe Express account for receiving payouts
  4. Once approved, they receive their unique referral link

As an admin, you can manage affiliates from the dashboard:

Referral Tracking

When a customer clicks an affiliate's referral link, stryhub:

  1. Sets a first-party cookie in the customer's browser
  2. The cookie stores the affiliate ID and persists for the configured duration (default: 30 days)
  3. When the customer completes a checkout, the cookie is read to attribute the sale
  4. Commissions are calculated automatically for every sale
Cookie duration: If a customer clicks multiple affiliate links, the last click determines attribution. Ensure your cookie duration is reasonable for your sales cycle.

Affiliate Dashboard

Each affiliate has access to a dedicated dashboard showing:

Payouts

stryhub handles affiliate payouts automatically through Stripe Express. No manual work is required — commissions are calculated and transferred in real-time.

How payouts work

  1. A customer purchases through an affiliate's referral link
  2. Stripe processes the payment and the commission is calculated automatically
  3. The commission is transferred directly to the affiliate's Stripe Express account via stripe.transfers.create()
  4. The transfer is linked to the original charge (source_transaction), so Stripe releases the funds only when the payment clears (2–30 days depending on payment method)
  5. The affiliate receives the funds in their bank account through Stripe's standard payout schedule

How the money flows

Here's what happens when a customer pays $100 through an affiliate link (example with 20% commission):

Deduction Amount Who receives
Stripe processing fee (2.9% + $0.30) $3.20 Stripe
stryhub platform fee (5%) $5.00 stryhub
Transfer fee (0.25% + $0.25) $0.50 Covers Stripe Connect payout cost
Affiliate commission (20%) $20.00 Affiliate (via Stripe Express)
Net amount $71.50 Program owner (you)
Note: The stryhub platform fee and the transfer fee are included in the application_fee at checkout time. The program owner receives the net amount directly in their Stripe account — no manual calculations needed.

Stripe Express for affiliates

Stripe Express provides affiliates with:

Fees & Costs

There are three separate fees involved when affiliates receive payouts. Understanding each one ensures full transparency.

1. stryhub platform fee — 5% per transaction

This is stryhub's fee, charged on every transaction processed through the platform. It is deducted automatically at checkout time via the Stripe application_fee. There are no monthly fees or subscription plans — you only pay when you earn.

2. Stripe payment processing fees

These are Stripe's own fees for processing credit cards and other payment methods. They are completely separate from stryhub's fee and are set by Stripe:

For current rates, see Stripe Pricing.

3. Stripe Connect fees (affiliate payouts)

Stripe charges additional fees for transferring money to affiliate Express accounts:

Fee Amount How it's handled
Per-payout fee 0.25% + $0.25 Already included in the transaction's application_fee at checkout. No action needed.
Active account fee $2.00/month per active Express account Deducted from the affiliate's first commission transfer of each month. Visible in both admin and affiliate dashboards.
Instant payouts (optional) 1.5% (min $0.50) Only if the affiliate chooses instant payout to a debit card.
$2/month active account fee: Stripe considers an Express account "active" in any month where a payout is sent. This $2 fee is passed through by deducting it from the first affiliate commission of that calendar month. For example, if an affiliate earns a $50 commission and it's the first payout of the month, they receive $48. All subsequent commissions within the same month are transferred in full.

For full details on Stripe Connect pricing, see Stripe Connect Pricing. For stryhub's complete fee policy, see our Terms of Service (Section 5).

Testing Your Affiliate Setup

Before going live, you should verify that your program, affiliate links and the full payment flow are working correctly. Here's a step-by-step checklist:

1. Verify the affiliate link is tracking

  1. In your admin panel, go to Programs and note a test affiliate's ref_code
  2. Open an incognito/private browser window (to avoid cached cookies)
  3. Visit a product page or checkout link appending the ref code: https://your-site.com?ref=AFFILIATE_CODE
  4. Open the browser's DevTools (F12) → Application → Cookies
  5. You should see a cookie named affiliate_ref with the affiliate's code and an expiration date matching your cookie duration (default: 30 days)
How tracking works: The tracking script (tracking.js) reads the ?ref= URL parameter and sets a first-party cookie. On checkout, stryhub reads this cookie and attributes the sale to that affiliate. Last-click attribution is used — if the customer clicks a different affiliate's link later, the cookie is overwritten.

2. Make a test purchase

  1. With the affiliate_ref cookie active (from step 1), proceed to checkout using a product's Payment Link
  2. If in Stripe test mode, use the card 4242 4242 4242 4242 with any future expiry date
  3. Complete the payment

3. Verify in the admin panel

After the purchase, check three places in your stryhub admin dashboard:

Where to checkWhat you should see
Dashboard → Recent Commissions A new commission entry with the affiliate's name, the invoice amount, the commission amount, and the platform fee
Affiliates → click the affiliate A new referral with status "active" linked to the customer's email and the subscription
Transactions A new transaction with status "succeeded", showing gross amount, platform fee, Stripe fee, and net amount
Webhooks → Logs Outgoing webhook deliveries with status 200 (if you configured a webhook endpoint)

4. Verify affiliate sees their commission

  1. Log in as the test affiliate (or have them log in)
  2. In the affiliate dashboard, they should see:
    • Updated total earnings
    • The new referral in Referrals with status "active"
    • A new entry in Commissions with the correct amount and status (pending or approved, depending on your approval mode)

5. Verify automatic payout (if using Stripe Express)

If the affiliate has connected their Stripe Express account and your program has stripe_express_enabled = true:

  1. After the commission is approved (automatic or manual), a Stripe Transfer is created automatically
  2. In your Stripe Dashboard → Connect → Transfers, you should see the transfer to the affiliate's Express account
  3. The affiliate sees the payout in their Stripe Express dashboard
All working? If you see the commission in the admin panel, the referral linked to the affiliate, the webhook delivered with status 200, and the Stripe Transfer created — your affiliate program is fully operational. You can start inviting real affiliates to promote your products.

Troubleshooting

IssueLikely causeFix
Cookie affiliate_ref not appearing Tracking script not loaded on the page Ensure tracking.js is embedded on your site. Check the browser console for errors.
Purchase completed but no commission created Cookie was cleared or expired before checkout Ensure the cookie duration is long enough (default 30 days). The customer must have the affiliate_ref cookie at the time of checkout.
Commission created but with wrong amount Commission tier not configured correctly Check: affiliate-level override → product-level commission → program default commission. The most specific tier takes priority.
Transfer not created (commission stays pending) Affiliate hasn't connected Stripe Express, or Express onboarding is incomplete The affiliate needs to complete Stripe Express onboarding. Check the affiliate's stripe_onboarded status in the admin panel.
Webhook not delivered Endpoint URL is wrong or returned a non-2xx status Check Webhooks → Logs for delivery attempts and error codes. The signing secret must match what your application expects.