curl --request POST \
--url https://go.affixo.dev/v1/referrals/move \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"to_affiliate_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"conversion_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"referral_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
'import requests
url = "https://go.affixo.dev/v1/referrals/move"
payload = {
"to_affiliate_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"conversion_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"referral_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
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({
to_affiliate_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
conversion_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
referral_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a'
})
};
fetch('https://go.affixo.dev/v1/referrals/move', 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/referrals/move",
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([
'to_affiliate_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'conversion_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'referral_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a'
]),
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/referrals/move"
payload := strings.NewReader("{\n \"to_affiliate_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"conversion_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"referral_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\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://go.affixo.dev/v1/referrals/move")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"to_affiliate_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"conversion_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"referral_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://go.affixo.dev/v1/referrals/move")
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 \"to_affiliate_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"conversion_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"referral_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n}"
response = http.request(request)
puts response.read_body{
"object": "referral_move",
"data": {
"reassignment_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"referral_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"mode": "forward",
"from_affiliate_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"to_affiliate_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"conversions_moved": 123,
"commissions_moved": 123,
"moved_totals": [
{
"currency": "usd",
"amount": 90
}
],
"paid_stayed": 123,
"paid_totals": [
{
"currency": "usd",
"amount": 90
}
],
"kept_unpaid": 123,
"credits_future_payments": true
}
}{
"error": "invalid_json"
}{
"error": "unauthorized"
}{
"error": "plan_restricted"
}{
"error": "insufficient_scope",
"need": "write"
}{
"error": "link_not_found"
}{
"error": "move_refused",
"message": "1 of these commissions is in a payout run that hasn't been paid yet. Remove it from that run first, then move the referral.",
"hint": "<string>"
}{
"error": "affiliate_not_eligible",
"message": "Ray isn't an active affiliate, so they can't take over a referral. Approve or restore them first.",
"hint": "<string>"
}Move a referral to another affiliate
Move a referred customer to another affiliate, with the same rules as the move in the dashboard. Requires write scope. Preview it first with POST /v1/referrals/move/preview.
mode: forward (from now on only): the customer’s future payments credit the new affiliate, and every existing commission stays where it is. It needs the customer’s email or Stripe customer id on record.
mode: history (include history): also moves the customer’s unpaid commissions (pending, confirmed or held), at the amounts they were earned at. Paid commissions always stay with the affiliate who was paid. It is refused while any of those commissions is in a payout run that hasn’t been paid; remove them from the run first.
The new affiliate must be active (not suspended, banned, archived or left) and the same kind of data as the customer (test or live). A refused move changes nothing. No money moves: payouts still pay only confirmed commissions, through your own payout method.
A move changes who unpaid commissions are owed to, so it needs a REST API key: MCP connector tokens are refused with 403, as they are for the other money-bearing writes. A connector can preview the move; you apply it here with an API key, or in the dashboard.
curl --request POST \
--url https://go.affixo.dev/v1/referrals/move \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"to_affiliate_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"conversion_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"referral_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
'import requests
url = "https://go.affixo.dev/v1/referrals/move"
payload = {
"to_affiliate_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"conversion_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"referral_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
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({
to_affiliate_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
conversion_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
referral_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a'
})
};
fetch('https://go.affixo.dev/v1/referrals/move', 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/referrals/move",
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([
'to_affiliate_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'conversion_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'referral_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a'
]),
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/referrals/move"
payload := strings.NewReader("{\n \"to_affiliate_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"conversion_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"referral_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\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://go.affixo.dev/v1/referrals/move")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"to_affiliate_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"conversion_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"referral_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://go.affixo.dev/v1/referrals/move")
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 \"to_affiliate_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"conversion_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"referral_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n}"
response = http.request(request)
puts response.read_body{
"object": "referral_move",
"data": {
"reassignment_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"referral_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"mode": "forward",
"from_affiliate_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"to_affiliate_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"conversions_moved": 123,
"commissions_moved": 123,
"moved_totals": [
{
"currency": "usd",
"amount": 90
}
],
"paid_stayed": 123,
"paid_totals": [
{
"currency": "usd",
"amount": 90
}
],
"kept_unpaid": 123,
"credits_future_payments": true
}
}{
"error": "invalid_json"
}{
"error": "unauthorized"
}{
"error": "plan_restricted"
}{
"error": "insufficient_scope",
"need": "write"
}{
"error": "link_not_found"
}{
"error": "move_refused",
"message": "1 of these commissions is in a payout run that hasn't been paid yet. Remove it from that run first, then move the referral.",
"hint": "<string>"
}{
"error": "affiliate_not_eligible",
"message": "Ray isn't an active affiliate, so they can't take over a referral. Approve or restore them first.",
"hint": "<string>"
}Authorizations
Workspace API key, e.g. sa_live_…. Scopes: read / write / track / *.