Send a test referral
curl --request POST \
--url https://go.affixo.dev/v1/test-referrals \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"type": "sale",
"amount": 42,
"currency": "<string>"
}
'import requests
url = "https://go.affixo.dev/v1/test-referrals"
payload = {
"type": "sale",
"amount": 42,
"currency": "<string>"
}
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({type: 'sale', amount: 42, currency: '<string>'})
};
fetch('https://go.affixo.dev/v1/test-referrals', 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/test-referrals",
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([
'type' => 'sale',
'amount' => 42,
'currency' => '<string>'
]),
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/test-referrals"
payload := strings.NewReader("{\n \"type\": \"sale\",\n \"amount\": 42,\n \"currency\": \"<string>\"\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/test-referrals")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"type\": \"sale\",\n \"amount\": 42,\n \"currency\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://go.affixo.dev/v1/test-referrals")
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 \"type\": \"sale\",\n \"amount\": 42,\n \"currency\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"object": "test_referral",
"data": {
"conversion": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"type": "<string>",
"status": "<string>",
"amount": 123,
"currency": "<string>",
"customer_name": "<string>",
"customer_email": "<string>",
"ts": "2023-11-07T05:31:56Z"
},
"affiliate": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "Affixo sample (test)"
},
"commission": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"amount": 123,
"currency": "<string>",
"status": "<string>"
}
}
}{
"error": "invalid_json"
}{
"error": "unauthorized"
}{
"error": "plan_restricted"
}{
"error": "insufficient_scope",
"need": "write"
}{
"error": "rate_limited",
"message": "<string>"
}Referrals
Send a test referral
Records one test signup or test sale, like “Send a test referral” in the dashboard, so you can check your setup without real traffic. It always goes to your workspace’s test affiliate and is marked as test data, so it never reaches payouts, risk checks, alerts, emails or reports. A test sale earns a test commission. Limited to 30 an hour per workspace. Deleting test referrals is done in the dashboard. Requires write scope.
POST
/
v1
/
test-referrals
Send a test referral
curl --request POST \
--url https://go.affixo.dev/v1/test-referrals \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"type": "sale",
"amount": 42,
"currency": "<string>"
}
'import requests
url = "https://go.affixo.dev/v1/test-referrals"
payload = {
"type": "sale",
"amount": 42,
"currency": "<string>"
}
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({type: 'sale', amount: 42, currency: '<string>'})
};
fetch('https://go.affixo.dev/v1/test-referrals', 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/test-referrals",
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([
'type' => 'sale',
'amount' => 42,
'currency' => '<string>'
]),
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/test-referrals"
payload := strings.NewReader("{\n \"type\": \"sale\",\n \"amount\": 42,\n \"currency\": \"<string>\"\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/test-referrals")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"type\": \"sale\",\n \"amount\": 42,\n \"currency\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://go.affixo.dev/v1/test-referrals")
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 \"type\": \"sale\",\n \"amount\": 42,\n \"currency\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"object": "test_referral",
"data": {
"conversion": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"type": "<string>",
"status": "<string>",
"amount": 123,
"currency": "<string>",
"customer_name": "<string>",
"customer_email": "<string>",
"ts": "2023-11-07T05:31:56Z"
},
"affiliate": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "Affixo sample (test)"
},
"commission": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"amount": 123,
"currency": "<string>",
"status": "<string>"
}
}
}{
"error": "invalid_json"
}{
"error": "unauthorized"
}{
"error": "plan_restricted"
}{
"error": "insufficient_scope",
"need": "write"
}{
"error": "rate_limited",
"message": "<string>"
}Authorizations
Workspace API key, e.g. sa_live_…. Scopes: read / write / track / *.
Body
application/json