Skip to main content
GET
/
affiliates
/
{id}
JavaScript
import Whop from '@whop/sdk';

const client = new Whop({
  apiKey: process.env['WHOP_API_KEY'], // This is the default and can be omitted
});

const affiliate = await client.affiliates.retrieve('aff_xxxxxxxxxxxxxx');

console.log(affiliate.id);
{
  "id": "aff_xxxxxxxxxxxxxx",
  "status": "active",
  "created_at": "2023-12-01T05:00:00.401Z",
  "updated_at": "2023-12-01T05:00:00.401Z",
  "total_referrals_count": 42,
  "total_referral_earnings_usd": "<string>",
  "total_overrides_count": 42,
  "customer_retention_rate": "<string>",
  "customer_retention_rate_ninety_days": "<string>",
  "monthly_recurring_revenue_usd": "<string>",
  "total_revenue_usd": "<string>",
  "active_members_count": 42,
  "user": {
    "id": "user_xxxxxxxxxxxxx",
    "name": "Jane Smith",
    "username": "janesmith"
  },
  "company": {
    "id": "biz_xxxxxxxxxxxxxx",
    "title": "<string>"
  }
}

Authorizations

Authorization
string
header
required

A company API key, company scoped JWT, app API key, or user OAuth token. You must prepend your key/token with the word 'Bearer', which will look like Bearer ***************************

Path Parameters

id
string
required

The unique identifier of the affiliate.

Example:

"aff_xxxxxxxxxxxxxx"

Response

A successful response

An affiliate of a company or a global affiliate

id
string
required

The unique identifier for the affiliate.

Example:

"aff_xxxxxxxxxxxxxx"

status
enum<string> | null
required

The status of the affiliate

Available options:
active,
archived,
deleted
created_at
string<date-time>
required

The datetime the affiliate was created.

Example:

"2023-12-01T05:00:00.401Z"

updated_at
string<date-time>
required

The datetime the affiliate was last updated.

Example:

"2023-12-01T05:00:00.401Z"

total_referrals_count
integer
required

The total referrals of the affiliate

Example:

42

total_referral_earnings_usd
string
required

The total earnings of the affiliate from the users they referred

total_overrides_count
integer
required

The total count of all overrides for this affiliate

Example:

42

customer_retention_rate
string
required

How many referrals have remained since they joined as members

customer_retention_rate_ninety_days
string
required

A rolling 90-day retention rate for this affiliate

monthly_recurring_revenue_usd
string
required

The total MRR of the affiliate

total_revenue_usd
string
required

The total revenue of the affiliate from their referrals

active_members_count
integer
required

The total active members of the affiliate

Example:

42

user
object
required

The user attached to this affiliate

company
object
required

The company attached to this affiliate