Create an affiliate
Creates (or updates) an affiliate for your program. If the program requires manual review, the affiliate is created as not_applied; otherwise they are instantly approved.
Email verification gates attribution. A brand-new affiliate receives a verification email (link expires after 1 hour). Until the address is verified, the affiliate has no referral code, no referral link, and no discount code — verification assigns the referral code immediately, and you can then create a discount code. Use Resend the verification email if the link expired.
Body
| Field | Type | Required | Notes |
|---|---|---|---|
| name | string | yes | 1–100 characters. |
| string | yes | Valid email; lowercased. | |
| image | string (URL) | no | Avatar image. |
| acceptedAffiliateLegalVersion | string | yes | Legal terms version the affiliate accepted. |
| acceptedAffiliateLegalLanguage | string | yes | "en" or "fr". |
{
"name": "Jane Doe",
"email": "[email protected]",
"image": "https://example.com/jane.png",
"acceptedAffiliateLegalVersion": "2026-v1",
"acceptedAffiliateLegalLanguage": "en"
}Fetching the legal terms version
acceptedAffiliateLegalVersion must exactly match the platform's current affiliate terms version — anything else is rejected. Fetch the current value with:
GET /api/legal-version/affiliate
{ "version": "2026-v1" }No API key is required. Use the returned version verbatim as acceptedAffiliateLegalVersion, and have the affiliate accept that same version of the terms before (or when) you create them — the value is enforced again on every affiliate action.
Responses
201 — created (or 200 when the email already exists and the profile was updated). Returns the full affiliate profile:
{
"name": "Jane Doe",
"email": "[email protected]",
"avatarSrc": "https://example.com/jane.png",
"isEmailVerified": false,
"affiliateId": "abc123",
"conversion_rate": 0,
"conversions": 0,
"clicks": 0,
"revenue": [],
"primarySource": null,
"application": {
"status": "approved",
"hasApplicationMessage": false,
"fullName": null,
"email": null,
"promotionMethod": null,
"description": null
},
"traffic": { "allTime": { "sources": [], "percentages": [] }, "today": { "sources": [], "percentages": [] } }
}Field notes
| Field | Values | Meaning |
|---|---|---|
name | string | The affiliate's name; "Unknown Affiliate" when unset. |
email | string | The account's email; null when the account has none. |
avatarSrc | string | The affiliate's avatar, or the platform default avatar when unset. |
isEmailVerified | boolean | false for a brand-new affiliate — it flips to true when the emailed verification link is consumed. Attribution (referral code) unlocks at that point. |
affiliateId | string | The affiliate's permanent Rezfiliate id. Store it — every affiliate action (discount code, dashboard, analytics, payouts, apply, Stripe onboarding, resend verification) addresses the affiliate by this id, and there is no lookup-by-email endpoint. |
clicks | number | Total tracked clicks; always 0 at creation. |
revenue | { amount, currency }[] | One entry per currency the affiliate has earned; always [] at creation. amount is in the currency's smallest unit. |
application.status | not_applied | approved | not_applied when the program requires manual review (they apply later), approved when affiliates join automatically. Later values: pending after they apply, declined if rejected. |
application.hasApplicationMessage | boolean | true once any application exists. |
application.fullName / .email / .promotionMethod / .description | string | null | The structured application details; all null until the affiliate applies. promotionMethod is one of website_blog, youtube, tiktok, instagram, x_twitter, newsletter_email, paid_advertising, community_forum. |
conversion_rate | number | Conversions per 10,000 clicks — 0 at creation. Scale plan only; omitted otherwise. |
conversions | number | Total attributed conversions — 0 at creation. Scale plan only; omitted otherwise. |
primarySource | string | null | Top traffic source; null at creation. Scale plan only; omitted otherwise. |
traffic | object | null | Zero-filled all-time/today traffic at creation. Scale plan only; null otherwise. |
On plans without Scale,
conversion_rate,conversionsandprimarySourceare omitted andtrafficisnull.
Store the
affiliateId. It is the permanent identifier for every affiliate-scoped operation in the API — creating their discount code, reading their dashboard, analytics and payouts, submitting/updating their application, Stripe onboarding, and resending their verification email all address the affiliate by this id. There is no lookup-by-email endpoint, so persist it alongside your own user record when you create (or first fetch) the affiliate.
Errors — all { "error": "<message>" }:
| Status | error values |
|---|---|
| 400 | A field-specific validation message (name length, email format, legal language, …) · Please use a trusted email address. (disposable or unresolvable email domain) |
| 403 | This affiliate program is not online. · The affiliate must accept the current affiliate legal terms. · This email already has an account. Verify the email address, then retry affiliate creation. (an unverified account holds that email — a verification email was sent, valid 1 hour) |
| 410 | This program has been terminated. |
| 503 | Email verification is required, but the verification email could not be sent. Please retry. · The affiliate was created, but the verification email could not be sent. Retry this request to send another link. |
