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

EndpointPage
GET /api/program — your program's configurationGet your program
POST /api/program/visit — record an affiliate-page visitRecord a program visit
POST /api/program/affiliate — create an affiliateCreate an affiliate
GET /api/program/affiliate/{id} — full profileGet an affiliate
GET /api/program/affiliate/{id}/dashboard — codes, links, settingsGet the affiliate dashboard
GET /api/program/affiliate/{id}/analytics — time seriesGet affiliate analytics
POST /api/program/affiliate/{id}/apply — submit their applicationApply to the program
POST /api/program/affiliate/{id}/discount — issue their codeCreate a discount code
DELETE /api/program/affiliate/{id}/discount — revoke their codeDelete a discount code
GET /api/program/affiliate/{id}/payouts — their payout ledgerList affiliate payouts
PATCH /api/program/affiliate/{id}/settings — profile updatesUpdate affiliate settings
GET/POST /api/program/affiliate/{id}/stripe-onboard — Stripe ExpressGet Stripe connection status / Start Stripe onboarding
POST /api/program/affiliate/{id}/resend-verification — resend the emailResend the verification email

Plan features

FeaturePlan
API keys (this whole API)Scale
Discount-code tracking & codesGrowth / Scale
Affiliate conversions metricScale
mrr / arr metricsGrowth / Scale
Automated payouts, custom webhooks, applicationsGrowth / 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> }.


Did this page help you?