Create affiliate
Changed onCreates an affiliate for a user on an account. If the user is already an affiliate of the account, returns that affiliate, reactivating it if it was archived.
Required permissions:
- affiliate:create
Request
- Base URLhttps://api.whop.com/api/v1
- AuthHTTP bearer
Request body
Parameters for CreateAffiliateRecord
The ID of the company to create the affiliate for.
The user identifier (username, email, user ID, or Discord ID).
Example request
{
"account_id": "biz_xxxxxxxxxxxxxx"
}Response
A successful response
An affiliate tracks a user's referral performance and commission earnings for a company, including retention rates, revenue metrics, and payout configurations.
The total active members of the affiliate
The company attached to this affiliate
The datetime the affiliate was created.
The percentage of referred customers who are still active members
The percentage of referred customers who remained active over the last 90 days
The unique identifier for the affiliate.
The monthly recurring revenue generated by this affiliate's referrals, formatted as a USD currency string
Statuses for resources
The total count of all overrides for this affiliate
The total commission earnings paid to this affiliate, formatted as a USD currency string
The total referrals of the affiliate
The total revenue generated from this affiliate's referrals, formatted as a USD currency string
The datetime the affiliate was last updated.
The user attached to this affiliate
Example response
{
"active_members_count": 42,
"company": {
"id": "biz_xxxxxxxxxxxxxx"
},
"created_at": "2023-12-01T05:00:00.401Z",
"id": "aff_xxxxxxxxxxxxxx",
"total_overrides_count": 42,
"total_referrals_count": 42,
"updated_at": "2023-12-01T05:00:00.401Z",
"user": {
"id": "user_xxxxxxxxxxxxx",
"name": "Dana Whitfield",
"username": "danawhitfield"
}
}Changes
- breaking
added the new required request property
account_id - warning
removed the request property
company_id
- breaking
- info
added the non-success response with the status
- info