Skip to main content
POST
/
affiliates
/
{id}
/
overrides
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 override = await client.affiliates.overrides.create('aff_xxxxxxxxxxxxxx', {
  id: 'id',
  commission_value: 6.9,
  override_type: 'standard',
  plan_id: 'plan_xxxxxxxxxxxxx',
});

console.log(override.id);
{
  "id": "affov_xxxxxxxxxxxx",
  "override_type": "standard",
  "commission_type": "percentage",
  "commission_value": 6.9,
  "applies_to_payments": "first_payment",
  "plan_id": "plan_xxxxxxxxxxxxx",
  "product_id": "<string>",
  "applies_to_products": "single_product",
  "revenue_basis": "pre_fees",
  "product_direct_link": "<string>",
  "checkout_direct_link": "<string>",
  "total_referral_earnings_usd": 6.9
}

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 affiliate ID.

Example:

"aff_xxxxxxxxxxxxxx"

Body

application/json

Autogenerated input type of CreateAffiliateOverride

commission_value
number
required

The commission value (percentage 1-100 or flat fee).

Example:

6.9

id
string
required

The affiliate ID.

override_type
string
required
Allowed value: "standard"
plan_id
string
required

The plan ID (required for standard overrides).

Example:

"plan_xxxxxxxxxxxxx"

applies_to_payments
enum<string> | null

Whether commission applies to first payment or all payments (standard only).

Available options:
first_payment,
all_payments
commission_type
enum<string> | null

The commission type (percentage or flat_fee).

Available options:
percentage,
flat_fee

Response

A successful response

An object storing information about the affiliate

id
string
required

The unique identifier for the affiliate override.

Example:

"affov_xxxxxxxxxxxx"

override_type
enum<string>
required

The type of override (standard or rev_share).

Available options:
standard,
rev_share
commission_type
enum<string>
required

The type of commission (percentage or flat_fee).

Available options:
percentage,
flat_fee
commission_value
number
required

The commission value (percentage 1-100 or flat fee in dollars).

Example:

6.9

applies_to_payments
enum<string> | null
required

Whether the commission applies to the first payment only or all payments (standard overrides only).

Available options:
first_payment,
all_payments
plan_id
string | null
required

The plan ID (for standard overrides).

Example:

"plan_xxxxxxxxxxxxx"

product_id
string | null
required

The product ID (for rev-share overrides).

applies_to_products
enum<string> | null
required

Whether this rev-share override applies to a single product or all products (rev-share only).

Available options:
single_product,
all_products
revenue_basis
enum<string> | null
required

The revenue calculation basis (pre_fees or post_fees).

Available options:
pre_fees,
post_fees

The product page direct link for referrals (standard overrides only).

The checkout direct link for referrals (standard overrides only).

total_referral_earnings_usd
number
required

The total earnings paid to this affiliate for referrals to this specific plan, in USD.

Example:

6.9