Getting started
Getting started
The Rezfiliate Affiliate API lets your backend manage your affiliate program end to end: onboard affiliates, issue their discount codes, read their dashboards, analytics and payouts, submit applications, run Stripe Express onboarding for them, and re-send verification emails.
Every request is authenticated with a program-scoped API key and runs as you, the program owner — creating an affiliate creates them in your program, and affiliate-scoped routes are performed by you on that affiliate's behalf (typically while onboarding or managing them in your own platform). Authorization failures like "you are not the owner" cannot occur.
- Base URL (production):
https://app.rezfiliate.com - Format: JSON request bodies, JSON responses
- Authentication: see Authentication
Core concepts
The affiliate id is everything. Every affiliate-scoped route addresses the affiliate by affiliateId — the id returned when you create them. There is no lookup-by-email endpoint, so persist it in your own records. See Create an affiliate.
Email verification gates attribution. A brand-new affiliate receives a verification email (link expires after 1 hour). Until it is consumed the affiliate has no referral code, no referral link and no discount code; verifying assigns the referral code immediately. Resend the verification email if the link expired.
Legal terms are enforced on every affiliate action. The affiliate's acceptedAffiliateLegalVersion must match the platform's current version. Fetch it with GET /api/legal-version/affiliate (no API key needed) — it returns { "version": "2026-v1" }. See Create an affiliate.
Sandbox stores are flagged. Integrations connected to a development/test store carry isSandbox: true (see Get your program), and checkouts they record are test transactions — payouts for them are auto-settled and never funded. Setting the DISABLE_TEST_TRANSACTIONS environment flag on your integration records those checkouts as real instead.
Quickstart
# 1. Create the affiliate (store the returned affiliateId!)
curl -X POST https://app.rezfiliate.com/api/program/affiliate \
-H "X-API-Key: $REZFILIATE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "Jane Doe",
"email": "[email protected]",
"acceptedAffiliateLegalVersion": "2026-v1",
"acceptedAffiliateLegalLanguage": "en"
}'# 2. Read their dashboard — referral link appears once the email is verified
curl "https://app.rezfiliate.com/api/program/affiliate/$AFFILIATE_ID/dashboard" \
-H "X-API-Key: $REZFILIATE_API_KEY"# 3. Create their discount code (the program must track discount codes)
curl -X POST "https://app.rezfiliate.com/api/program/affiliate/$AFFILIATE_ID/discount" \
-H "X-API-Key: $REZFILIATE_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "code": "JANE10" }'# 4. Read their performance
curl "https://app.rezfiliate.com/api/program/affiliate/$AFFILIATE_ID/analytics?metric=clicks&mode=range&start=2026-10-01&end=2026-10-31" \
-H "X-API-Key: $REZFILIATE_API_KEY"For the full flows — applying to programs that require review, payouts, Stripe Express onboarding — follow the endpoint pages below.
Endpoint index
| Endpoint | Page |
|---|---|
GET /api/program — your program's configuration | Get your program |
POST /api/program/visit — record an affiliate-page visit | Record a program visit |
POST /api/program/affiliate — create an affiliate | Create an affiliate |
GET /api/program/affiliate/{id} — full profile | Get an affiliate |
GET /api/program/affiliate/{id}/dashboard — codes, links, settings | Get the affiliate dashboard |
GET /api/program/affiliate/{id}/analytics — time series | Get affiliate analytics |
POST /api/program/affiliate/{id}/apply — submit their application | Apply to the program |
POST /api/program/affiliate/{id}/discount — issue their code | Create a discount code |
DELETE /api/program/affiliate/{id}/discount — revoke their code | Delete a discount code |
GET /api/program/affiliate/{id}/payouts — their payout ledger | List affiliate payouts |
PATCH /api/program/affiliate/{id}/settings — profile updates | Update affiliate settings |
GET/POST /api/program/affiliate/{id}/stripe-onboard — Stripe Express | Get Stripe connection status / Start Stripe onboarding |
POST /api/program/affiliate/{id}/resend-verification — resend the email | Resend the verification email |
Plan features
| Feature | Plan |
|---|---|
| API keys (this whole API) | Scale |
| Discount-code tracking & codes | Growth / Scale |
Affiliate conversions metric | Scale |
mrr / arr metrics | Growth / Scale |
| Automated payouts, custom webhooks, applications | Growth / Scale |
Pagination
List endpoints paginate with page (1-based). List affiliate payouts returns 10 rows per page with a pagination object: { "results": <total>, "pages": <totalPages> }.
Updated about 1 hour ago
