Create programs
curl --request POST \
--url https://www.referly.so/api/v1/programs \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"websiteUrl": "<string>",
"currency": "USD",
"cookieDuration": 60,
"daysToPayout": 30,
"minPayoutThreshold": 0,
"commissionRate": 0,
"commissionType": "PERCENTAGE",
"numberOfPayments": 0,
"numberOfMonths": 0,
"paymentTrigger": "PURCHASE"
}
'import requests
url = "https://www.referly.so/api/v1/programs"
payload = {
"name": "<string>",
"websiteUrl": "<string>",
"currency": "USD",
"cookieDuration": 60,
"daysToPayout": 30,
"minPayoutThreshold": 0,
"commissionRate": 0,
"commissionType": "PERCENTAGE",
"numberOfPayments": 0,
"numberOfMonths": 0,
"paymentTrigger": "PURCHASE"
}
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({
name: '<string>',
websiteUrl: '<string>',
currency: 'USD',
cookieDuration: 60,
daysToPayout: 30,
minPayoutThreshold: 0,
commissionRate: 0,
commissionType: 'PERCENTAGE',
numberOfPayments: 0,
numberOfMonths: 0,
paymentTrigger: 'PURCHASE'
})
};
fetch('https://www.referly.so/api/v1/programs', 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/programs",
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([
'name' => '<string>',
'websiteUrl' => '<string>',
'currency' => 'USD',
'cookieDuration' => 60,
'daysToPayout' => 30,
'minPayoutThreshold' => 0,
'commissionRate' => 0,
'commissionType' => 'PERCENTAGE',
'numberOfPayments' => 0,
'numberOfMonths' => 0,
'paymentTrigger' => 'PURCHASE'
]),
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/programs"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"websiteUrl\": \"<string>\",\n \"currency\": \"USD\",\n \"cookieDuration\": 60,\n \"daysToPayout\": 30,\n \"minPayoutThreshold\": 0,\n \"commissionRate\": 0,\n \"commissionType\": \"PERCENTAGE\",\n \"numberOfPayments\": 0,\n \"numberOfMonths\": 0,\n \"paymentTrigger\": \"PURCHASE\"\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/programs")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"websiteUrl\": \"<string>\",\n \"currency\": \"USD\",\n \"cookieDuration\": 60,\n \"daysToPayout\": 30,\n \"minPayoutThreshold\": 0,\n \"commissionRate\": 0,\n \"commissionType\": \"PERCENTAGE\",\n \"numberOfPayments\": 0,\n \"numberOfMonths\": 0,\n \"paymentTrigger\": \"PURCHASE\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://www.referly.so/api/v1/programs")
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 \"name\": \"<string>\",\n \"websiteUrl\": \"<string>\",\n \"currency\": \"USD\",\n \"cookieDuration\": 60,\n \"daysToPayout\": 30,\n \"minPayoutThreshold\": 0,\n \"commissionRate\": 0,\n \"commissionType\": \"PERCENTAGE\",\n \"numberOfPayments\": 0,\n \"numberOfMonths\": 0,\n \"paymentTrigger\": \"PURCHASE\"\n}"
response = http.request(request)
puts response.read_body{
"id": "prog_acme_partners",
"name": "Acme Partners",
"currency": "USD",
"commissionRate": 20,
"daysToPayout": 30,
"minPayoutThreshold": 50,
"defaultCommissionPlanId": "plan_standard",
"createdAt": "2026-09-01T12:00:00.000Z",
"subdomain": "acme-partners",
"baseDomain": "https://acme.example",
"cookieDuration": 60,
"commissionType": "PERCENTAGE",
"numberOfPayments": 0,
"numberOfMonths": 0,
"paymentTrigger": "PURCHASE"
}{
"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": "agency_program_creation_disabled",
"message": "contact support to create a new affiliate program",
"requestId": "5c1f7a2e-2b39-4c2d-9c31-7a6e0f6a9b21"
}
}{
"error": {
"code": "not_found",
"message": "Resource not found",
"requestId": "5c1f7a2e-2b39-4c2d-9c31-7a6e0f6a9b21"
}
}{
"error": {
"code": "concurrent_request",
"message": "Concurrent operation; retry the same request",
"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": "invalid_rate",
"message": "Percentage cannot exceed 100",
"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"
}
}Program Endpoints
Create programs
Requires programs:write. See Programs behavior and common API rules.
POST
/
programs
Create programs
curl --request POST \
--url https://www.referly.so/api/v1/programs \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"websiteUrl": "<string>",
"currency": "USD",
"cookieDuration": 60,
"daysToPayout": 30,
"minPayoutThreshold": 0,
"commissionRate": 0,
"commissionType": "PERCENTAGE",
"numberOfPayments": 0,
"numberOfMonths": 0,
"paymentTrigger": "PURCHASE"
}
'import requests
url = "https://www.referly.so/api/v1/programs"
payload = {
"name": "<string>",
"websiteUrl": "<string>",
"currency": "USD",
"cookieDuration": 60,
"daysToPayout": 30,
"minPayoutThreshold": 0,
"commissionRate": 0,
"commissionType": "PERCENTAGE",
"numberOfPayments": 0,
"numberOfMonths": 0,
"paymentTrigger": "PURCHASE"
}
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({
name: '<string>',
websiteUrl: '<string>',
currency: 'USD',
cookieDuration: 60,
daysToPayout: 30,
minPayoutThreshold: 0,
commissionRate: 0,
commissionType: 'PERCENTAGE',
numberOfPayments: 0,
numberOfMonths: 0,
paymentTrigger: 'PURCHASE'
})
};
fetch('https://www.referly.so/api/v1/programs', 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/programs",
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([
'name' => '<string>',
'websiteUrl' => '<string>',
'currency' => 'USD',
'cookieDuration' => 60,
'daysToPayout' => 30,
'minPayoutThreshold' => 0,
'commissionRate' => 0,
'commissionType' => 'PERCENTAGE',
'numberOfPayments' => 0,
'numberOfMonths' => 0,
'paymentTrigger' => 'PURCHASE'
]),
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/programs"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"websiteUrl\": \"<string>\",\n \"currency\": \"USD\",\n \"cookieDuration\": 60,\n \"daysToPayout\": 30,\n \"minPayoutThreshold\": 0,\n \"commissionRate\": 0,\n \"commissionType\": \"PERCENTAGE\",\n \"numberOfPayments\": 0,\n \"numberOfMonths\": 0,\n \"paymentTrigger\": \"PURCHASE\"\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/programs")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"websiteUrl\": \"<string>\",\n \"currency\": \"USD\",\n \"cookieDuration\": 60,\n \"daysToPayout\": 30,\n \"minPayoutThreshold\": 0,\n \"commissionRate\": 0,\n \"commissionType\": \"PERCENTAGE\",\n \"numberOfPayments\": 0,\n \"numberOfMonths\": 0,\n \"paymentTrigger\": \"PURCHASE\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://www.referly.so/api/v1/programs")
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 \"name\": \"<string>\",\n \"websiteUrl\": \"<string>\",\n \"currency\": \"USD\",\n \"cookieDuration\": 60,\n \"daysToPayout\": 30,\n \"minPayoutThreshold\": 0,\n \"commissionRate\": 0,\n \"commissionType\": \"PERCENTAGE\",\n \"numberOfPayments\": 0,\n \"numberOfMonths\": 0,\n \"paymentTrigger\": \"PURCHASE\"\n}"
response = http.request(request)
puts response.read_body{
"id": "prog_acme_partners",
"name": "Acme Partners",
"currency": "USD",
"commissionRate": 20,
"daysToPayout": 30,
"minPayoutThreshold": 50,
"defaultCommissionPlanId": "plan_standard",
"createdAt": "2026-09-01T12:00:00.000Z",
"subdomain": "acme-partners",
"baseDomain": "https://acme.example",
"cookieDuration": 60,
"commissionType": "PERCENTAGE",
"numberOfPayments": 0,
"numberOfMonths": 0,
"paymentTrigger": "PURCHASE"
}{
"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": "agency_program_creation_disabled",
"message": "contact support to create a new affiliate program",
"requestId": "5c1f7a2e-2b39-4c2d-9c31-7a6e0f6a9b21"
}
}{
"error": {
"code": "not_found",
"message": "Resource not found",
"requestId": "5c1f7a2e-2b39-4c2d-9c31-7a6e0f6a9b21"
}
}{
"error": {
"code": "concurrent_request",
"message": "Concurrent operation; retry the same request",
"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": "invalid_rate",
"message": "Percentage cannot exceed 100",
"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
programs:write. See the programs 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
Required string length:
1 - 100Maximum string length:
2000Pattern:
^[A-Z]{3}$Required range:
1 <= x <= 3650Required range:
0 <= x <= 3650Required range:
0 <= x <= 1000000000Required range:
0 <= x <= 1000000000Available options:
PERCENTAGE, FLAT Required range:
0 <= x <= 1000000Required range:
0 <= x <= 1000000Available options:
PURCHASE, SIGNUP Response
Success; see management guide for state and accounting semantics
Last modified on October 23, 2026
⌘I