---
title: "Create affiliate"
method: POST
path: "/affiliates"
tags: ["Affiliates"]
---

# Create affiliate

`POST /affiliates`

Creates or finds an affiliate for a company and user.

Required permissions:
 - `affiliate:create`

## Request body

- object — Parameters for CreateAffiliateRecord
  - `company_id` string, required — The ID of the company to create the affiliate for.
  - `user_identifier` string, required — The user identifier (username, email, user ID, or Discord ID).

## Response `200`

A successful response

- Affiliate — An affiliate tracks a user's referral performance and commission earnings for a company, including retention rates, revenue metrics, and payout configurations.
  - `active_members_count` integer, required — The total active members of the affiliate
  - `company` object, required — The company attached to this affiliate
    - `id` string, required — The unique identifier for the company.
    - `title` string, required — The written name of the company.
  - `created_at` string, date-time, required — The datetime the affiliate was created.
  - `customer_retention_rate` string, required — The percentage of referred customers who are still active members
  - `customer_retention_rate_ninety_days` string, required — The percentage of referred customers who remained active over the last 90 days
  - `id` string, required — The unique identifier for the affiliate.
  - `monthly_recurring_revenue_usd` string, required — The monthly recurring revenue generated by this affiliate's referrals, formatted as a USD currency string
  - `status` 'active' | 'archived' | 'deleted', required — Statuses for resources
  - `total_overrides_count` integer, required — The total count of all overrides for this affiliate
  - `total_referral_earnings_usd` string, required — The total commission earnings paid to this affiliate, formatted as a USD currency string
  - `total_referrals_count` integer, required — The total referrals of the affiliate
  - `total_revenue_usd` string, required — The total revenue generated from this affiliate's referrals, formatted as a USD currency string
  - `updated_at` string, date-time, required — The datetime the affiliate was last updated.
  - `user` object, required — The user attached to this affiliate
    - `id` string, required — The unique identifier for the user.
    - `name` string, nullable, required — The display name set on the user's Whop profile. Null if the user has not set a name.
    - `username` string, nullable, required — The unique username chosen by the user for their Whop profile. Null if the user has not set a username.

## Other responses

- `400` — Bad request
- `401` — Unauthorized
- `403` — Forbidden
- `404` — Not found
- `422` — Verification required
- `429` — Too many requests
- `500` — Internal server error

---

[API](https://skmtc.net/whop/apis/whop-api.md) · [All operations](https://skmtc.net/whop/apis/whop-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/whop/whop-api/versions/866821546d67/schema)
