Update commission plans
curl --request PATCH \
--url https://www.referly.so/api/v1/commission-plans/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"commissionRate": 0,
"commissionType": "PERCENTAGE",
"numberOfPayments": 0,
"numberOfMonths": 0,
"creditAmount": 500000000,
"creditFlatPerPurchase": 500000000,
"creditPerCurrencyUnit": 500000000,
"nonCashCouponId": "<string>",
"nonCashPurchaseCount": 500000,
"nonCashPurchaseMonthLimit": 500000,
"baseCondition": "ALL",
"paymentTrigger": "PURCHASE",
"isActive": true,
"rewardType": "CASH",
"nonCashRewardType": null,
"nonCashTrigger": null,
"nonCashSignupsRequired": 500000,
"nonCashMaxCoupons": 500000,
"creditUnit": "<string>",
"creditMaxTimes": 500000,
"creditPurchaseLimit": 500000,
"creditPurchaseMonthLimit": 500000,
"autoApproveAffiliates": true,
"autoApproveRewards": true,
"ruleGroups": [],
"amounts": [],
"afterPeriods": []
}
'import requests
url = "https://www.referly.so/api/v1/commission-plans/{id}"
payload = {
"name": "<string>",
"commissionRate": 0,
"commissionType": "PERCENTAGE",
"numberOfPayments": 0,
"numberOfMonths": 0,
"creditAmount": 500000000,
"creditFlatPerPurchase": 500000000,
"creditPerCurrencyUnit": 500000000,
"nonCashCouponId": "<string>",
"nonCashPurchaseCount": 500000,
"nonCashPurchaseMonthLimit": 500000,
"baseCondition": "ALL",
"paymentTrigger": "PURCHASE",
"isActive": True,
"rewardType": "CASH",
"nonCashRewardType": None,
"nonCashTrigger": None,
"nonCashSignupsRequired": 500000,
"nonCashMaxCoupons": 500000,
"creditUnit": "<string>",
"creditMaxTimes": 500000,
"creditPurchaseLimit": 500000,
"creditPurchaseMonthLimit": 500000,
"autoApproveAffiliates": True,
"autoApproveRewards": True,
"ruleGroups": [],
"amounts": [],
"afterPeriods": []
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
commissionRate: 0,
commissionType: 'PERCENTAGE',
numberOfPayments: 0,
numberOfMonths: 0,
creditAmount: 500000000,
creditFlatPerPurchase: 500000000,
creditPerCurrencyUnit: 500000000,
nonCashCouponId: '<string>',
nonCashPurchaseCount: 500000,
nonCashPurchaseMonthLimit: 500000,
baseCondition: 'ALL',
paymentTrigger: 'PURCHASE',
isActive: true,
rewardType: 'CASH',
nonCashRewardType: null,
nonCashTrigger: null,
nonCashSignupsRequired: 500000,
nonCashMaxCoupons: 500000,
creditUnit: '<string>',
creditMaxTimes: 500000,
creditPurchaseLimit: 500000,
creditPurchaseMonthLimit: 500000,
autoApproveAffiliates: true,
autoApproveRewards: true,
ruleGroups: [],
amounts: [],
afterPeriods: []
})
};
fetch('https://www.referly.so/api/v1/commission-plans/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://www.referly.so/api/v1/commission-plans/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>',
'commissionRate' => 0,
'commissionType' => 'PERCENTAGE',
'numberOfPayments' => 0,
'numberOfMonths' => 0,
'creditAmount' => 500000000,
'creditFlatPerPurchase' => 500000000,
'creditPerCurrencyUnit' => 500000000,
'nonCashCouponId' => '<string>',
'nonCashPurchaseCount' => 500000,
'nonCashPurchaseMonthLimit' => 500000,
'baseCondition' => 'ALL',
'paymentTrigger' => 'PURCHASE',
'isActive' => true,
'rewardType' => 'CASH',
'nonCashRewardType' => null,
'nonCashTrigger' => null,
'nonCashSignupsRequired' => 500000,
'nonCashMaxCoupons' => 500000,
'creditUnit' => '<string>',
'creditMaxTimes' => 500000,
'creditPurchaseLimit' => 500000,
'creditPurchaseMonthLimit' => 500000,
'autoApproveAffiliates' => true,
'autoApproveRewards' => true,
'ruleGroups' => [
],
'amounts' => [
],
'afterPeriods' => [
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://www.referly.so/api/v1/commission-plans/{id}"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"commissionRate\": 0,\n \"commissionType\": \"PERCENTAGE\",\n \"numberOfPayments\": 0,\n \"numberOfMonths\": 0,\n \"creditAmount\": 500000000,\n \"creditFlatPerPurchase\": 500000000,\n \"creditPerCurrencyUnit\": 500000000,\n \"nonCashCouponId\": \"<string>\",\n \"nonCashPurchaseCount\": 500000,\n \"nonCashPurchaseMonthLimit\": 500000,\n \"baseCondition\": \"ALL\",\n \"paymentTrigger\": \"PURCHASE\",\n \"isActive\": true,\n \"rewardType\": \"CASH\",\n \"nonCashRewardType\": null,\n \"nonCashTrigger\": null,\n \"nonCashSignupsRequired\": 500000,\n \"nonCashMaxCoupons\": 500000,\n \"creditUnit\": \"<string>\",\n \"creditMaxTimes\": 500000,\n \"creditPurchaseLimit\": 500000,\n \"creditPurchaseMonthLimit\": 500000,\n \"autoApproveAffiliates\": true,\n \"autoApproveRewards\": true,\n \"ruleGroups\": [],\n \"amounts\": [],\n \"afterPeriods\": []\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://www.referly.so/api/v1/commission-plans/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"commissionRate\": 0,\n \"commissionType\": \"PERCENTAGE\",\n \"numberOfPayments\": 0,\n \"numberOfMonths\": 0,\n \"creditAmount\": 500000000,\n \"creditFlatPerPurchase\": 500000000,\n \"creditPerCurrencyUnit\": 500000000,\n \"nonCashCouponId\": \"<string>\",\n \"nonCashPurchaseCount\": 500000,\n \"nonCashPurchaseMonthLimit\": 500000,\n \"baseCondition\": \"ALL\",\n \"paymentTrigger\": \"PURCHASE\",\n \"isActive\": true,\n \"rewardType\": \"CASH\",\n \"nonCashRewardType\": null,\n \"nonCashTrigger\": null,\n \"nonCashSignupsRequired\": 500000,\n \"nonCashMaxCoupons\": 500000,\n \"creditUnit\": \"<string>\",\n \"creditMaxTimes\": 500000,\n \"creditPurchaseLimit\": 500000,\n \"creditPurchaseMonthLimit\": 500000,\n \"autoApproveAffiliates\": true,\n \"autoApproveRewards\": true,\n \"ruleGroups\": [],\n \"amounts\": [],\n \"afterPeriods\": []\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://www.referly.so/api/v1/commission-plans/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"commissionRate\": 0,\n \"commissionType\": \"PERCENTAGE\",\n \"numberOfPayments\": 0,\n \"numberOfMonths\": 0,\n \"creditAmount\": 500000000,\n \"creditFlatPerPurchase\": 500000000,\n \"creditPerCurrencyUnit\": 500000000,\n \"nonCashCouponId\": \"<string>\",\n \"nonCashPurchaseCount\": 500000,\n \"nonCashPurchaseMonthLimit\": 500000,\n \"baseCondition\": \"ALL\",\n \"paymentTrigger\": \"PURCHASE\",\n \"isActive\": true,\n \"rewardType\": \"CASH\",\n \"nonCashRewardType\": null,\n \"nonCashTrigger\": null,\n \"nonCashSignupsRequired\": 500000,\n \"nonCashMaxCoupons\": 500000,\n \"creditUnit\": \"<string>\",\n \"creditMaxTimes\": 500000,\n \"creditPurchaseLimit\": 500000,\n \"creditPurchaseMonthLimit\": 500000,\n \"autoApproveAffiliates\": true,\n \"autoApproveRewards\": true,\n \"ruleGroups\": [],\n \"amounts\": [],\n \"afterPeriods\": []\n}"
response = http.request(request)
puts response.read_body{
"id": "plan_standard",
"name": "Standard Partner Plan",
"affiliateProgramId": "prog_acme_partners",
"affiliateGroupId": null,
"commissionRate": 20,
"commissionType": "PERCENTAGE",
"numberOfPayments": 0,
"numberOfMonths": 0,
"baseCondition": "ALL",
"isActive": true,
"paymentTrigger": "PURCHASE",
"rewardType": "CASH",
"nonCashRewardType": null,
"nonCashTrigger": null,
"nonCashCouponId": null,
"nonCashSignupsRequired": null,
"nonCashMaxCoupons": null,
"nonCashPurchaseTrigger": null,
"nonCashPurchaseCount": null,
"nonCashPurchaseMonthLimit": null,
"creditType": null,
"creditMaxTimes": null,
"creditPerCurrencyUnit": null,
"creditCalculationMode": null,
"creditFlatPerPurchase": null,
"creditPurchaseLimit": null,
"creditPurchaseMonthLimit": null,
"creditAmount": null,
"creditUnit": null,
"autoApproveAffiliates": true,
"autoApproveRewards": true,
"createdAt": "2026-09-01T12:00:00.000Z",
"updatedAt": "2026-09-01T12:00:00.000Z",
"commissionRuleGroups": [
{
"id": "rule_group_1",
"commissionPlanId": "plan_standard",
"commissionAmountId": null,
"order": 0,
"groupCondition": "ALL",
"createdAt": "2026-09-01T12:00:00.000Z",
"updatedAt": "2026-09-01T12:00:00.000Z",
"commissionRules": [
{
"id": "rule_1",
"commissionRuleGroupId": "rule_group_1",
"ruleType": "ORDER_AMOUNT",
"condition": "GREATER_THAN",
"value": "100",
"createdAt": "2026-09-01T12:00:00.000Z",
"updatedAt": "2026-09-01T12:00:00.000Z"
}
]
}
],
"commissionAmounts": [
{
"id": "amount_1",
"commissionPlanId": "plan_standard",
"productRequirement": "[\\\"api:0\\\"]",
"commissionRate": 25,
"commissionType": "PERCENTAGE",
"numberOfPayments": 3,
"numberOfMonths": 0,
"creditAmount": null,
"creditFlatPerPurchase": null,
"creditPerCurrencyUnit": null,
"nonCashCouponId": null,
"nonCashPurchaseTrigger": null,
"nonCashPurchaseCount": null,
"nonCashPurchaseMonthLimit": null,
"ruleGroups": [],
"commissionAfterPeriods": [
{
"id": "period_1",
"order": 1,
"commissionType": "PERCENTAGE",
"commissionRate": 10,
"numberOfMonths": 0,
"numberOfPayments": 0,
"affiliateProgramId": null,
"commissionPlanId": null,
"commissionAmountId": "amount_1",
"createdAt": "2026-09-01T12:00:00.000Z",
"updatedAt": "2026-09-01T12:00:00.000Z"
}
]
}
],
"commissionAfterPeriods": [],
"CommissionTier": [
{
"id": "tier_1",
"name": "Tier 1",
"tier": 1,
"minReferrals": 0,
"minRevenue": 0,
"conditionType": "ALL"
}
]
}{
"error": {
"code": "invalid_json",
"message": "Invalid JSON body",
"requestId": "5c1f7a2e-2b39-4c2d-9c31-7a6e0f6a9b21"
}
}{
"error": {
"code": "unauthorized",
"message": "Invalid, expired or revoked API key",
"requestId": "5c1f7a2e-2b39-4c2d-9c31-7a6e0f6a9b21"
}
}{
"error": {
"code": "insufficient_scope",
"message": "Requires commission-plans:write",
"requestId": "5c1f7a2e-2b39-4c2d-9c31-7a6e0f6a9b21"
}
}{
"error": {
"code": "not_found",
"message": "Resource not found",
"requestId": "5c1f7a2e-2b39-4c2d-9c31-7a6e0f6a9b21"
}
}{
"error": {
"code": "plan_in_use",
"message": "Reassign affiliates, tiers and defaults before archiving a plan",
"requestId": "5c1f7a2e-2b39-4c2d-9c31-7a6e0f6a9b21"
}
}{
"error": {
"code": "body_too_large",
"message": "Request body must be at most 64 KiB",
"requestId": "5c1f7a2e-2b39-4c2d-9c31-7a6e0f6a9b21"
}
}{
"error": {
"code": "validation_error",
"message": "Invalid request parameters",
"requestId": "5c1f7a2e-2b39-4c2d-9c31-7a6e0f6a9b21"
}
}{
"error": "Too many requests. Please slow down.",
"retryAfter": 42
}{
"error": {
"code": "internal_error",
"message": "Request failed",
"requestId": "5c1f7a2e-2b39-4c2d-9c31-7a6e0f6a9b21"
}
}Commission Plan Endpoints
Update commission plans
Requires commission-plans:write. See Commission plans behavior and common API rules.
PATCH
/
commission-plans
/
{id}
Update commission plans
curl --request PATCH \
--url https://www.referly.so/api/v1/commission-plans/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"commissionRate": 0,
"commissionType": "PERCENTAGE",
"numberOfPayments": 0,
"numberOfMonths": 0,
"creditAmount": 500000000,
"creditFlatPerPurchase": 500000000,
"creditPerCurrencyUnit": 500000000,
"nonCashCouponId": "<string>",
"nonCashPurchaseCount": 500000,
"nonCashPurchaseMonthLimit": 500000,
"baseCondition": "ALL",
"paymentTrigger": "PURCHASE",
"isActive": true,
"rewardType": "CASH",
"nonCashRewardType": null,
"nonCashTrigger": null,
"nonCashSignupsRequired": 500000,
"nonCashMaxCoupons": 500000,
"creditUnit": "<string>",
"creditMaxTimes": 500000,
"creditPurchaseLimit": 500000,
"creditPurchaseMonthLimit": 500000,
"autoApproveAffiliates": true,
"autoApproveRewards": true,
"ruleGroups": [],
"amounts": [],
"afterPeriods": []
}
'import requests
url = "https://www.referly.so/api/v1/commission-plans/{id}"
payload = {
"name": "<string>",
"commissionRate": 0,
"commissionType": "PERCENTAGE",
"numberOfPayments": 0,
"numberOfMonths": 0,
"creditAmount": 500000000,
"creditFlatPerPurchase": 500000000,
"creditPerCurrencyUnit": 500000000,
"nonCashCouponId": "<string>",
"nonCashPurchaseCount": 500000,
"nonCashPurchaseMonthLimit": 500000,
"baseCondition": "ALL",
"paymentTrigger": "PURCHASE",
"isActive": True,
"rewardType": "CASH",
"nonCashRewardType": None,
"nonCashTrigger": None,
"nonCashSignupsRequired": 500000,
"nonCashMaxCoupons": 500000,
"creditUnit": "<string>",
"creditMaxTimes": 500000,
"creditPurchaseLimit": 500000,
"creditPurchaseMonthLimit": 500000,
"autoApproveAffiliates": True,
"autoApproveRewards": True,
"ruleGroups": [],
"amounts": [],
"afterPeriods": []
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
commissionRate: 0,
commissionType: 'PERCENTAGE',
numberOfPayments: 0,
numberOfMonths: 0,
creditAmount: 500000000,
creditFlatPerPurchase: 500000000,
creditPerCurrencyUnit: 500000000,
nonCashCouponId: '<string>',
nonCashPurchaseCount: 500000,
nonCashPurchaseMonthLimit: 500000,
baseCondition: 'ALL',
paymentTrigger: 'PURCHASE',
isActive: true,
rewardType: 'CASH',
nonCashRewardType: null,
nonCashTrigger: null,
nonCashSignupsRequired: 500000,
nonCashMaxCoupons: 500000,
creditUnit: '<string>',
creditMaxTimes: 500000,
creditPurchaseLimit: 500000,
creditPurchaseMonthLimit: 500000,
autoApproveAffiliates: true,
autoApproveRewards: true,
ruleGroups: [],
amounts: [],
afterPeriods: []
})
};
fetch('https://www.referly.so/api/v1/commission-plans/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://www.referly.so/api/v1/commission-plans/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>',
'commissionRate' => 0,
'commissionType' => 'PERCENTAGE',
'numberOfPayments' => 0,
'numberOfMonths' => 0,
'creditAmount' => 500000000,
'creditFlatPerPurchase' => 500000000,
'creditPerCurrencyUnit' => 500000000,
'nonCashCouponId' => '<string>',
'nonCashPurchaseCount' => 500000,
'nonCashPurchaseMonthLimit' => 500000,
'baseCondition' => 'ALL',
'paymentTrigger' => 'PURCHASE',
'isActive' => true,
'rewardType' => 'CASH',
'nonCashRewardType' => null,
'nonCashTrigger' => null,
'nonCashSignupsRequired' => 500000,
'nonCashMaxCoupons' => 500000,
'creditUnit' => '<string>',
'creditMaxTimes' => 500000,
'creditPurchaseLimit' => 500000,
'creditPurchaseMonthLimit' => 500000,
'autoApproveAffiliates' => true,
'autoApproveRewards' => true,
'ruleGroups' => [
],
'amounts' => [
],
'afterPeriods' => [
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://www.referly.so/api/v1/commission-plans/{id}"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"commissionRate\": 0,\n \"commissionType\": \"PERCENTAGE\",\n \"numberOfPayments\": 0,\n \"numberOfMonths\": 0,\n \"creditAmount\": 500000000,\n \"creditFlatPerPurchase\": 500000000,\n \"creditPerCurrencyUnit\": 500000000,\n \"nonCashCouponId\": \"<string>\",\n \"nonCashPurchaseCount\": 500000,\n \"nonCashPurchaseMonthLimit\": 500000,\n \"baseCondition\": \"ALL\",\n \"paymentTrigger\": \"PURCHASE\",\n \"isActive\": true,\n \"rewardType\": \"CASH\",\n \"nonCashRewardType\": null,\n \"nonCashTrigger\": null,\n \"nonCashSignupsRequired\": 500000,\n \"nonCashMaxCoupons\": 500000,\n \"creditUnit\": \"<string>\",\n \"creditMaxTimes\": 500000,\n \"creditPurchaseLimit\": 500000,\n \"creditPurchaseMonthLimit\": 500000,\n \"autoApproveAffiliates\": true,\n \"autoApproveRewards\": true,\n \"ruleGroups\": [],\n \"amounts\": [],\n \"afterPeriods\": []\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://www.referly.so/api/v1/commission-plans/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"commissionRate\": 0,\n \"commissionType\": \"PERCENTAGE\",\n \"numberOfPayments\": 0,\n \"numberOfMonths\": 0,\n \"creditAmount\": 500000000,\n \"creditFlatPerPurchase\": 500000000,\n \"creditPerCurrencyUnit\": 500000000,\n \"nonCashCouponId\": \"<string>\",\n \"nonCashPurchaseCount\": 500000,\n \"nonCashPurchaseMonthLimit\": 500000,\n \"baseCondition\": \"ALL\",\n \"paymentTrigger\": \"PURCHASE\",\n \"isActive\": true,\n \"rewardType\": \"CASH\",\n \"nonCashRewardType\": null,\n \"nonCashTrigger\": null,\n \"nonCashSignupsRequired\": 500000,\n \"nonCashMaxCoupons\": 500000,\n \"creditUnit\": \"<string>\",\n \"creditMaxTimes\": 500000,\n \"creditPurchaseLimit\": 500000,\n \"creditPurchaseMonthLimit\": 500000,\n \"autoApproveAffiliates\": true,\n \"autoApproveRewards\": true,\n \"ruleGroups\": [],\n \"amounts\": [],\n \"afterPeriods\": []\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://www.referly.so/api/v1/commission-plans/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"commissionRate\": 0,\n \"commissionType\": \"PERCENTAGE\",\n \"numberOfPayments\": 0,\n \"numberOfMonths\": 0,\n \"creditAmount\": 500000000,\n \"creditFlatPerPurchase\": 500000000,\n \"creditPerCurrencyUnit\": 500000000,\n \"nonCashCouponId\": \"<string>\",\n \"nonCashPurchaseCount\": 500000,\n \"nonCashPurchaseMonthLimit\": 500000,\n \"baseCondition\": \"ALL\",\n \"paymentTrigger\": \"PURCHASE\",\n \"isActive\": true,\n \"rewardType\": \"CASH\",\n \"nonCashRewardType\": null,\n \"nonCashTrigger\": null,\n \"nonCashSignupsRequired\": 500000,\n \"nonCashMaxCoupons\": 500000,\n \"creditUnit\": \"<string>\",\n \"creditMaxTimes\": 500000,\n \"creditPurchaseLimit\": 500000,\n \"creditPurchaseMonthLimit\": 500000,\n \"autoApproveAffiliates\": true,\n \"autoApproveRewards\": true,\n \"ruleGroups\": [],\n \"amounts\": [],\n \"afterPeriods\": []\n}"
response = http.request(request)
puts response.read_body{
"id": "plan_standard",
"name": "Standard Partner Plan",
"affiliateProgramId": "prog_acme_partners",
"affiliateGroupId": null,
"commissionRate": 20,
"commissionType": "PERCENTAGE",
"numberOfPayments": 0,
"numberOfMonths": 0,
"baseCondition": "ALL",
"isActive": true,
"paymentTrigger": "PURCHASE",
"rewardType": "CASH",
"nonCashRewardType": null,
"nonCashTrigger": null,
"nonCashCouponId": null,
"nonCashSignupsRequired": null,
"nonCashMaxCoupons": null,
"nonCashPurchaseTrigger": null,
"nonCashPurchaseCount": null,
"nonCashPurchaseMonthLimit": null,
"creditType": null,
"creditMaxTimes": null,
"creditPerCurrencyUnit": null,
"creditCalculationMode": null,
"creditFlatPerPurchase": null,
"creditPurchaseLimit": null,
"creditPurchaseMonthLimit": null,
"creditAmount": null,
"creditUnit": null,
"autoApproveAffiliates": true,
"autoApproveRewards": true,
"createdAt": "2026-09-01T12:00:00.000Z",
"updatedAt": "2026-09-01T12:00:00.000Z",
"commissionRuleGroups": [
{
"id": "rule_group_1",
"commissionPlanId": "plan_standard",
"commissionAmountId": null,
"order": 0,
"groupCondition": "ALL",
"createdAt": "2026-09-01T12:00:00.000Z",
"updatedAt": "2026-09-01T12:00:00.000Z",
"commissionRules": [
{
"id": "rule_1",
"commissionRuleGroupId": "rule_group_1",
"ruleType": "ORDER_AMOUNT",
"condition": "GREATER_THAN",
"value": "100",
"createdAt": "2026-09-01T12:00:00.000Z",
"updatedAt": "2026-09-01T12:00:00.000Z"
}
]
}
],
"commissionAmounts": [
{
"id": "amount_1",
"commissionPlanId": "plan_standard",
"productRequirement": "[\\\"api:0\\\"]",
"commissionRate": 25,
"commissionType": "PERCENTAGE",
"numberOfPayments": 3,
"numberOfMonths": 0,
"creditAmount": null,
"creditFlatPerPurchase": null,
"creditPerCurrencyUnit": null,
"nonCashCouponId": null,
"nonCashPurchaseTrigger": null,
"nonCashPurchaseCount": null,
"nonCashPurchaseMonthLimit": null,
"ruleGroups": [],
"commissionAfterPeriods": [
{
"id": "period_1",
"order": 1,
"commissionType": "PERCENTAGE",
"commissionRate": 10,
"numberOfMonths": 0,
"numberOfPayments": 0,
"affiliateProgramId": null,
"commissionPlanId": null,
"commissionAmountId": "amount_1",
"createdAt": "2026-09-01T12:00:00.000Z",
"updatedAt": "2026-09-01T12:00:00.000Z"
}
]
}
],
"commissionAfterPeriods": [],
"CommissionTier": [
{
"id": "tier_1",
"name": "Tier 1",
"tier": 1,
"minReferrals": 0,
"minRevenue": 0,
"conditionType": "ALL"
}
]
}{
"error": {
"code": "invalid_json",
"message": "Invalid JSON body",
"requestId": "5c1f7a2e-2b39-4c2d-9c31-7a6e0f6a9b21"
}
}{
"error": {
"code": "unauthorized",
"message": "Invalid, expired or revoked API key",
"requestId": "5c1f7a2e-2b39-4c2d-9c31-7a6e0f6a9b21"
}
}{
"error": {
"code": "insufficient_scope",
"message": "Requires commission-plans:write",
"requestId": "5c1f7a2e-2b39-4c2d-9c31-7a6e0f6a9b21"
}
}{
"error": {
"code": "not_found",
"message": "Resource not found",
"requestId": "5c1f7a2e-2b39-4c2d-9c31-7a6e0f6a9b21"
}
}{
"error": {
"code": "plan_in_use",
"message": "Reassign affiliates, tiers and defaults before archiving a plan",
"requestId": "5c1f7a2e-2b39-4c2d-9c31-7a6e0f6a9b21"
}
}{
"error": {
"code": "body_too_large",
"message": "Request body must be at most 64 KiB",
"requestId": "5c1f7a2e-2b39-4c2d-9c31-7a6e0f6a9b21"
}
}{
"error": {
"code": "validation_error",
"message": "Invalid request parameters",
"requestId": "5c1f7a2e-2b39-4c2d-9c31-7a6e0f6a9b21"
}
}{
"error": "Too many requests. Please slow down.",
"retryAfter": 42
}{
"error": {
"code": "internal_error",
"message": "Request failed",
"requestId": "5c1f7a2e-2b39-4c2d-9c31-7a6e0f6a9b21"
}
}Requires
commission-plans:write. See the commission plans guide for behavior and examples.Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Headers
Optional retry key, unique within the selected program. Reuse the same key, method, path and validated payload; a conflicting reuse returns 409.
Required string length:
8 - 200Pattern:
^[\x21-\x7e]+$Select the key's original program or a program provisioned by this exact key. Other owned programs remain inaccessible.
Path Parameters
Body
application/json
Required string length:
1 - 100Required range:
0 <= x <= 1000000000Available options:
PERCENTAGE, FLAT Required range:
0 <= x <= 1000000Required range:
0 <= x <= 1000000Required range:
0 <= x <= 1000000000Required range:
0 <= x <= 1000000000Required range:
0 <= x <= 1000000000Required string length:
1 - 200Available options:
FIRST_PURCHASE, X_PURCHASES Required range:
0 <= x <= 1000000Required range:
0 <= x <= 1000000Available options:
ALL, SOME Available options:
PURCHASE, SIGNUP Available options:
CASH, NON_CASH Available options:
COUPON, CUSTOM_CREDITS Available options:
SIGNUP, PURCHASE Required range:
0 <= x <= 1000000Required range:
0 <= x <= 1000000Available options:
SHOPIFY_STORE_CREDITS, STRIPE_CREDITS, WOOCOMMERCE_CREDITS, CREEM_CREDITS, CUSTOM Required string length:
1 - 100Required range:
0 <= x <= 1000000Available options:
FLAT_PER_PURCHASE, PER_CURRENCY_UNIT Required range:
0 <= x <= 1000000Required range:
0 <= x <= 1000000Maximum array length:
50Show child attributes
Show child attributes
Maximum array length:
50Show child attributes
Show child attributes
Maximum array length:
50Show child attributes
Show child attributes
Response
Success; see management guide for state and accounting semantics
Last modified on October 23, 2026
⌘I