List invoices

Lists the caller's invoices, newest first, with the count beside them.

GET /v1/billing/invoices

Addresshttps://api.hanzo.ai/v1/billing/invoices
MethodGET
Operationget_billing_invoices
AuthAuthorization: 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

5 fields.

FieldInTypeRequiredDescription
subjectquerystring—
statusquerystring—
subscriptionIdquerystring—
limitqueryinteger—
cursorquerystring—

Response

StatusBodyMeaning
200billing.Invoicesok
defaultproblem-detailsrefused

200 body — 40 fields.

FieldInTypeAlwaysDescription
countbodyinteger (int64)—
cursorbodystring—
invoicesbodybilling.BillingInvoice[]—
invoices[].amountDuebodyinteger (int64)—
invoices[].amountPaidbodyinteger (int64)—
invoices[].attemptCountbodyinteger (int64)—
invoices[].createdAtbodystring—
invoices[].creditAppliedbodyinteger (int64)—
invoices[].currencybodystring—
invoices[].customerEmailbodystring—
invoices[].discountbodyinteger (int64)—
invoices[].dueDatebodystring—
invoices[].idbodystring—
invoices[].lineItemsbodybilling.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[].amountbodyinteger (int64)—
invoices[].lineItems[].currencybodystring—
invoices[].lineItems[].descriptionbodystring—
invoices[].lineItems[].idbodystring—
invoices[].lineItems[].meterIdbodystring—
invoices[].lineItems[].periodEndbodystring—
invoices[].lineItems[].periodStartbodystring—The billed period.
invoices[].lineItems[].planIdbodystring—
invoices[].lineItems[].planNamebodystring—
invoices[].lineItems[].quantitybodyinteger (int64)—
invoices[].lineItems[].typebodystring—
invoices[].lineItems[].unitPricebodyinteger (int64)—
invoices[].numberbodyinteger (int64)—
invoices[].numberStrbodystring—
invoices[].paidAtbodystring—
invoices[].paymentMethodbodystring—
invoices[].paymentRefbodystring—
invoices[].periodEndbodystring—
invoices[].periodStartbodystring—
invoices[].statusbodystring—
invoices[].subscriptionIdbodystring—
invoices[].subtotalbodyinteger (int64)—
invoices[].taxbodyinteger (int64)—
invoices[].updatedAtbodystring—
invoices[].userIdbodystring—
invoices[].voidedAtbodystring—

Failure carries the platform error shape — see Errors.

Examples

hanzo billing invoices list
import { 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 := hanzoai.NewConfiguration()
cfg.AddDefaultHeader("Authorization", "Bearer "+os.Getenv("HANZO_API_KEY"))
client := hanzoai.NewAPIClient(cfg)

resp, _, err := client.BillingAPI.GetBillingInvoices(context.Background()).Execute()
if err != nil {
	return err
}
use hanzo_client::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.setBearerToken(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"

MCP reaches billing through the billing tool, which names its 39 operations with its own verbs — this one among them, under a name only MCP 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": "list_billing_accounts"
         }
       }
     }'

Billing API · All Hanzo APIs · Interactive reference

Was this page useful?