curl --request GET \
--url https://api.mainnet.aptoslabs.com/decibel/api/v1/affiliates/codes/{account} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.mainnet.aptoslabs.com/decibel/api/v1/affiliates/codes/{account}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.mainnet.aptoslabs.com/decibel/api/v1/affiliates/codes/{account}', 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://api.mainnet.aptoslabs.com/decibel/api/v1/affiliates/codes/{account}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.mainnet.aptoslabs.com/decibel/api/v1/affiliates/codes/{account}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.mainnet.aptoslabs.com/decibel/api/v1/affiliates/codes/{account}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.mainnet.aptoslabs.com/decibel/api/v1/affiliates/codes/{account}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"codes": [
{
"created_at_ms": 123,
"is_active": true,
"is_affiliate": true,
"max_usage": 1,
"owner_account": "<string>",
"referral_code": "<string>",
"source": "admin",
"usage_count": 1,
"code_type": "<string>"
}
],
"owner_account": "<string>",
"volume_threshold_met": true,
"is_builder": true
}GET /api/v1/affiliates/codes/{account}
Returns referral codes owned by an account with per-code usage stats. Affiliate codes (is_affiliate = true) are always returned. Non-affiliate codes are only returned if the account has >= $1,000 all-time trade volume. Maps to the Affiliates dashboard.
curl --request GET \
--url https://api.mainnet.aptoslabs.com/decibel/api/v1/affiliates/codes/{account} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.mainnet.aptoslabs.com/decibel/api/v1/affiliates/codes/{account}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.mainnet.aptoslabs.com/decibel/api/v1/affiliates/codes/{account}', 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://api.mainnet.aptoslabs.com/decibel/api/v1/affiliates/codes/{account}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.mainnet.aptoslabs.com/decibel/api/v1/affiliates/codes/{account}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.mainnet.aptoslabs.com/decibel/api/v1/affiliates/codes/{account}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.mainnet.aptoslabs.com/decibel/api/v1/affiliates/codes/{account}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"codes": [
{
"created_at_ms": 123,
"is_active": true,
"is_affiliate": true,
"max_usage": 1,
"owner_account": "<string>",
"referral_code": "<string>",
"source": "admin",
"usage_count": 1,
"code_type": "<string>"
}
],
"owner_account": "<string>",
"volume_threshold_met": true,
"is_builder": true
}Authorizations
Bearer token from Geomi. See Authentication for setup instructions.
Path Parameters
The owner's wallet address (not a subaccount address)
Response
Affiliate codes with usage stats
Response wrapper for the affiliate codes endpoint
List of affiliate codes with usage stats
Show child attributes
Show child attributes
The owner's wallet address
Whether the account meets the minimum trade volume threshold to see non-affiliate (auto-generated) codes
Ops have provisioned a builder code for this owner. Builders see a reduced landing instead of the affiliate portal.

