Skip to content
Hardcount
Run it locally
Pre-1.0 · one maintainer · Stripe and cards only · no SDKs (client libraries) yet · no production users yet. Docs describe v0.12.0 (30 Nov 2026) · What’s new →

The invoice line item object

One line on an invoice: a base fee, a usage charge or another charge. Amounts are whole numbers in the currency’s minor unit (cents for USD). GET /v1/invoices/{id} returns the lines, and POST /v1/invoices/{id}/line-items returns the line it added.

{
"id": "hc_ili_dbj84baq3gpgqfoq5c4g",
"invoice_id": "hc_inv_dbj84b2q3gpgqfoq5c40",
"tenant_id": "hc_ten_dajqj02q3gpgqfoq5c00",
"line_type": "usage",
"meter_id": "hc_mtr_dajr122q3gpgqfoq5c10",
"meter_unit": "tokens",
"description": "Tokens (tokens)",
"quantity": "12500000",
"unit_amount_decimal": "0.0003",
"amount_cents": 3750,
"tax_rate": 0,
"tax_amount_cents": 0,
"total_amount_cents": 3750,
"currency": "USD",
"pricing_mode": "per_unit",
"price_id": "hc_prc_dajr672q3gpgqfoq5c20",
"billing_period_start": "2026-10-01T00:00:00Z",
"billing_period_end": "2026-11-01T00:00:00Z",
"created_at": "2026-11-01T00:05:00Z"
}
Field Type Always present What it means
id string Yes Unique identifier of the line, starting hc_ili_.
invoice_id string Yes The invoice the line is on.
tenant_id string No The account the line belongs to. Absent when empty.
line_type enum Yes What an invoice line charges for. base_fee: a plan’s flat fee for the period. usage: metered usage, priced by a plan price. add_on: any other charge, such as a line you add to a draft (the default for those). One of: base_fee, usage, add_on.
meter_id string No On a usage line, the meter that measured the usage. Absent on other lines.
meter_unit string No On a usage line, the meter’s unit (“tokens”, “seconds”, …), as it was when the line was written, so prices can be shown per unit the way the pricing pages show them (token rates read “$3.00 / 1M tokens”). Absent on other lines, and on usage lines written before releases recorded it.
description string Yes The line’s text as printed on the invoice. A base fee reads like “Pro - base fee”; a usage line names the meter and its unit, or the labels its price takes, like “Tokens (tokens)”.
quantity string Yes The line’s exact quantity as a decimal string, for example “3” or “1.5”. Line amounts stay whole cents.
unit_amount_decimal string Yes The unit price, a decimal string of cents at full precision, for example “0.3” for $0.003. On a usage line priced per_unit it is that rate; on any other line it is amount_cents ÷ quantity. Line amounts and totals stay whole cents.
amount_cents integer (int64) Yes The line’s amount before tax, in the currency’s minor unit (cents for USD). With tax-inclusive prices, it is the net amount after the tax is taken out.
tax_rate number (double) Yes Tax rate on the line as a percent, up to four decimal places (18.5 means 18.5%).
tax_amount_cents integer (int64) Yes Tax on the line, in the currency’s minor unit (cents for USD).
tax_jurisdiction string No The tax jurisdiction the provider named for the line. Absent when none was given.
tax_code string No The product tax code the line was taxed under (for Stripe Tax, a txcd_… code). Absent when none was used.
tax_reason string No Why the line was taxed as it was, in Stripe Tax’s words (standard_rated, reverse_charge, not_collecting, customer_exempt, product_exempt, zero_rated and others). prepaid_credit_purchase is Hardcount’s own value, on a prepaid commit purchase line under the manual or Stripe Tax provider: the line is not taxed, and the usage the credit pays for is taxed when invoiced. Otherwise absent for providers other than Stripe Tax.
total_amount_cents integer (int64) Yes The line’s amount plus its tax, in the currency’s minor unit (cents for USD).
currency string Yes The line’s currency, the same as the invoice’s.
pricing_mode string No On a usage line, the shape of its price: per_unit, graduated or package. Absent on other lines.
price_id string No On a usage line, the plan price that billed it. Absent on other lines.
dimension_match object No On a usage line, the labels its price takes. Absent for a price that takes every event, and on other lines.
billing_period_start string (date-time) No Start of the time the line bills for (included). Absent on lines with no period of their own, such as lines you add to a draft.
billing_period_end string (date-time) No End of the time the line bills for (not included). Absent on lines with no period of their own.
metadata object No Extra key-value data stored with the line. No API request sets it; it is absent when empty.
created_at string (date-time) Yes When the line was written.
commit_granted_cents integer (int64) No Marks the line as a prepaid commit purchase (credit the customer pays for up front): when the top-up is paid, the customer gets a credit grant of this many cents (in the invoice’s currency). It may differ from the line’s price: a discounted commit sells $10,000 of credit for $9,000. Only on the one line of a top-up (billing_reason topup). Absent on other lines.
credit_valid_days integer No On a commit line: how many days the credit stays usable after the payment, copied from the account’s topup_credit_valid_days when the top-up was created, so a later change of the setting does not change it. Absent when the credit never expires, and on other lines.

Stuck, or found a bug? Ask in Discussions · Open an issue