JavaScript
import Whop from '@whop/sdk';
const client = new Whop({
apiKey: process.env['WHOP_API_KEY'], // This is the default and can be omitted
});
// Automatically fetches more pages as needed.
for await (const overrideListResponse of client.affiliates.overrides.list('aff_xxxxxxxxxxxxxx')) {
console.log(overrideListResponse.id);
}curl --request GET \
--url https://api.whop.com/api/v1/affiliates/{id}/overrides \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.whop.com/api/v1/affiliates/{id}/overrides"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.whop.com/api/v1/affiliates/{id}/overrides",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.whop.com/api/v1/affiliates/{id}/overrides"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.whop.com/api/v1/affiliates/{id}/overrides")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.whop.com/api/v1/affiliates/{id}/overrides")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"data": [
{
"applies_to_payments": "first_payment",
"applies_to_products": "single_product",
"checkout_direct_link": "<string>",
"commission_type": "percentage",
"commission_value": 6.9,
"id": "affov_xxxxxxxxxxxx",
"override_type": "standard",
"plan_id": "plan_xxxxxxxxxxxxx",
"product_direct_link": "<string>",
"product_id": "<string>",
"revenue_basis": "pre_fees",
"total_referral_earnings_usd": 6.9
}
],
"page_info": {
"end_cursor": "<string>",
"has_next_page": true,
"has_previous_page": true,
"start_cursor": "<string>"
}
}{
"error": {
"code": "parameter_missing",
"message": "Missing required parameter: amount.",
"param": "amount",
"type": "invalid_request_error"
}
}{
"error": {
"message": "Invalid or missing API key",
"type": "unauthorized"
}
}{
"error": {
"message": "You do not have permission to access this resource",
"type": "forbidden"
}
}{
"error": {
"message": "Resource not found",
"type": "not_found"
}
}{
"error": null
}{
"error": null
}{
"error": {
"message": "An unexpected error occurred",
"type": "internal_server_error"
}
}Affiliates
List overrides
Returns a paginated list of overrides for an affiliate.
Required permissions:
affiliate:basic:read
GET
/
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
});
// Automatically fetches more pages as needed.
for await (const overrideListResponse of client.affiliates.overrides.list('aff_xxxxxxxxxxxxxx')) {
console.log(overrideListResponse.id);
}curl --request GET \
--url https://api.whop.com/api/v1/affiliates/{id}/overrides \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.whop.com/api/v1/affiliates/{id}/overrides"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.whop.com/api/v1/affiliates/{id}/overrides",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.whop.com/api/v1/affiliates/{id}/overrides"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.whop.com/api/v1/affiliates/{id}/overrides")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.whop.com/api/v1/affiliates/{id}/overrides")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"data": [
{
"applies_to_payments": "first_payment",
"applies_to_products": "single_product",
"checkout_direct_link": "<string>",
"commission_type": "percentage",
"commission_value": 6.9,
"id": "affov_xxxxxxxxxxxx",
"override_type": "standard",
"plan_id": "plan_xxxxxxxxxxxxx",
"product_direct_link": "<string>",
"product_id": "<string>",
"revenue_basis": "pre_fees",
"total_referral_earnings_usd": 6.9
}
],
"page_info": {
"end_cursor": "<string>",
"has_next_page": true,
"has_previous_page": true,
"start_cursor": "<string>"
}
}{
"error": {
"code": "parameter_missing",
"message": "Missing required parameter: amount.",
"param": "amount",
"type": "invalid_request_error"
}
}{
"error": {
"message": "Invalid or missing API key",
"type": "unauthorized"
}
}{
"error": {
"message": "You do not have permission to access this resource",
"type": "forbidden"
}
}{
"error": {
"message": "Resource not found",
"type": "not_found"
}
}{
"error": null
}{
"error": null
}{
"error": {
"message": "An unexpected error occurred",
"type": "internal_server_error"
}
}Authorizations
An Account API key, account-scoped JWT, App API key, or user OAuth token. Prepend the key or token with Bearer, for example Bearer ***************************.
Path Parameters
The affiliate ID.
Example:
"aff_xxxxxxxxxxxxxx"
Query Parameters
Returns the elements in the list that come after the specified cursor.
Returns the elements in the list that come before the specified cursor.
Returns the first n elements from the list.
Example:
42
Returns the last n elements from the list.
Example:
42
Filter by override type (standard or rev_share).
Available options:
standard, rev_share ⌘I

