Hanzo
OpenapiBilling

Issue a draft invoice, making it collectible

Issues a draft invoice: moves it to OPEN, assigns its number, and makes it collectible. Only a draft can be issued.

POST /v1/billing/invoices/{id}/issue

Addresshttps://api.hanzo.ai/v1/billing/invoices/{id}/issue
MethodPOST
OperationissueInvoice
AuthAuthorization: Bearer $HANZO_API_KEY

Issues a draft invoice: moves it to OPEN, assigns its number, and makes it collectible.

Only a draft can be issued. An invoice already open, paid or void is refused with the state machine's own reason rather than being silently re-issued, which would mint a second number for one debt.

A named handler, not a closure, so zipdoc can lift this prose into the registry.

Request

1 field.

FieldInTypeRequiredDescription
idpathstringyesID is the invoice id.

Response

StatusBodyMeaning
200Invoiceok

200 body — 16 fields.

FieldInTypeAlwaysDescription
amountDueCentsbodyintegerAmountDueCents is what remains collectible.
amountPaidCentsbodyintegerAmountPaidCents is what has been collected so far.
createdAtbodystringCreatedAt is when the draft was raised, RFC3339.
currencybodystringCurrency is the ISO 4217 code.
customerEmailbodystringCustomerEmail is where it is sent.
idbodystringID is the invoice id — what the issue, collect and void ops address.
linesbodyInvoiceLine[]Lines are the charges on the invoice.
lines[].amountbodyintegerAmount is the line total in whole cents (250000 is $2,500.00).
lines[].descriptionbodystringDescription is the human-readable line, e.g.
lines[].quantitybodyintegerQuantity is the number of units, when the line is metered.
lines[].unitPricebodyintegerUnitPrice is the per-unit price in cents, when the line is metered.
numberbodystringNumber is the human-facing invoice number, e.g.
paymentRefbodystringPaymentRef is the processor reference for the collection, once paid.
statusbodystringStatus is draft, open, paid, void or uncollectible.
subtotalCentsbodyintegerSubtotalCents is the sum of the lines.
userIdbodystringUserID is the customer billed.

Failure carries the platform error shape — see Errors.

Examples

hanzo billing invoices issue <id>

Billing API · All Hanzo APIs · Interactive reference

How is this guide?

On this page