v1

latestOpenAPI 3.0.12026-08-062532117.6 KB

Create an affiliate

Creates an affiliate in your program and gives them their first referral link.

firstName, lastName and email are required; the email must be unique within the program. If you do not send affiliateLink, a slug is generated from the email address. If you do send one and it is already taken, the request fails rather than silently picking another slug.

When commissionRate is omitted the affiliate inherits the program's default rate. When affiliateStatus is omitted, the program's auto-approve setting decides whether the affiliate starts active or pending.

Creating an affiliate also triggers the admin notification email, the affiliate welcome email (active affiliates only, unless sendWelcomeEmail is false), any automatic promo codes, and the affiliate.created webhook.

post/affiliates

Request body

firstNamestring required

First name of the affiliate

lastNamestring required

Last name of the affiliate

emailstring email required

Email of the affiliate

commissionRatenumber float

Commission rate for the affiliate

affiliateLinkstring

Optional slug for the affiliate's first referral link. If omitted, a slug is generated automatically.

affiliateStatus'active' | 'inactive'

Status of the new affiliate. If omitted, the program's auto-approve setting decides whether the affiliate is created active or inactive.

sendWelcomeEmailboolean

Set to false to skip the affiliate welcome email. The welcome email is only sent when the affiliate is created active.

commissionPlanIdstring uuid

Assign the affiliate to a commission plan in this program. Returns 400 if the plan does not exist in this program.

affiliateGroupIdstring uuid

Assign the affiliate to an affiliate group in this program. Returns 400 if the group does not exist, or if commissionPlanId belongs to a different group.

Response

The created affiliate, including its generated affiliateLinks entry.

idstring uuid

The affiliate ID

firstNamestring

First name of the affiliate

lastNamestring

Last name of the affiliate

namestring nullable

Full name of the affiliate (optional)

emailstring email

Email of the affiliate

passwordstring nullable

Hashed Password of the affiliate (optional)

emailVerifiedboolean nullable

Flag to indicate if the email has been verified

imagestring nullable

Profile image URL of the affiliate

detailsCompleteboolean

Flag to indicate if affiliate details are complete

programIdstring uuid

The program ID that the affiliate is associated with

payoutEmailstring email

Email to be used for payouts

paymentMethodstring

Payment method for the affiliate (e.g., WISE)

commissionRatenumber float

Commission rate for the affiliate (0 - 100)

linkstring nullable

Deprecated legacy field and almost always null. Read affiliateLinks instead.

status'ACTIVE' | 'INACTIVE' | 'INVITED' | 'DECLINED' | 'DEACTIVATED' | 'BANNED'

Affiliate status. INACTIVE is shown as Pending in the dashboard and is kept for backwards compatibility.

createdAtstring date-time

Timestamp when the affiliate was created

updatedAtstring date-time

Timestamp when the affiliate was last updated

numberOfReferredUsersinteger

Number of users referred by the affiliate

numberOfClicksinteger

Number of clicks generated by the affiliate

totalCommissionEarnednumber float

Total commission earned by the affiliate

sourcestring nullable

How the affiliate joined. Affiliates created through this API have API.

commissionPlanIdstring uuid nullable

The commission plan assigned to this affiliate, if any

affiliateGroupIdstring uuid nullable

The affiliate group this affiliate belongs to, if any