Billing

Get Invoice Tenant Breakdown

Split one invoice's total across the tenants it charges for.

Use this to re-bill: the list endpoint tells you what you owe, this tells you who incurred it. Each line is traced through its subscription item to the tenant holding that license, and amounts are summed per tenant.

total_cents always equals the sum of tenants[].amount_cents plus unallocated_cents, so the split reconciles to what is actually owed rather than to a pre-tax subtotal. Charges that belong to no tenant — one-off items, invoice-level discounts, credits, tax — land in unallocated_cents, which can be negative when a credit exceeds them.

lines carries every line on the invoice regardless, each naming the tenant it reached or, in unallocated_reason, why it reached none. That is what an invoice with nothing tenant-attributable returns instead of a bare unallocated_cents equal to the total.

Draft invoices return 404.

Requires the billing_report permission.

get/payments/invoices/{invoice_id}/breakdown

Request

  • Base URL: https://ai.hatz.ai/v1
  • URL: https://ai.hatz.ai/v1/payments/invoices/{invoice_id}/breakdown
  • Auth: API key in header X-API-Key

Path parameters

invoice_idstring required

Stripe invoice ID, as returned by GET /payments/invoices.

Query parameters

entity_idstring nullable

Which of your organizations the invoice belongs to. Required only if you hold billing access to more than one.

Response

Successful Response

invoice_idstring required
statusstring nullable

The invoice's Stripe status. A void or uncollectible invoice splits across tenants exactly like a live one, but the underlying bill is not owed and must not be re-issued.

currencystring required
total_centsinteger required

Invoice total in the smallest currency unit (cents for USD). Stripe does not reduce this when a credit note is issued against a finalized invoice.

unallocated_centsinteger required

Total minus everything attributable to a tenant: one-off charges, lines with no matching tenant, and invoice-level discounts, credits and tax. Can be negative when a credit exceeds the unattributed lines.

lines_truncatedboolean required

True when the invoice carried more lines than this response returns. The tenant amounts and unallocated_cents are computed from every line either way and remain exact; only lines is shortened.

Changes

No recorded changes to this operation across all 1 revision of this API.