Create commission adjustments
curl --request POST \
--url https://www.referly.so/api/v1/commission-adjustments \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"affiliateId": "<string>",
"amount": 0,
"currency": "<string>",
"reason": "<string>",
"sourceReference": "<string>",
"originalCommissionId": 2
}
'import requests
url = "https://www.referly.so/api/v1/commission-adjustments"
payload = {
"affiliateId": "<string>",
"amount": 0,
"currency": "<string>",
"reason": "<string>",
"sourceReference": "<string>",
"originalCommissionId": 2
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
affiliateId: '<string>',
amount: 0,
currency: '<string>',
reason: '<string>',
sourceReference: '<string>',
originalCommissionId: 2
})
};
fetch('https://www.referly.so/api/v1/commission-adjustments', 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-adjustments",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'affiliateId' => '<string>',
'amount' => 0,
'currency' => '<string>',
'reason' => '<string>',
'sourceReference' => '<string>',
'originalCommissionId' => 2
]),
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-adjustments"
payload := strings.NewReader("{\n \"affiliateId\": \"<string>\",\n \"amount\": 0,\n \"currency\": \"<string>\",\n \"reason\": \"<string>\",\n \"sourceReference\": \"<string>\",\n \"originalCommissionId\": 2\n}")
req, _ := http.NewRequest("POST", 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.post("https://www.referly.so/api/v1/commission-adjustments")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"affiliateId\": \"<string>\",\n \"amount\": 0,\n \"currency\": \"<string>\",\n \"reason\": \"<string>\",\n \"sourceReference\": \"<string>\",\n \"originalCommissionId\": 2\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://www.referly.so/api/v1/commission-adjustments")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"affiliateId\": \"<string>\",\n \"amount\": 0,\n \"currency\": \"<string>\",\n \"reason\": \"<string>\",\n \"sourceReference\": \"<string>\",\n \"originalCommissionId\": 2\n}"
response = http.request(request)
puts response.read_body{
"id": "adj_3e21a7c9",
"programId": "prog_acme_partners",
"affiliateId": "aff_9f2c1e42",
"originalCommissionId": 4821,
"commissionId": 4903,
"amount": "-12.5",
"currency": "USD",
"reason": "Partial commission reversal",
"sourceReference": "refund-4821",
"createdAt": "2026-09-20T09:15:00.000Z"
}{
"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-adjustments:write",
"requestId": "5c1f7a2e-2b39-4c2d-9c31-7a6e0f6a9b21"
}
}{
"error": {
"code": "not_found",
"message": "Affiliate or original commission not found in this program",
"requestId": "5c1f7a2e-2b39-4c2d-9c31-7a6e0f6a9b21"
}
}{
"error": {
"code": "source_reference_conflict",
"message": "This sourceReference was used for a different adjustment",
"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": "currency_mismatch",
"message": "Amount must be in the program currency",
"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"
}
}{
"error": {
"code": "webhook_provider_error",
"message": "The webhook provider request failed",
"requestId": "5c1f7a2e-2b39-4c2d-9c31-7a6e0f6a9b21"
}
}Commission Adjustment Endpoints
Create commission adjustments
Requires commission-adjustments:write. See Commission adjustments behavior and common API rules.
POST
/
commission-adjustments
Create commission adjustments
curl --request POST \
--url https://www.referly.so/api/v1/commission-adjustments \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"affiliateId": "<string>",
"amount": 0,
"currency": "<string>",
"reason": "<string>",
"sourceReference": "<string>",
"originalCommissionId": 2
}
'import requests
url = "https://www.referly.so/api/v1/commission-adjustments"
payload = {
"affiliateId": "<string>",
"amount": 0,
"currency": "<string>",
"reason": "<string>",
"sourceReference": "<string>",
"originalCommissionId": 2
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
affiliateId: '<string>',
amount: 0,
currency: '<string>',
reason: '<string>',
sourceReference: '<string>',
originalCommissionId: 2
})
};
fetch('https://www.referly.so/api/v1/commission-adjustments', 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-adjustments",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'affiliateId' => '<string>',
'amount' => 0,
'currency' => '<string>',
'reason' => '<string>',
'sourceReference' => '<string>',
'originalCommissionId' => 2
]),
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-adjustments"
payload := strings.NewReader("{\n \"affiliateId\": \"<string>\",\n \"amount\": 0,\n \"currency\": \"<string>\",\n \"reason\": \"<string>\",\n \"sourceReference\": \"<string>\",\n \"originalCommissionId\": 2\n}")
req, _ := http.NewRequest("POST", 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.post("https://www.referly.so/api/v1/commission-adjustments")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"affiliateId\": \"<string>\",\n \"amount\": 0,\n \"currency\": \"<string>\",\n \"reason\": \"<string>\",\n \"sourceReference\": \"<string>\",\n \"originalCommissionId\": 2\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://www.referly.so/api/v1/commission-adjustments")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"affiliateId\": \"<string>\",\n \"amount\": 0,\n \"currency\": \"<string>\",\n \"reason\": \"<string>\",\n \"sourceReference\": \"<string>\",\n \"originalCommissionId\": 2\n}"
response = http.request(request)
puts response.read_body{
"id": "adj_3e21a7c9",
"programId": "prog_acme_partners",
"affiliateId": "aff_9f2c1e42",
"originalCommissionId": 4821,
"commissionId": 4903,
"amount": "-12.5",
"currency": "USD",
"reason": "Partial commission reversal",
"sourceReference": "refund-4821",
"createdAt": "2026-09-20T09:15:00.000Z"
}{
"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-adjustments:write",
"requestId": "5c1f7a2e-2b39-4c2d-9c31-7a6e0f6a9b21"
}
}{
"error": {
"code": "not_found",
"message": "Affiliate or original commission not found in this program",
"requestId": "5c1f7a2e-2b39-4c2d-9c31-7a6e0f6a9b21"
}
}{
"error": {
"code": "source_reference_conflict",
"message": "This sourceReference was used for a different adjustment",
"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": "currency_mismatch",
"message": "Amount must be in the program currency",
"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"
}
}{
"error": {
"code": "webhook_provider_error",
"message": "The webhook provider request failed",
"requestId": "5c1f7a2e-2b39-4c2d-9c31-7a6e0f6a9b21"
}
}Requires
commission-adjustments:write. See the commission adjustments 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.
Body
application/json
Nonzero signed amount in major units, at most 6 decimals. Negative requires originalCommissionId.
Required range:
-1000000000 <= x <= 1000000000Pattern:
^[A-Z]{3}$Required string length:
1 - 2000Required string length:
1 - 200Required range:
x >= 1Response
Success. Monetary amounts use program currency; see companion documentation for resource fields.
Last modified on October 23, 2026
⌘I