Read balances and billing state
curl --request GET \
--url https://api.trycarhub.com/mgmt/v1/billing/overview \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.trycarhub.com/mgmt/v1/billing/overview"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.trycarhub.com/mgmt/v1/billing/overview', 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.trycarhub.com/mgmt/v1/billing/overview",
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.trycarhub.com/mgmt/v1/billing/overview"
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.trycarhub.com/mgmt/v1/billing/overview")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.trycarhub.com/mgmt/v1/billing/overview")
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{
"object": "billing_overview",
"live_balance": 123,
"test_balance": 123,
"currency": "<string>",
"plan_id": "<string>",
"live_credits": {
"permanent": 123,
"monthly": 123,
"reserved": 123,
"debt": 123,
"available": 123,
"expired": 123,
"next_expiration": "2023-11-07T05:31:56Z"
},
"test_credits": {
"permanent": 123,
"monthly": 123,
"reserved": 123,
"debt": 123,
"available": 123,
"expired": 123,
"next_expiration": "2023-11-07T05:31:56Z"
},
"subscription": {
"status": "<string>",
"paid_plan_id": "<string>",
"paid_until": "2023-11-07T05:31:56Z",
"cancel_at_period_end": true,
"organization_id": "<string>",
"stripe_subscription_id": "<string>",
"stripe_customer_id": "<string>",
"paid_price_id": "<string>",
"price_minor": 123,
"currency": "<string>",
"period_allowance": 123,
"concurrent_jobs": 123,
"period_start": "2023-11-07T05:31:56Z",
"period_end": "2023-11-07T05:31:56Z",
"scheduled_plan_id": "<string>",
"schedule_id": "<string>",
"recovery_url": "<string>",
"legacy_unsynced": true,
"updated_at": "2023-11-07T05:31:56Z"
},
"operations": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"organization_id": "<string>",
"kind": "checkout",
"status": "preview",
"idempotency_key": "<string>",
"payment_amount": 123,
"extra_credits": 123,
"actor_id": "<string>",
"actor_type": "hub",
"reason": "<string>",
"target_price_id": "<string>",
"target_plan_id": "<string>",
"subscription_id": "<string>",
"proration_date": 123,
"period_start": "2023-11-07T05:31:56Z",
"period_end": "2023-11-07T05:31:56Z",
"expires_at": "2023-11-07T05:31:56Z",
"stripe_invoice_id": "<string>",
"stripe_checkout_session_id": "<string>",
"stripe_schedule_id": "<string>",
"recovery_url": "<string>",
"before": {},
"after": {},
"error": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}
],
"billing_country": "<string>",
"auto_reload": {}
}{
"error": {
"type": "permission",
"code": "scope_not_granted",
"message": "This API key is not scoped for the `render` endpoint family.",
"param": null,
"doc_url": "https://docs.trycarhub.com/errors/scope_not_granted",
"request_id": "req_2Kd8xQmPvL4T"
}
}Management
Read balances and billing state
Minimum role: owner, admin, or billing_manager.
GET
/
mgmt
/
v1
/
billing
/
overview
Read balances and billing state
curl --request GET \
--url https://api.trycarhub.com/mgmt/v1/billing/overview \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.trycarhub.com/mgmt/v1/billing/overview"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.trycarhub.com/mgmt/v1/billing/overview', 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.trycarhub.com/mgmt/v1/billing/overview",
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.trycarhub.com/mgmt/v1/billing/overview"
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.trycarhub.com/mgmt/v1/billing/overview")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.trycarhub.com/mgmt/v1/billing/overview")
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{
"object": "billing_overview",
"live_balance": 123,
"test_balance": 123,
"currency": "<string>",
"plan_id": "<string>",
"live_credits": {
"permanent": 123,
"monthly": 123,
"reserved": 123,
"debt": 123,
"available": 123,
"expired": 123,
"next_expiration": "2023-11-07T05:31:56Z"
},
"test_credits": {
"permanent": 123,
"monthly": 123,
"reserved": 123,
"debt": 123,
"available": 123,
"expired": 123,
"next_expiration": "2023-11-07T05:31:56Z"
},
"subscription": {
"status": "<string>",
"paid_plan_id": "<string>",
"paid_until": "2023-11-07T05:31:56Z",
"cancel_at_period_end": true,
"organization_id": "<string>",
"stripe_subscription_id": "<string>",
"stripe_customer_id": "<string>",
"paid_price_id": "<string>",
"price_minor": 123,
"currency": "<string>",
"period_allowance": 123,
"concurrent_jobs": 123,
"period_start": "2023-11-07T05:31:56Z",
"period_end": "2023-11-07T05:31:56Z",
"scheduled_plan_id": "<string>",
"schedule_id": "<string>",
"recovery_url": "<string>",
"legacy_unsynced": true,
"updated_at": "2023-11-07T05:31:56Z"
},
"operations": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"organization_id": "<string>",
"kind": "checkout",
"status": "preview",
"idempotency_key": "<string>",
"payment_amount": 123,
"extra_credits": 123,
"actor_id": "<string>",
"actor_type": "hub",
"reason": "<string>",
"target_price_id": "<string>",
"target_plan_id": "<string>",
"subscription_id": "<string>",
"proration_date": 123,
"period_start": "2023-11-07T05:31:56Z",
"period_end": "2023-11-07T05:31:56Z",
"expires_at": "2023-11-07T05:31:56Z",
"stripe_invoice_id": "<string>",
"stripe_checkout_session_id": "<string>",
"stripe_schedule_id": "<string>",
"recovery_url": "<string>",
"before": {},
"after": {},
"error": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}
],
"billing_country": "<string>",
"auto_reload": {}
}{
"error": {
"type": "permission",
"code": "scope_not_granted",
"message": "This API key is not scoped for the `render` endpoint family.",
"param": null,
"doc_url": "https://docs.trycarhub.com/errors/scope_not_granted",
"request_id": "req_2Kd8xQmPvL4T"
}
}Authorizations
Short-lived JWT issued by the CarHub auth service (Better Auth), verified against its
JWKS. Claims: sub (user), org_id (active organisation) and role
(owner | admin | member | billing_manager). Used by the dashboard for /mgmt/v1/… only — it is never
accepted on /v1/….
Response
Billing overview
Allowed value:
"billing_overview"Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes