# List invoices

URL: https://docs.hanzo.ai/docs/openapi/billing/get-billing-invoices

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

`GET /v1/billing/invoices`

> [Billing →](https://docs.hanzo.ai/docs/openapi/billing) · [All API references →](https://docs.hanzo.ai/docs/openapi) · [Get started →](https://docs.hanzo.ai/docs/guides)

|               |                                            |
| ------------- | ------------------------------------------ |
| **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

5 fields.

| Field            | In    | Type    | Required | Description |
| ---------------- | ----- | ------- | -------- | ----------- |
| `subject`        | query | string  | —        |             |
| `status`         | query | string  | —        |             |
| `subscriptionId` | query | string  | —        |             |
| `limit`          | query | integer | —        |             |
| `cursor`         | query | string  | —        |             |

## Response

| Status    | Body             | Meaning |
| --------- | ---------------- | ------- |
| `200`     | billing.Invoices | ok      |
| `default` | problem-details  | refused |

`200` body — 40 fields.

| Field                                | In   | Type                       | Always | Description                                                                                                                            |
| ------------------------------------ | ---- | -------------------------- | ------ | -------------------------------------------------------------------------------------------------------------------------------------- |
| `count`                              | body | integer (int64)            | —      |                                                                                                                                        |
| `cursor`                             | body | string                     | —      |                                                                                                                                        |
| `invoices`                           | body | billing.BillingInvoice\[]  | —      |                                                                                                                                        |
| `invoices[].amountDue`               | body | integer (int64)            | —      |                                                                                                                                        |
| `invoices[].amountPaid`              | body | integer (int64)            | —      |                                                                                                                                        |
| `invoices[].attemptCount`            | body | integer (int64)            | —      |                                                                                                                                        |
| `invoices[].createdAt`               | body | string                     | —      |                                                                                                                                        |
| `invoices[].creditApplied`           | body | integer (int64)            | —      |                                                                                                                                        |
| `invoices[].currency`                | body | string                     | —      |                                                                                                                                        |
| `invoices[].customerEmail`           | body | string                     | —      |                                                                                                                                        |
| `invoices[].discount`                | body | integer (int64)            | —      |                                                                                                                                        |
| `invoices[].dueDate`                 | body | string                     | —      |                                                                                                                                        |
| `invoices[].id`                      | body | string                     | —      |                                                                                                                                        |
| `invoices[].lineItems`               | body | billing.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 (int64)            | —      |                                                                                                                                        |
| `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.                                                                                                                     |
| `invoices[].lineItems[].planId`      | body | string                     | —      |                                                                                                                                        |
| `invoices[].lineItems[].planName`    | body | string                     | —      |                                                                                                                                        |
| `invoices[].lineItems[].quantity`    | body | integer (int64)            | —      |                                                                                                                                        |
| `invoices[].lineItems[].type`        | body | string                     | —      |                                                                                                                                        |
| `invoices[].lineItems[].unitPrice`   | body | integer (int64)            | —      |                                                                                                                                        |
| `invoices[].number`                  | body | integer (int64)            | —      |                                                                                                                                        |
| `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 (int64)            | —      |                                                                                                                                        |
| `invoices[].tax`                     | body | integer (int64)            | —      |                                                                                                                                        |
| `invoices[].updatedAt`               | body | string                     | —      |                                                                                                                                        |
| `invoices[].userId`                  | body | string                     | —      |                                                                                                                                        |
| `invoices[].voidedAt`                | body | string                     | —      |                                                                                                                                        |

Failure carries the platform error shape — see [Errors](https://docs.hanzo.ai/docs/errors).

## Examples

**CLI**

```bash
hanzo billing invoices list
```

**SDK**

**.ts**

```ts
import { Configuration, BillingApi } from 'hanzoai';

const api = new BillingApi(new Configuration({ accessToken: process.env.HANZO_API_KEY }));
const { data } = await api.getBillingInvoices();
```

**.py**

```python
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()
```

**.go**

```go
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
}
```

**.rs**

```rust
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?;
```

**.java**

```java
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();
```

**HTTP**

```bash
curl https://api.hanzo.ai/v1/billing/invoices \
  -H "Authorization: Bearer $HANZO_API_KEY"
```

**MCP**

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:

```bash
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](https://docs.hanzo.ai/docs/openapi/billing) · [All Hanzo APIs](https://docs.hanzo.ai/docs/openapi) · [Interactive reference](https://docs.hanzo.ai/docs/openapi/reference)
