Read the confirmed status of an organisation purchase
curl --request GET \
--url https://api.trycarhub.com/mgmt/v1/billing/purchases/{purchaseID} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.trycarhub.com/mgmt/v1/billing/purchases/{purchaseID}"
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/purchases/{purchaseID}', 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/purchases/{purchaseID}",
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/purchases/{purchaseID}"
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/purchases/{purchaseID}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.trycarhub.com/mgmt/v1/billing/purchases/{purchaseID}")
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{
"purchase_id": "<string>",
"status": "<string>",
"credits": 123,
"recovery_url": "<string>"
}{
"error": {
"type": "authentication",
"code": "invalid_api_key",
"message": "The provided API key is invalid or has been revoked.",
"param": null,
"doc_url": "https://docs.trycarhub.com/errors/invalid_api_key",
"request_id": "req_2Kd8xQmPvL4T"
}
}{
"error": {
"type": "not_found",
"code": "job_not_found",
"message": "No job with id `job_3ZxK9pQr7TnW`.",
"param": "id",
"doc_url": "https://docs.trycarhub.com/errors/job_not_found",
"request_id": "req_2Kd8xQmPvL4T"
}
}API Reference
Read the confirmed status of an organisation purchase
GET
/
mgmt
/
v1
/
billing
/
purchases
/
{purchaseID}
Read the confirmed status of an organisation purchase
curl --request GET \
--url https://api.trycarhub.com/mgmt/v1/billing/purchases/{purchaseID} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.trycarhub.com/mgmt/v1/billing/purchases/{purchaseID}"
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/purchases/{purchaseID}', 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/purchases/{purchaseID}",
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/purchases/{purchaseID}"
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/purchases/{purchaseID}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.trycarhub.com/mgmt/v1/billing/purchases/{purchaseID}")
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{
"purchase_id": "<string>",
"status": "<string>",
"credits": 123,
"recovery_url": "<string>"
}{
"error": {
"type": "authentication",
"code": "invalid_api_key",
"message": "The provided API key is invalid or has been revoked.",
"param": null,
"doc_url": "https://docs.trycarhub.com/errors/invalid_api_key",
"request_id": "req_2Kd8xQmPvL4T"
}
}{
"error": {
"type": "not_found",
"code": "job_not_found",
"message": "No job with id `job_3ZxK9pQr7TnW`.",
"param": "id",
"doc_url": "https://docs.trycarhub.com/errors/job_not_found",
"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/….