curl --request GET \
--url https://api.1club.ai/v1/platform/revenue-accounts \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.1club.ai/v1/platform/revenue-accounts"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.1club.ai/v1/platform/revenue-accounts', 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.1club.ai/v1/platform/revenue-accounts",
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.1club.ai/v1/platform/revenue-accounts"
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.1club.ai/v1/platform/revenue-accounts")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.1club.ai/v1/platform/revenue-accounts")
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{
"data": [
{
"id": 123,
"name": "<string>",
"code": "<string>",
"description": "<string>",
"isActive": true,
"isDefault": true
}
]
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}List revenue accounts
Returns the organization’s chart of accounts, ordered by code. This is how a revenueAccountId is resolved before creating or updating a membership plan or a product - a sale of that item then posts to the account named here.
Adding or renaming an account changes how every future sale is reported and what the club’s accountant reconciles against, so the writes are gated on revenue-accounts:write, which nothing else grants. There is no delete: every historical row pointing at an account would be stranded, so an account is taken out of use with isActive: false.
Retired accounts are included, flagged with isActive: false: an existing plan or product may still point at one, so the id has to stay explicable. Do not attach one to something new.
Readable with any scope that carries a revenue account id: the plans, products, classes, areas and instructors scopes (read and write - they are granted independently), plus transactions:read and revenue-accounts:write. Every one of those resources either reports revenueAccountId or accepts it, so requiring one scope in particular would leave a key able to set an account it cannot look up. There is no revenue-accounts:read.
Leaving revenueAccountId unset is a valid choice: the sale then posts to whichever account the organization has marked isDefault, resolved at the time of the sale rather than frozen onto the item.
curl --request GET \
--url https://api.1club.ai/v1/platform/revenue-accounts \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.1club.ai/v1/platform/revenue-accounts"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.1club.ai/v1/platform/revenue-accounts', 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.1club.ai/v1/platform/revenue-accounts",
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.1club.ai/v1/platform/revenue-accounts"
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.1club.ai/v1/platform/revenue-accounts")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.1club.ai/v1/platform/revenue-accounts")
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{
"data": [
{
"id": 123,
"name": "<string>",
"code": "<string>",
"description": "<string>",
"isActive": true,
"isDefault": true
}
]
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}Was this page helpful?