Set a campaign's sub-affiliate override
curl --request PUT \
--url https://go.affixo.dev/v1/campaigns/{id}/sub-affiliate-rule \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"amount": 123,
"type": "percent"
}
'import requests
url = "https://go.affixo.dev/v1/campaigns/{id}/sub-affiliate-rule"
payload = {
"amount": 123,
"type": "percent"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({amount: 123, type: 'percent'})
};
fetch('https://go.affixo.dev/v1/campaigns/{id}/sub-affiliate-rule', 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://go.affixo.dev/v1/campaigns/{id}/sub-affiliate-rule",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'amount' => 123,
'type' => 'percent'
]),
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://go.affixo.dev/v1/campaigns/{id}/sub-affiliate-rule"
payload := strings.NewReader("{\n \"amount\": 123,\n \"type\": \"percent\"\n}")
req, _ := http.NewRequest("PUT", 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.put("https://go.affixo.dev/v1/campaigns/{id}/sub-affiliate-rule")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"amount\": 123,\n \"type\": \"percent\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://go.affixo.dev/v1/campaigns/{id}/sub-affiliate-rule")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"amount\": 123,\n \"type\": \"percent\"\n}"
response = http.request(request)
puts response.read_body{
"object": "sub_affiliate_rule",
"campaign": "<string>",
"data": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"amount": 123,
"is_flat": true,
"currency": "<string>"
},
"sub_affiliates_enabled": true
}{
"object": "sub_affiliate_rule",
"campaign": "<string>",
"data": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"amount": 123,
"is_flat": true,
"currency": "<string>"
},
"sub_affiliates_enabled": true
}{
"error": "invalid_json"
}{
"error": "unauthorized"
}{
"error": "entitlement_required",
"key": "sub_affiliate_tiers"
}{
"error": "insufficient_scope",
"need": "write"
}{
"error": "link_not_found"
}Campaigns
Set a campaign's sub-affiliate override
Creates or updates the campaign’s single sub-affiliate override: the commission a recruiting affiliate earns on top of their recruit’s own commission. It does not change the rate affiliates earn on their own sales (use the commission-rule endpoint for that).
amount is a percentage (0 to 100) of the sale’s net amount unless
type is flat. Turns the workspace’s sub-affiliates setting on.
Requires the sub-affiliate tiers plan feature (402 otherwise) and
write scope. Only affiliates linked to a recruiter earn it.
Configuration only, never moves money.
PUT
/
v1
/
campaigns
/
{id}
/
sub-affiliate-rule
Set a campaign's sub-affiliate override
curl --request PUT \
--url https://go.affixo.dev/v1/campaigns/{id}/sub-affiliate-rule \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"amount": 123,
"type": "percent"
}
'import requests
url = "https://go.affixo.dev/v1/campaigns/{id}/sub-affiliate-rule"
payload = {
"amount": 123,
"type": "percent"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({amount: 123, type: 'percent'})
};
fetch('https://go.affixo.dev/v1/campaigns/{id}/sub-affiliate-rule', 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://go.affixo.dev/v1/campaigns/{id}/sub-affiliate-rule",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'amount' => 123,
'type' => 'percent'
]),
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://go.affixo.dev/v1/campaigns/{id}/sub-affiliate-rule"
payload := strings.NewReader("{\n \"amount\": 123,\n \"type\": \"percent\"\n}")
req, _ := http.NewRequest("PUT", 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.put("https://go.affixo.dev/v1/campaigns/{id}/sub-affiliate-rule")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"amount\": 123,\n \"type\": \"percent\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://go.affixo.dev/v1/campaigns/{id}/sub-affiliate-rule")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"amount\": 123,\n \"type\": \"percent\"\n}"
response = http.request(request)
puts response.read_body{
"object": "sub_affiliate_rule",
"campaign": "<string>",
"data": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"amount": 123,
"is_flat": true,
"currency": "<string>"
},
"sub_affiliates_enabled": true
}{
"object": "sub_affiliate_rule",
"campaign": "<string>",
"data": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"amount": 123,
"is_flat": true,
"currency": "<string>"
},
"sub_affiliates_enabled": true
}{
"error": "invalid_json"
}{
"error": "unauthorized"
}{
"error": "entitlement_required",
"key": "sub_affiliate_tiers"
}{
"error": "insufficient_scope",
"need": "write"
}{
"error": "link_not_found"
}Authorizations
Workspace API key, e.g. sa_live_…. Scopes: read / write / track / *.
Path Parameters
Body
application/json