Preview moving a referral
curl --request POST \
--url https://go.affixo.dev/v1/referrals/move/preview \
--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/preview"
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/preview', 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/preview",
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/preview"
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/preview")
.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/preview")
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_preview",
"data": {
"subject": "<string>",
"from_affiliate_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"from_name": "<string>",
"to_affiliate_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"to_name": "<string>",
"conversions": 123,
"unpaid_count": 123,
"unpaid_totals": [
{
"currency": "usd",
"amount": 90
}
],
"paid_count": 123,
"paid_totals": [
{
"currency": "usd",
"amount": 90
}
],
"kept_unpaid_count": 123,
"in_run_count": 123,
"has_customer_identity": true,
"credits_future_payments": true,
"credit_campaign_name": "<string>"
}
}{
"error": "invalid_json"
}{
"error": "unauthorized"
}{
"error": "plan_restricted"
}{
"error": "insufficient_scope",
"need": "write"
}{
"error": "link_not_found"
}{
"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>"
}Referrals
Preview moving a referral
What moving a referral (a referred customer) to another affiliate would do, exactly as the dashboard’s Move dialog shows it. Nothing changes. Name the customer by referral_id, or by any of their sales with conversion_id (for example an id from GET /v1/conversions). A new affiliate who can’t take the referral is refused here as the move would refuse it. Requires read scope.
POST
/
v1
/
referrals
/
move
/
preview
Preview moving a referral
curl --request POST \
--url https://go.affixo.dev/v1/referrals/move/preview \
--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/preview"
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/preview', 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/preview",
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/preview"
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/preview")
.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/preview")
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_preview",
"data": {
"subject": "<string>",
"from_affiliate_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"from_name": "<string>",
"to_affiliate_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"to_name": "<string>",
"conversions": 123,
"unpaid_count": 123,
"unpaid_totals": [
{
"currency": "usd",
"amount": 90
}
],
"paid_count": 123,
"paid_totals": [
{
"currency": "usd",
"amount": 90
}
],
"kept_unpaid_count": 123,
"in_run_count": 123,
"has_customer_identity": true,
"credits_future_payments": true,
"credit_campaign_name": "<string>"
}
}{
"error": "invalid_json"
}{
"error": "unauthorized"
}{
"error": "plan_restricted"
}{
"error": "insufficient_scope",
"need": "write"
}{
"error": "link_not_found"
}{
"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 / *.
Body
application/json