Prerequisites
- A Stripe account (for payment tracking)
- A website where you sell your product (for the tracking script)
Setup
Create your account
Sign up at agentref.co. No credit card required.After signing up, you’ll land on the onboarding flow that walks you through the next steps.
Connect Stripe
Click Connect Stripe in the onboarding flow. You’ll be redirected to Stripe’s OAuth page to authorize AgentRef.AgentRef uses Stripe Connect to:
- Listen for payment events (checkout completions, invoice payments, refunds)
- Match payments to affiliate referrals
- Track subscription renewals for recurring commissions
Create your program
After connecting Stripe, create your first affiliate program. Here are recommended starting settings:
| Setting | Recommendation | Why |
|---|---|---|
| Commission type | recurring | Incentivizes affiliates to refer customers who stick around. |
| Commission rate | 20–30% | Industry standard for SaaS. Competitive enough to attract affiliates. |
| Cookie duration | 30 days | Balances fair attribution with reasonable conversion windows. |
| Payout threshold | $50 | Low enough to keep affiliates motivated, high enough to avoid micro-payouts. |
| Payout frequency | Monthly | Standard cadence. Weekly is fine for high-volume programs. |
| Auto-approve affiliates | Yes | Reduces friction. You can always block bad actors later. |
Install the tracking script
Add the AgentRef tracking script to your website. Place it in your Replace
<head> tag or before the closing </body> tag:YOUR_PROGRAM_ID with the ID shown in your program settings.The script handles:- Capturing affiliate referral codes from URL parameters
- Setting first-party attribution cookies (
agentref_cid,agentref_pid,agentref_src) - Providing
getCheckoutMetadata()for Stripe session integration
client_reference_id.For server-created Checkout Sessions: Pass the metadata to your server:Get your API key
Go to Settings > API Keys in your AgentRef dashboard and create a new key.
- Merchant keys start with
ak_live_and have full access to your programs, affiliates, conversions, and payouts. - Onboarding keys start with
ak_onb_and are limited to setup flows like program creation and Stripe connection.
Verify your setup
After completing the steps above, confirm everything is working:-
Tracking script loaded. Open your website, open browser DevTools, and check the Network tab for a request to
agentref.co/api/tracking/script.js. It should return200. -
Cookies set. Visit your site through a test referral link (create one in the dashboard). Check DevTools > Application > Cookies for
agentref_cidandagentref_pid. - API responds. The API call from Step 6 returns your program data.
- Stripe connected. Your AgentRef dashboard shows the Stripe connection as active.
What’s next
Agent Setup
Connect AgentRef to Claude, Codex, Cursor, OpenClaw, or any AI assistant.
Invite Affiliates
Start recruiting affiliates to your program.
API Reference
Explore the full REST API documentation.