Create 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

Addresshttps://api.hanzo.ai/v1/billing/subscribe/invoice
MethodPOST
Operationpost_billing_subscribe_invoice
AuthAuthorization: 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.

Examples

hanzo billing subscribe invoice
import { Configuration, BillingApi } from 'hanzoai';

const api = new BillingApi(new Configuration({ accessToken: process.env.HANZO_API_KEY }));
const { data } = await api.postBillingSubscribeInvoice();
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()
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
}
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?;
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. [email protected] (npm) and [email protected] (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 →

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

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:

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?
Broken link or missing step? Drop it in #docs on Discord or open a PR.