curl --request POST \
--url https://go.affixo.dev/v1/commissions/quote \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"affiliate_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"amount": 123,
"currency": "<string>",
"product_id": "<string>",
"customer_email": "<string>",
"occurred_at": "2023-11-07T05:31:56Z"
}
'import requests
url = "https://go.affixo.dev/v1/commissions/quote"
payload = {
"affiliate_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"amount": 123,
"currency": "<string>",
"product_id": "<string>",
"customer_email": "<string>",
"occurred_at": "2023-11-07T05:31:56Z"
}
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({
affiliate_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
amount: 123,
currency: '<string>',
product_id: '<string>',
customer_email: '<string>',
occurred_at: '2023-11-07T05:31:56Z'
})
};
fetch('https://go.affixo.dev/v1/commissions/quote', 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/commissions/quote",
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([
'affiliate_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'amount' => 123,
'currency' => '<string>',
'product_id' => '<string>',
'customer_email' => '<string>',
'occurred_at' => '2023-11-07T05:31:56Z'
]),
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/commissions/quote"
payload := strings.NewReader("{\n \"affiliate_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"amount\": 123,\n \"currency\": \"<string>\",\n \"product_id\": \"<string>\",\n \"customer_email\": \"<string>\",\n \"occurred_at\": \"2023-11-07T05:31:56Z\"\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/commissions/quote")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"affiliate_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"amount\": 123,\n \"currency\": \"<string>\",\n \"product_id\": \"<string>\",\n \"customer_email\": \"<string>\",\n \"occurred_at\": \"2023-11-07T05:31:56Z\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://go.affixo.dev/v1/commissions/quote")
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 \"affiliate_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"amount\": 123,\n \"currency\": \"<string>\",\n \"product_id\": \"<string>\",\n \"customer_email\": \"<string>\",\n \"occurred_at\": \"2023-11-07T05:31:56Z\"\n}"
response = http.request(request)
puts response.read_body{
"object": "commission_quote",
"data": {
"earns": true,
"amount": 123,
"currency": "<string>",
"status": "<string>",
"held": true,
"hold_reason_code": "<string>",
"hold_reason_label": "Would be held for review",
"rate": 123,
"rate_is_flat": true,
"rule": "override",
"campaign_id": "<string>",
"campaign_name": "<string>",
"product_id": "<string>",
"billing_interval": "<string>",
"sale_amount": 123
}
}{
"error": "invalid_json"
}{
"error": "unauthorized"
}{
"error": "plan_restricted"
}{
"error": "insufficient_scope",
"need": "write"
}{
"error": "link_not_found"
}{
"error": "rate_limited",
"message": "<string>"
}Quote a commission
What an affiliate would earn on a sale, without recording it. The quote runs the real commission engine on a simulated sale and then discards it, so it follows the affiliate’s rate override, product and billing interval rules, the campaign default and holds. Nothing is written, emailed or paid. Requires read scope.
A quote that would be held says so in hold_reason_label. Reasons that come from your own settings are named (for example a pending affiliate or an amount threshold); any other reason reads “Would be held for review”.
Limits: 60 quotes a minute per workspace, 500 a day per user, and 2,000 a day per workspace (dashboard and API together). Calls made with API keys count as one user per workspace. Going over any of them returns 429 rate_limited with a message saying which limit you hit and when to try again.
curl --request POST \
--url https://go.affixo.dev/v1/commissions/quote \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"affiliate_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"amount": 123,
"currency": "<string>",
"product_id": "<string>",
"customer_email": "<string>",
"occurred_at": "2023-11-07T05:31:56Z"
}
'import requests
url = "https://go.affixo.dev/v1/commissions/quote"
payload = {
"affiliate_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"amount": 123,
"currency": "<string>",
"product_id": "<string>",
"customer_email": "<string>",
"occurred_at": "2023-11-07T05:31:56Z"
}
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({
affiliate_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
amount: 123,
currency: '<string>',
product_id: '<string>',
customer_email: '<string>',
occurred_at: '2023-11-07T05:31:56Z'
})
};
fetch('https://go.affixo.dev/v1/commissions/quote', 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/commissions/quote",
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([
'affiliate_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'amount' => 123,
'currency' => '<string>',
'product_id' => '<string>',
'customer_email' => '<string>',
'occurred_at' => '2023-11-07T05:31:56Z'
]),
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/commissions/quote"
payload := strings.NewReader("{\n \"affiliate_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"amount\": 123,\n \"currency\": \"<string>\",\n \"product_id\": \"<string>\",\n \"customer_email\": \"<string>\",\n \"occurred_at\": \"2023-11-07T05:31:56Z\"\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/commissions/quote")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"affiliate_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"amount\": 123,\n \"currency\": \"<string>\",\n \"product_id\": \"<string>\",\n \"customer_email\": \"<string>\",\n \"occurred_at\": \"2023-11-07T05:31:56Z\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://go.affixo.dev/v1/commissions/quote")
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 \"affiliate_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"amount\": 123,\n \"currency\": \"<string>\",\n \"product_id\": \"<string>\",\n \"customer_email\": \"<string>\",\n \"occurred_at\": \"2023-11-07T05:31:56Z\"\n}"
response = http.request(request)
puts response.read_body{
"object": "commission_quote",
"data": {
"earns": true,
"amount": 123,
"currency": "<string>",
"status": "<string>",
"held": true,
"hold_reason_code": "<string>",
"hold_reason_label": "Would be held for review",
"rate": 123,
"rate_is_flat": true,
"rule": "override",
"campaign_id": "<string>",
"campaign_name": "<string>",
"product_id": "<string>",
"billing_interval": "<string>",
"sale_amount": 123
}
}{
"error": "invalid_json"
}{
"error": "unauthorized"
}{
"error": "plan_restricted"
}{
"error": "insufficient_scope",
"need": "write"
}{
"error": "link_not_found"
}{
"error": "rate_limited",
"message": "<string>"
}Authorizations
Workspace API key, e.g. sa_live_…. Scopes: read / write / track / *.
Body
Sale amount in major units (99 = $99).
Three-letter code. Defaults to your workspace currency.
Stripe product id (prod_…) the sale is for.
one_time, month, year The buyer, so self-referral and other holds are checked.
When the sale happened. Not in the future. Defaults to now.