Get Billing History
curl --request GET \
--url https://api.example.com/api/billing/historyimport requests
url = "https://api.example.com/api/billing/history"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.example.com/api/billing/history', 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.example.com/api/billing/history",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$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.example.com/api/billing/history"
req, _ := http.NewRequest("GET", url, nil)
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.example.com/api/billing/history")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/billing/history")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body[
{
"amount": 123,
"date": "<string>",
"id": "<string>",
"invoice_type": "<string>",
"status": "<string>",
"amount_due": 0,
"billing_period": "<string>",
"due_date": "<string>",
"has_pdf": true,
"move_type": "<string>",
"organization_id": "<string>",
"payable": false,
"payment_state": "<string>",
"portal_url": "<string>"
}
]{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"ctx": {},
"input": "<unknown>"
}
]
}Billing
Get Billing History
Unified billing history across personal + every workspace the caller
can see.
Query param ``workspace`` (optional):
* absent / "" / "all" — return personal rows + every org the user is
owner/admin of, each tagged with ``organization_id`` (null on personal
rows).
* "personal" — personal rows only.
* <org-uuid> — that org only; 403 if the user isn't an
owner/admin of it.
Every row carries ``organization_id`` so the client can label/filter by
workspace without a second round-trip.
Sources merged per scope:
* Stripe.Invoice.list on the caller's Stripe customer — surfaces
personal top-ups + org top-ups the caller triggered (org cards live
on the attacher's personal Stripe customer, with seacobra_org_id in
metadata so we bucket them correctly).
* Odoo monthly usage invoices, queried per scope (user_id or
organization_id).
* BalanceTransaction credit_grant / adjustment rows (local fallback for
admin grants).
GET
/
api
/
billing
/
history
Get Billing History
curl --request GET \
--url https://api.example.com/api/billing/historyimport requests
url = "https://api.example.com/api/billing/history"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.example.com/api/billing/history', 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.example.com/api/billing/history",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$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.example.com/api/billing/history"
req, _ := http.NewRequest("GET", url, nil)
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.example.com/api/billing/history")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/billing/history")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body[
{
"amount": 123,
"date": "<string>",
"id": "<string>",
"invoice_type": "<string>",
"status": "<string>",
"amount_due": 0,
"billing_period": "<string>",
"due_date": "<string>",
"has_pdf": true,
"move_type": "<string>",
"organization_id": "<string>",
"payable": false,
"payment_state": "<string>",
"portal_url": "<string>"
}
]{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"ctx": {},
"input": "<unknown>"
}
]
}Response
Successful Response