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
}Creates a commission override for an affiliate.
Required permissions:
affiliate:createimport 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
}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 ***************************
The affiliate ID.
"aff_xxxxxxxxxxxxxx"
Autogenerated input type of CreateAffiliateOverride
The commission value (percentage 1-100 or flat fee).
6.9
The affiliate ID.
"standard"The plan ID (required for standard overrides).
"plan_xxxxxxxxxxxxx"
Whether commission applies to first payment or all payments (standard only).
first_payment, all_payments The commission type (percentage or flat_fee).
percentage, flat_fee A successful response
A commission configuration for an affiliate, defining payout terms for a specific plan or revenue share
The unique identifier for the affiliate override.
"affov_xxxxxxxxxxxx"
The type of override (standard or rev_share).
standard, rev_share The type of commission (percentage or flat_fee).
percentage, flat_fee The commission amount. A percentage (1-100) when commission_type is percentage, or a dollar amount when flat_fee.
6.9
Whether the commission applies to the first payment only or all payments (standard overrides only).
first_payment, all_payments The plan ID (for standard overrides).
"plan_xxxxxxxxxxxxx"
The product ID (for rev-share overrides).
Whether this rev-share override applies to a single product or all products (rev-share only).
single_product, all_products The revenue calculation basis (pre_fees or post_fees).
pre_fees, post_fees The product page direct link for referrals (standard overrides only).
The checkout direct link for referrals (standard overrides only).
The total earnings paid to this affiliate for referrals to this specific plan, in USD.
6.9
Was this page helpful?