# Create invoice

URL: https://docs.hanzo.ai/docs/openapi/billing/post-billing-subscribe-invoice

> Raises an OPEN invoice for an organization's order — the seats at the plan's price and the starting balance — and sends it to the buyer.

`POST /v1/billing/subscribe/invoice`

> [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/subscribe/invoice` |
| **Method**    | `POST`                                              |
| **Operation** | `post_billing_subscribe_invoice`                    |
| **Auth**      | `Authorization: Bearer $HANZO_API_KEY`              |

Raises an OPEN invoice for an organization's order — the seats at the plan's price and the starting balance — and sends it to the buyer. NOTHING STARTS until it is paid: "Your plan starts when we confirm your payment."

The body is a card sale's less the card and the coupon: `planId`, `quantity`, `lines`, `interval`, `balanceCents`. The organization is the one chosen with X-Org-Id (none chosen is 400), and only its admin, as IAM says now, orders (403). The answer carries the invoice, the amount due, the due date (the plan's `limits.invoiceDays`), when it is voided if unpaid (`limits.graceDays` later), the receiving bank with the reference to send exactly, the same as `howToPay` steps one field to a line, and `hostedUrl` and `pdfUrl`. A plan already paid for, or one with an invoice still open, is 409; a site that takes no order by invoice is 503. A retry under the same X-Idempotency-Key answers the same order as it stands at 200, with a new link and the bank read again; nothing is mailed again.

## Request

The document declares no body for `POST /v1/billing/subscribe/invoice`. The handler is typed in cloud but its shape is not yet emitted, so the fields are not listed here — ask MCP's `describe` for `post_billing_subscribe_invoice`, which answers from the running route.

## Response

The document declares no response body for this operation. It answers `200` on success and the platform error shape on failure — see [Errors](https://docs.hanzo.ai/docs/errors).

## Examples

**CLI**

```bash
hanzo billing subscribe invoice
```

**SDK**

**.ts**

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

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

**.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).post_billing_subscribe_invoice()
```

**.go**

```go
cfg := hanzoai.NewConfiguration()
cfg.AddDefaultHeader("Authorization", "Bearer "+os.Getenv("HANZO_API_KEY"))
client := hanzoai.NewAPIClient(cfg)

resp, _, err := client.BillingAPI.PostBillingSubscribeInvoice(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::post_billing_subscribe_invoice(&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).postBillingSubscribeInvoice();
```

The method above is the one at the current release of the document. `hanzoai@8.5.914` (npm) and `hanzoai@8.5.914` (PyPI) were generated from an earlier release, where this operation carried a different id, so it spells the method differently — regenerating the clients is what makes the two agree. [SDKs →](https://docs.hanzo.ai/docs/sdks)

**HTTP**

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

**MCP**

MCP reaches **billing** through the `billing` tool, which names its 45 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)
