Lists the caller's invoices, newest first, with the count beside them.
Lists the caller's invoices, newest first, with the count beside them.
GET /v1/billing/invoices
| Address | https://api.hanzo.ai/v1/billing/invoices |
| Method | GET |
| Operation | get_billing_invoices |
| Auth | Authorization: Bearer $HANZO_API_KEY |
Lists the caller's invoices, newest first, with the count beside them.
It is scoped to the caller's own billing subject — the wallet this request bills from, resolved server-side — so a query cannot widen it to another customer of the same org. An org with no invoices is an empty list, not a refusal.
A named handler, not a closure, so zipdoc can lift this prose into the registry.
Request
GET /v1/billing/invoices takes no parameters and no body — the credential is the whole request.
Response
| Status | Body | Meaning |
|---|---|---|
200 | Invoices | ok |
200 body — 39 fields.
| Field | In | Type | Always | Description |
|---|---|---|---|---|
count | body | integer | — | |
invoices | body | BillingInvoice[] | — | |
invoices[].amountDue | body | integer | — | |
invoices[].amountPaid | body | integer | — | |
invoices[].attemptCount | body | integer | — | |
invoices[].createdAt | body | string | — | |
invoices[].creditApplied | body | integer | — | |
invoices[].currency | body | string | — | |
invoices[].customerEmail | body | string | — | |
invoices[].discount | body | integer | — | |
invoices[].dueDate | body | string | — | |
invoices[].id | body | string | — | |
invoices[].lineItems | body | InvoiceLineItem[] | — | LineItems carries no omitempty and is never allocated empty, because the wire it reproduces sends null for an invoice with no lines. |
invoices[].lineItems[].amount | body | integer | — | |
invoices[].lineItems[].currency | body | string | — | |
invoices[].lineItems[].description | body | string | — | |
invoices[].lineItems[].id | body | string | — | |
invoices[].lineItems[].meterId | body | string | — | |
invoices[].lineItems[].periodEnd | body | string | — | |
invoices[].lineItems[].periodStart | body | string | — | The billed period. Both carry omitempty and neither is ever empty, which looks contradictory and is not: the shape they reproduce is a time value, and… |
invoices[].lineItems[].planId | body | string | — | |
invoices[].lineItems[].planName | body | string | — | |
invoices[].lineItems[].quantity | body | integer | — | |
invoices[].lineItems[].type | body | string | — | |
invoices[].lineItems[].unitPrice | body | integer | — | |
invoices[].number | body | integer | — | |
invoices[].numberStr | body | string | — | |
invoices[].paidAt | body | string | — | |
invoices[].paymentMethod | body | string | — | |
invoices[].paymentRef | body | string | — | |
invoices[].periodEnd | body | string | — | |
invoices[].periodStart | body | string | — | |
invoices[].status | body | string | — | |
invoices[].subscriptionId | body | string | — | |
invoices[].subtotal | body | integer | — | |
invoices[].tax | body | integer | — | |
invoices[].updatedAt | body | string | — | |
invoices[].userId | body | string | — | |
invoices[].voidedAt | body | string | — |
Failure carries the platform error shape — see Errors.
Examples
hanzo billing invoices listimport { Configuration, BillingApi } from 'hanzoai';
const api = new BillingApi(new Configuration({ accessToken: process.env.HANZO_API_KEY }));
const { data } = await api.getBillingInvoices();from hanzoai.cloud import ApiClient, Configuration
from hanzoai.cloud.api import BillingApi
client = ApiClient(Configuration(access_token=os.environ["HANZO_API_KEY"]))
result = BillingApi(client).get_billing_invoices()cfg := cloud.NewConfiguration()
cfg.AddDefaultHeader("Authorization", "Bearer "+os.Getenv("HANZO_API_KEY"))
client := cloud.NewAPIClient(cfg)
resp, _, err := client.BillingAPI.GetBillingInvoices(context.Background()).Execute()
if err != nil {
return err
}use hanzo_cloud::apis::{configuration::Configuration, billing_api};
let mut cfg = Configuration::new();
cfg.bearer_access_token = std::env::var("HANZO_API_KEY").ok();
let result = billing_api::get_billing_invoices(&cfg, Default::default()).await?;import ai.hanzo.cloud.ApiClient;
import ai.hanzo.cloud.api.BillingApi;
ApiClient client = new ApiClient();
client.setRequestInterceptor(b -> b.header("Authorization", "Bearer " + System.getenv("HANZO_API_KEY")));
var result = new BillingApi(client).getBillingInvoices();curl https://api.hanzo.ai/v1/billing/invoices \
-H "Authorization: Bearer $HANZO_API_KEY"The door reaches billing through the billing tool, which names its 9 operations with its own verbs — this one among them, under a name only the door declares. describe explains any of them:
curl -X POST https://api.hanzo.ai/v1/mcp \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "describe",
"arguments": {
"op": "get_billing_balance"
}
}
}'How is this guide?