List invoices
const url = 'http://localhost:8080/v1/invoices?sort=created_at&dir=desc&limit=50&offset=0';const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url 'http://localhost:8080/v1/invoices?sort=created_at&dir=desc&limit=50&offset=0' \ --header 'Authorization: Bearer <token>'Lists invoices in this account and mode, newest first by default.
Every filter is optional, and filters combine. Each invoice carries
its attention, if any. total counts every invoice that matches
the filters.
A from or to that is not a date answers 422 with param naming
it, and so does a to before from.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Query Parameters
Section titled “Query Parameters”Only this customer’s invoices.
Only invoices that bill this subscription.
Only invoices in this status: draft, finalized, paid,
voided or uncollectible. Any other value is a 422 with
param: status.
Only invoices with this payment status: pending, processing,
succeeded, failed or unknown. Any other value is a 422
with param: payment_.
Case-insensitive substring match on the invoice number, or on
the customer’s name or email, also when customer data is
encrypted (HARDCOUNT_). Names and emails are
matched among the 5,000 customers created last in this mode; an
invoice of an older customer is still found by its number.
Lower bound on created_at, inclusive. RFC3339 instant or bare YYYY-MM-DD (anchored at 00:00:00Z).
Upper bound on created_at, inclusive. RFC3339 instant or bare YYYY-MM-DD (anchored at 23:59:59.999999Z, the end of that day).
true keeps only open invoices past their due date: finalized,
due_at before the current real time, and payment_ not
succeeded, processing or unknown. Any other value applies
no filter. The dashboard’s Past due view uses it.
Keeps only the invoices that need one kind of action; with
limit=1, total counts them. Another value is a 422.
dispute_: a paid top-up whose own payment the customer’s
bank holds in a chargeback, an appeal included (not an inquiry).
outside_: a paid top-up with money returned
outside Hardcount whose credit note is not written yet, so the
customer can still spend its credit: a refund made in Stripe
flagged credit_, or a lost dispute that
POST / can
still record.
Comma-separated invoice IDs to fetch exactly.
The order of the list. created_ (the default), invoice_,
amount_ (or amount_), billing_ (or
period), due_at, issued_, status or payment_.
amount_ sorts a paid invoice by what paid it
(amount_ plus credits_, since paying zeroes
amount_) and every other invoice by amount_,
which a voided or written-off invoice keeps. Any other value is a
422 with param: sort. Ties are broken by id in the same
direction.
Example
created_atSort direction: desc (the default) or asc, in lower case. Any
other value is a 422 with param: dir.
Example
descRows per page, from 1 to 100. Default 50. Any other value, one that
is not a whole number, or limit sent twice is a 422 with
param: limit. It is never clamped.
Rows to skip, 0 or more. Default 0. A negative value, one that is
not a whole number, or offset sent twice is a 422 with
param: offset.
Responses
Section titled “Responses”Invoice list
object
A bill for one customer, in one currency. The billing engine creates
one at the end of each subscription period (and for a subscription’s
start when a fee is billed in advance, or a cancel); you can also
create one-off invoices with
POST /. The engine creates its invoices already
finalized, or as a draft while their tax is pending. An invoice
you create starts as a
draft until you finalize it. A finalized invoice ends paid,
voided or uncollectible. Every amount is a whole number in the
currency’s minor unit (cents for USD). The invoice routes and the
invoice. and payment. webhook events return it.
object
Unique identifier of the invoice, starting hc_inv_.
The account the invoice belongs to. Your API key already decides the account, so you rarely need it.
The customer the invoice bills.
The subscription the invoice bills. An empty string when the
invoice bills no subscription. An invoice you create with
POST / carries the subscription_ you sent.
The number printed on the invoice: the account’s invoice prefix
(default HC), a hyphen and a sequence padded to six digits, for
example HC-000042. Test mode and live mode count separately.
Set when the invoice is created, drafts included, except on a
top-up (billing_ topup): empty until its payment
numbers it, and still empty once an unpaid one is voided.
Where the invoice is in its life.
draft: not issued yet. Lines can still be added, and nothing is charged.finalized: issued and owed. Hardcount collects it.paid: settled, by card, credit, an offline payment or a credit note that left nothing due.voided: cancelled. Nothing is owed. Voiding is final.uncollectible: written off as bad debt, by you (POST /) or by a dunning policy’s final action. Hardcount stops collecting it, but it stays on the books and can still be paid.v1/ invoices/ {id}/ mark-uncollectible
The state of the invoice’s payment.
pending: nothing has been charged yet, or a charge is about to be sent. Also the status after Stripe refused the amount as below its minimum charge (seeamount_).below_ minimum processing: Stripe is still working on a charge.succeeded: the invoice is paid.failed: the last charge was declined or refused. Dunning, when a policy is on, retries it.unknown: a Stripe charge is being confirmed, or its answer was unclear. Every card charge shows it for the moment the charge takes: Hardcount records the Stripe payment on the invoice (stripe_) before any money moves, then confirms it. If the answer is unclear (a 5xx, a timeout or a dropped connection), the invoice stayspayment_ intent_ id unknown, and Hardcount cannot yet tell whether Stripe took the money. A few minutes later it reads that payment from Stripe and records what happened: paid, declined, or nothing charged. After “nothing charged” the invoice goes back topending(failedafter a dunning retry) and is charged again as usual.
The invoice’s currency, as an uppercase ISO 4217 code. Every amount on the invoice and its lines is in this currency’s minor unit.
The sum of the line amounts, before discount and 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.
Discount taken off the subtotal, in the currency’s minor unit (cents for USD). 0 when there is none.
Tax on the invoice, in the currency’s minor unit (cents for USD).
On an invoice you create with POST /, it is 0 until
finalize calculates the tax.
Tax rate as a percent, up to four decimal places (18.5 means 18.5%).
Whether the invoice’s prices include tax, fixed when the invoice is created: a subscription invoice takes the account’s tax-inclusive setting at the time its lines were priced, a one-off invoice the setting when it was created. The invoice’s tax is always worked out in these terms, so a later change to the setting does not change it. Invoices from before this field take the account’s setting at the upgrade.
The tax’s label, such as VAT or Sales Tax. Absent when there is none.
The country the tax was calculated for. Absent when none was recorded.
The customer’s tax ID the tax was calculated with. Absent when there was none.
The tax engine that calculated the tax: stripe_, manual (a
flat rate from the account settings) or none. A draft’s tax can
be calculated again (retry-tax, or finalize of a one-off draft);
once the invoice is finalized it no longer changes. Absent until
tax is calculated.
The tax provider’s calculation reference (Stripe Tax only). A Stripe Tax calculation expires 90 days after it is made; Hardcount keeps the reference so a finalized invoice can still be traced. Absent for the manual and none providers.
The tax provider’s committed transaction (Stripe Tax only). On an invoice the billing engine creates, it is recorded when the invoice is built; on one you create, at finalize. When that first commit fails, a background retry records it later. Hardcount reverses it when the invoice is voided or a credit note is issued. Absent until committed, and for providers that keep no record.
True when reverse charge applies: no tax is charged and the customer accounts for it. Absent when false.
Why the customer is exempt from tax, as recorded on the customer. Absent when they are not exempt.
Whether tax has been calculated. ok: it has (a zero tax counts).
pending: the calculation failed, and tax_ says why and
whether Hardcount retries it. A pending invoice stays a draft and
cannot be finalized, so a wrong tax amount is never sent.
When the tax calculation failed and the invoice was held as a draft. A later successful calculation clears it. Absent unless tax is deferred.
How many times tax was calculated again while it was pending:
each POST / on pending tax, each
automatic retry, and each finalize of a one-off draft whose
earlier calculation failed. Absent when 0.
Why tax could not be calculated, while tax_ is pending:
the provider’s error, or Hardcount’s own text when the provider
was never called (tax_ provider_).
Cut to 500 bytes. Absent otherwise.
Why tax could not be calculated, as a code. Set while
tax_ is pending; tax_ has the
detail.
The earliest time the background retry may calculate tax again, after a failed attempt. Absent when a retry may run now, and when none is scheduled: an error code Hardcount does not retry, or the automatic retries are used up. After the invoice is finalized, it is the earliest time Hardcount retries a tax commit or tax reversal that failed. It can hold a past time with nothing left to retry, when the Stripe Tax calculation expired while a commit was waiting.
When the provider’s tax transaction was reversed after a void, or found to need no reversal. Absent while the reversal is not confirmed.
Set when a payment arrived that the invoice did not expect. The
webhook event name of the cause: payment.,
payment., payment. or
payment..
Only the latest one is kept. Absent when there is none.
The Stripe PaymentIntent of that unexpected payment. Absent when there is none.
The amount Stripe took in that unexpected payment, in the currency’s minor unit (cents for USD). Absent when there is none.
Brand of the saved card that paid the invoice, as Stripe names it (for example visa). Absent when the card is unknown.
Last four digits of the saved card that paid the invoice. Absent when the card is unknown.
Why an invoice needs your attention now, and what to do about it.
Hardcount works it out each time the invoice is read, from the
invoice’s tax and payment state and related facts (the customer’s
card, the dunning run, disputes, refunds made in Stripe); it is never
stored. The invoice
leaves it out when nothing needs attention. GET /,
GET / and the finalize, retry-tax and
rotate-public-token responses carry it; the other invoice responses
and the webhook events do not.
object
How urgent an Attention notice is, most urgent first: critical,
warning, info. Sort or filter on it; the dashboard shows one
colour per level.
Why an invoice needs your attention, as a closed code. A code is never
reused for another meaning; a retired code stays reserved.
Attention. carries the open, provider-specific sub-code.
tax_: the tax provider could not calculate tax. The cause is incalculation_ failed code.tax_: the customer’s billing address or tax ID is missing or not valid for the tax provider. Edit the billing profile.location_ required payment_: the last charge failed.failed codeispayment.for a decline,declined payment.when the bank refused the card for good, orcard_ refused payment.when the bank wants the customer to confirm the payment. Stripe’s own message is inauthentication_ required provider_.response payment_: a charge got an unclear answer from Stripe. Hardcount asks Stripe what happened.unconfirmed payment_: money does not reconcile: a double charge, a captured amount that differs from the amount booked, a payment in another currency, or a payment on a voided invoice. Shown even on paid and voided invoices.anomaly payment_: a payment may be in progress. Stripe is still processing a charge (it settles on its own), the customer has the hosted payment page open (processing codepayment.), or a charge is in progress on a written-off invoice (page_ open codepayment.).recovery_ processing payment_: the invoice is queued, and the automatic charge collects it on its next run.scheduled awaiting_: the invoice is unpaid and not queued for an automatic charge, so the automatic charge skips it. Collect it with Charge now (payment POST /), or email the customer a payment link. Every invoice is queued when it is finalized, so only an invoice taken out of the queue reaches this state: one an older release wrote, or one held by paused collection when the upgrade that removed it ran.v1/ invoices/ {id}/ collect topup_: a top-up nobody has paid yet, with nothing charged. Nothing collects it on its own. The actions are what can work on this server and mode:awaiting_ payment copy_andpayment_ link send_only when its payment page can take a card, the latter only when the server can send email, andreminder record_in every case. It shows only while nothing is charged and no payment page is open: while the customer has the page open, the top-up getspayment payment_withprocessing codepayment.and no action.page_ open codeistopup., or names why the page can’t take a card:awaiting_ payment topup.,below_ minimum topup.,payment_ page_ off topup.orpayment_ link_ missing topup..stripe_ not_ connected no_: the customer has no card ready to charge. The invoice stays queued, and the automatic charge collects it on its first run after a card is added. When Stripe is not connected for the invoice’s mode, no card can be added online and the invoice is emailed instead.payment_ method messagesays which applies.dunning_: the customer still has no card and automatic recovery has ended without collecting; the policy’s final action ran.exhausted dispute_: the customer disputed a payment on the invoice with their bank, and the dispute closed aslost lost, so the bank took the money back. The invoice stays paid. On an ordinary invoice you record the loss. On a top-up whose own payment was disputed, Hardcount records it as a credit note that takes back the unused credit the money paid for, and the notice is a warning with the figures; it is critical while that note is not written yet (POST /writes it). Shown even on paid invoices, which is where disputes land. When the invoice also hasv1/ invoices/ {id}/ disputes/ {dispute_ id}/ record-loss payment_, that reason stays and its message asks you to check Stripe before any refund. The disputes are atanomaly GET /.v1/ invoices/ {id}/ disputes dispute_: the customer’s bank holds a chargeback on a top-up’s payment (an inquiry raises none), and the customer can still spend the credit it bought. Critical: the message says what Stripe took, the date to respond by and the unused credit. Pause the customer’s key at your gateway while it is open. It clears when the dispute closes.open dispute_: Stripe recorded a top-up’s lost dispute as won after Hardcount wrote the loss’s credit note. Info: the money is back in your Stripe balance and the credit note stands, so sell the credit again as a top-up and record its payment as paid outside Hardcount.won_ after_ loss refunded_: a refund of the invoice’s payment was made in Stripe outside Hardcount, and Hardcount did not record it as a credit note: the invoice was not paid yet, the currency differs, Hardcount first saw the refund more than a day after it was made, a credit note on the invoice has a failed card refund this refund may replace, the refund is more than the invoice had left to refund or credit, or the credit it paid for on a top-up could not be worked out (critical, since that credit can still be spent).in_ stripe codeispayment.followed by that review reason. Record it with a credit note that names the refund (refunded_ in_ stripe. stripe_onrefund_ id POST /), attach it to the credit note whose refund failed (v1/ credit-notes POST /), or dismiss it (v1/ credit-notes/ {id}/ attach-stripe-refund POST /). Shown even on paid invoices, which is where refunds land.v1/ invoices/ {id}/ stripe-refunds/ {stripe_ refund_ id}/ dismiss amount_: Stripe refused to charge the invoice, or refused a payment page for it, because the amount is below Stripe’s minimum charge. The minimum depends on the currency the Stripe account settles in; Stripe’s reply, inbelow_ minimum provider_, names it. Nothing was charged, the invoice staysresponse finalizedwithpayment_status pending, it is not charged again automatically, dunning does not start (a run already open ends), and the customer is not emailed. Void it or record a payment.POST /applies the customer’s credit balance and marks the invoice paid if that covers it, and otherwise asks Stripe again. Stripe’s answer can change (for a converted charge the minimum is the settlement currency’s), and a different answer ends this reason.v1/ invoices/ {id}/ collect
Text that is safe to show as it is: one plain sentence saying
what happens and what to do. Facts that must show up front
follow on more lines, separated by a newline (\n), one sentence
each and up to two lines in all, such as the setup-link email on
no_ (and on dunning_ when no link can
be emailed). The wording can change between releases; switch on
reason and code, not on this text.
Recommended next steps. The first is the main one; the rest are secondary. Absent when there is nothing to do but wait.
One recommended next step on an Attention notice.
object
A recommended next step, as a closed code. Each code maps to an API route or a dashboard page.
edit_: fix the customer’s billing address or tax ID.billing_ profile retry_:tax POST /.v1/ invoices/ {id}/ retry-tax retry_andpayment charge_:now POST /.v1/ invoices/ {id}/ collect wait_: nothing to do; the provider is expected to answer.provider rotate_: replace the Stripe key under Settings.api_ key reconcile_: open the payment in Stripe and refund or correct it there. Offered onpayment payment_.anomaly review_: check your tax registrations with the tax provider.registration send_: email the customer. Onreminder no_andpayment_ method dunning_that is the setup link (exhausted POST /); otherwise it is the invoice with its payment link (v1/ invoices/ {id}/ resend-setup-link POST /).v1/ invoices/ {id}/ send add_: add a card for the customer.payment_ method update_: send the customer a link to replace a card that was declined.payment_ method connect_: connect the tax provider under Settings.tax_ provider void_:invoice POST /. Offered only onv1/ invoices/ {id}/ void amount_.below_ minimum record_:dispute_ loss POST /, with the action’sv1/ invoices/ {id}/ disputes/ {dispute_ id}/ record-loss target_as the dispute. Offered on a top-up’sid dispute_notice while the loss’s credit note is not written.lost record_:stripe_ refund POST /withv1/ credit-notes stripe_set to the action’srefund_ id target_. Offered on aid refunded_notice the refund can be recorded from.in_ stripe copy_: copy the invoice’s payment page address, the hosted invoice page atpayment_ link /. Offered oninvoice/ {public_ token} topup_.awaiting_ payment record_:payment POST /, for a payment received outside Hardcount. Offered onv1/ invoices/ {id}/ record-payment topup_.awaiting_ payment
A default button label. You can show your own, translated text instead. Absent when there is none.
What the action acts on when the invoice alone does not say: the
dispute’s id (hc_) for record_, the refund’s
Stripe id (re_…) for record_. Absent otherwise.
Open, dotted code naming the exact cause, for example
tax. or payment.. New codes can
appear in any release, as with Stripe’s error codes.
A link to documentation about this reason. No such pages are published yet, so this release always leaves it out.
Dotted path to the field to edit to fix the cause. Today only
tax_ sets it, always to
customer., even when the tax ID is what is
wrong. Absent otherwise.
Hardcount’s own explanation behind message: why the state
holds, what Hardcount does on its own, and ids support may ask
for (for example the payment intent ids of a payment
anomaly). Plain text; may contain blank-line paragraph
breaks. Never a provider payload: that is
provider_.
The provider’s response as Hardcount recorded it: the Stripe Tax
error (cleaned of its JSON envelope and cut to 500 bytes),
or the invoice’s last_. Absent when Hardcount did
not call the provider or recorded no response.
When the condition started, so you can sort by age. For a tax
reason it is when tax was deferred, for amount_
when Stripe refused the amount, for dispute_ when the
dispute closed, for dispute_ when Stripe opened it, and for
refunded_ when the refund was
made. Otherwise it is when the invoice last changed. Absent when
it is not known.
When Hardcount will next retry on its own. Today only a tax retry sets it. Absent when no automatic retry is scheduled.
The invoice’s payment deadline (its due_at), or for
dispute_ the date to respond to the dispute by. Hardcount
does not act on this date; it is shown so you know it. Absent when
the reason does not show a deadline or there is none.
What you should know before you record an offline payment on a
written-off invoice: a consequence that will not reconcile on
its own, never a refusal. Sent only on uncollectible invoices,
by the same responses that carry attention. Absent when there
is nothing to say.
object
Always false. This object only warns; it never refuses.
What will not reconcile.
tax_: the invoice’s Stripe Tax
transaction was reversed, and recording the payment does not
report it again, so the tax collected will not appear in your
tax provider’s records.
One sentence for the operator naming the consequence and what to do about it.
The invoice total: subtotal_ minus discount_ plus
tax_, in the currency’s minor unit (cents for USD).
It is what the invoice charges before credit and payments, and it
does not change when the invoice is paid.
What the customer still owes, in the currency’s minor unit (cents
for USD): the total, less customer credit applied
(credits_), credit notes issued before payment,
and payments. It becomes 0 when the invoice is paid. A voided or
written-off invoice keeps the amount that was due.
What was paid by card or recorded as an offline payment, in the
currency’s minor unit (cents for USD). Set when the invoice is
paid, to the amount that was due then; 0 before. Credit applied
is counted in credits_, not here.
How much of the customer’s credit balance paid this invoice, in
the currency’s minor unit (cents for USD). Credit is applied when
the invoice is collected (after finalize, or by
POST /). A void gives it back to the
customer’s balance, and a credit note issued before payment can
give part of it back, lowering this figure.
Start of the period the invoice bills (included). On a one-off invoice created without a period, the time it was created.
End of the period the invoice bills (not included): the next period’s start. On a one-off invoice created without a period, the time it was created.
The period as people read it, with its last day included, in billing_: for example “Oct 1, 2026 – Oct 31, 2026”. billing_ and billing_ stay the exact boundaries. Worked out when the invoice is read, so it comes with the same responses as attention. Absent when the period starts and ends at the same instant.
The IANA time zone the period boundaries are in: the account’s billing time zone, copied onto the invoice when it was created. billing_, the PDF and the hosted page show dates in it, so an issued invoice’s dates stay the same if the account later changes its time zone. Absent only on invoices created before releases recorded it.
The buyer details this invoice was issued with, copied when it was finalized (or created already finalized). The PDF, the hosted page and the dashboard show an issued invoice from this copy, so a later edit to the customer or billing profile does not change it. Absent on drafts and on invoices issued before this field existed; those show the current customer details.
object
The customer’s display name when the document was issued.
The billing profile’s legal name. Absent when none was set.
The customer’s email address. Absent when none was set.
First address line of the billing profile. Absent when none was set.
Second address line of the billing profile. Absent when none was set.
City of the billing profile. Absent when none was set.
State or region of the billing profile. Absent when none was set.
Postal code of the billing profile. Absent when none was set.
Country of the billing profile, as a two-letter ISO 3166 code. Absent when none was set.
On an invoice, the tax ID its tax was calculated with when set, otherwise the billing profile’s tax ID at issue. Absent when there is none.
The kind of tax ID, as the billing profile stores it. Absent when none was set.
Your company details this invoice was issued with, copied when it was finalized (or created already finalized). Absent on drafts and on invoices issued before this field existed. Branding (logo, brand color) is not part of it.
object
Your company name.
Your company’s contact email.
Your company’s phone number.
First line of your company address.
Second line of your company address.
City of your company address.
State or region of your company address.
Postal code of your company address.
Country of your company address.
Your company’s tax ID.
When the invoice was issued. Every invoice gets one when it is
created, drafts included. An invoice you create with
POST / gets a new one when it is finalized.
When payment is due: issued_ plus net_
calendar days, counted in billing_. Set with
issued_. Hardcount does not charge on this date: it collects
right after finalize and retries on the dunning schedule. The
overdue filter of GET / uses it. Absent on a
top-up, which has no due date.
When the invoice was paid. Absent until it is paid.
When the invoice was voided. Absent unless it is voided.
When the invoice was written off as uncollectible. Absent unless it was.
The Stripe PaymentIntent of the card charge that paid the
invoice, or of its last charge that is in progress or failed. It
can be absent after a charge was sent: for example when the
invoice was then paid without a card (by credits, with nothing
due, or outside Hardcount: paid_), or when Stripe
refused the last charge as below its minimum.
True when the payment was recorded as made outside Hardcount, such as
a bank transfer or cheque (POST /,
or a dunning run resolved as payment_). Such
an invoice has no stripe_, so there is no card
to refund.
The error text recorded with the invoice’s last charge attempt
that did not succeed. Usually Stripe’s message, which is written
for the cardholder, with card numbers and email addresses masked.
It can also be Hardcount’s own text, such as customer has no payment method on file. Absent when there is none.
True while the invoice is queued for the automatic charge, which applies credit and charges the saved card. Absent when false.
When Hardcount automatically queued an email to the customer with
a link to add a payment method for this invoice. It is queued
once, when Stripe is connected, the customer has an email address
and the server’s PAYMENT_ is set; it reaches the
customer only when the server can send email.
POST / sends it again and does
not change this time. Absent until the automatic email is queued.
When Hardcount itself emailed the customer this invoice, because
Stripe is not connected for the invoice’s mode. The email is sent
once. An invoice you email with POST /
does not set it. Absent until then.
Stripe’s PaymentIntent status the last time Hardcount checked it,
word for word. For information only: payment_ is the
invoice’s payment state. Absent until Hardcount has checked. An
invoice checked by the Stripe Search sweep of earlier releases
may still show search_, search_ or
search_.
When Hardcount last asked Stripe about this invoice’s payment, whether
or not Stripe answered: a read of provider_, or a
check of a charge whose result was lost. Absent until then.
The token in the hosted invoice page’s link, like Stripe’s
hosted_; GET / serves
the page’s data. Anyone with it can view and pay the invoice, so
share it only with the customer. Created when the invoice is
finalized, or created already finalized; absent on drafts.
Replace it with
POST /.
Days from issued_ to due_at. 0 means due on receipt.
A note you set when creating the invoice, printed on the PDF and the hosted page. Absent when empty.
The account’s invoice footer as it was when this invoice was issued. Printed on the PDF and the hosted invoice page. Absent on a draft and when no footer was set.
Extra key-value data stored with the invoice. No API request sets it; it is absent when empty.
object
When the invoice was created.
When the invoice last changed.
Why the invoice was made, like Stripe’s invoice..
Set when the invoice is created and never changed.
subscription_: the invoice for a subscription period that ended (a renewal).cycle subscription_: the first invoice when a subscription starts, for the fees its plans bill in advance. A subscription billed only in arrears has none.create subscription_: the final invoice when a subscription is canceled at once in the middle of a period.cancel subscription_: an invoice an earlier release made when a subscription’s items changed in the middle of a period. No new invoice has it.update manual: an invoice you created withPOST /.v1/ invoices threshold: an invoice an earlier release made when a spend threshold was crossed in the middle of a period. No new invoice has it.topup: a top-up, which sells prepaid credit: an invoice you created withPOST /and onev1/ invoices commit_line, alone. It stays a draft with nogranted_ cents invoice_until it is paid; the payment numbers it, issues it and grants the credit.number
How many rows match the request’s filters, on every page, not only this one. The audit log and the customer list’s search and name or email sort say where they stop counting.
Example
{ "data": [ { "id": "hc_inv_dbj84b2q3gpgqfoq5c40", "tenant_id": "hc_ten_dajqj02q3gpgqfoq5c00", "customer_id": "hc_cus_dakhnk2q3gpgqfoq5c0g", "subscription_id": "hc_sub_dauq502q3gpgqfoq5c2g", "invoice_number": "HC-000042", "status": "paid", "payment_status": "succeeded", "currency": "USD", "subtotal_cents": 8650, "discount_cents": 0, "tax_amount_cents": 0, "tax_rate": 0, "tax_provider": "manual", "tax_status": "ok", "tax_inclusive": false, "payment_card_brand": "visa", "payment_card_last4": "4242", "total_amount_cents": 8650, "amount_due_cents": 0, "amount_paid_cents": 8650, "credits_applied_cents": 0, "billing_period_start": "2026-10-01T00:00:00Z", "billing_period_end": "2026-11-01T00:00:00Z", "billing_period_display": "Oct 1, 2026 – Oct 31, 2026", "billing_timezone": "UTC", "bill_to_snapshot": { "display_name": "Acme Inc", "legal_name": "Acme Incorporated", "email": "billing@acme.example", "address_line1": "100 Market Street", "city": "San Francisco", "state": "CA", "postal_code": "94105", "country": "US" }, "supplier_snapshot": { "name": "Example Labs Inc", "email": "billing@examplelabs.example", "address_line1": "1 Congress Avenue", "city": "Austin", "state": "TX", "postal_code": "78701", "country": "US" }, "issued_at": "2026-11-01T00:05:00Z", "due_at": "2026-12-01T00:05:00Z", "paid_at": "2026-11-01T00:05:03Z", "stripe_payment_intent_id": "pi_3QHk2fLkdIwHu7ix0a1b2c3d", "paid_out_of_band": false, "public_token": "hc_pinv_9f2c4e1a7b3d5f6081a2b3c4d5e6f708192a3b4c5d6e7f8091a2b3c4d5e6f701", "net_payment_term_days": 30, "created_at": "2026-11-01T00:05:00Z", "updated_at": "2026-11-01T00:05:03Z", "billing_reason": "subscription_cycle" } ], "total": 1}No valid credential: the API key or session is missing, wrong,
expired or revoked. With no API key and no valid session cookie, the
message starts with missing credentials. A wrong, expired and
revoked key all get the same message, invalid or expired API key.
The body of an error answer. error. is the broad class,
error. is the exact reason for your code to branch on, and
error. is a sentence for a person. Quote
error. when you ask for help.
object
What went wrong.
object
One of invalid_, authentication_,
rate_ or api_. Every error the API
answers has this shape, including an unknown path (404,
code route_) and a method the path does not take
(405, code method_, with an Allow header).
The few exceptions are listed in
Errors.
The exact reason, such as validation_, not_,
already_, invalid_ or a more specific code
the operation lists. Branch on this, not on message.
What went wrong, written for a person to read.
The id of the request that produced this answer
(req_…). It is normally the same value as the
Hardcount-Request-Id response header. On an answer
replayed for a repeated Idempotency-Key, the body is the
first request’s, so this is the first request’s id, while
the Hardcount-Request-Id header holds the new request’s
id.
The request field or query parameter the error is about. Sent only when the error names one.
A request body may hold only the fields its operation
lists, spelled and cased as listed. Any other field, or one
the server sets (such as id), is refused with 422 and
param naming it. An operation with no request body lists
no fields: send no body, {} or null. The Stripe and
Postmark webhooks and the LiteLLM callback take their
sender’s body as it comes.
Example
{ "error": { "type": "authentication_error", "code": "unauthorized", "message": "invalid or expired API key", "request_id": "req_dbjg652q3gpgqfoq5cd0" }}The credential is valid but may not call this route. A usage-only
key (hc_) can only send usage, read a customer’s live
credit balance and call GET /; use a secret key. The message names the permission the key
lacks. A browser request that would change data (POST, PUT, PATCH
or DELETE) from a page on another site gets this 403 too, with the
message cross-site request blocked.
The body of an error answer. error. is the broad class,
error. is the exact reason for your code to branch on, and
error. is a sentence for a person. Quote
error. when you ask for help.
object
What went wrong.
object
One of invalid_, authentication_,
rate_ or api_. Every error the API
answers has this shape, including an unknown path (404,
code route_) and a method the path does not take
(405, code method_, with an Allow header).
The few exceptions are listed in
Errors.
The exact reason, such as validation_, not_,
already_, invalid_ or a more specific code
the operation lists. Branch on this, not on message.
What went wrong, written for a person to read.
The id of the request that produced this answer
(req_…). It is normally the same value as the
Hardcount-Request-Id response header. On an answer
replayed for a repeated Idempotency-Key, the body is the
first request’s, so this is the first request’s id, while
the Hardcount-Request-Id header holds the new request’s
id.
The request field or query parameter the error is about. Sent only when the error names one.
A request body may hold only the fields its operation
lists, spelled and cased as listed. Any other field, or one
the server sets (such as id), is refused with 422 and
param naming it. An operation with no request body lists
no fields: send no body, {} or null. The Stripe and
Postmark webhooks and the LiteLLM callback take their
sender’s body as it comes.
Example
{ "error": { "type": "authentication_error", "code": "forbidden", "message": "insufficient permissions: this key type does not have customer:read access", "request_id": "req_dbjg652q3gpgqfoq5cd0" }}status or payment_ is not one of its values, limit or
offset is out of range or not a whole number, the request sends
the removed after cursor, sort or dir is not one of its
values, from or to is neither an RFC 3339 time nor a YYYY-MM-DD
date, or to is before from. param names it, and for the
filters, sort and dir the message lists the allowed values.
The body of an error answer. error. is the broad class,
error. is the exact reason for your code to branch on, and
error. is a sentence for a person. Quote
error. when you ask for help.
object
What went wrong.
object
One of invalid_, authentication_,
rate_ or api_. Every error the API
answers has this shape, including an unknown path (404,
code route_) and a method the path does not take
(405, code method_, with an Allow header).
The few exceptions are listed in
Errors.
The exact reason, such as validation_, not_,
already_, invalid_ or a more specific code
the operation lists. Branch on this, not on message.
What went wrong, written for a person to read.
The id of the request that produced this answer
(req_…). It is normally the same value as the
Hardcount-Request-Id response header. On an answer
replayed for a repeated Idempotency-Key, the body is the
first request’s, so this is the first request’s id, while
the Hardcount-Request-Id header holds the new request’s
id.
The request field or query parameter the error is about. Sent only when the error names one.
A request body may hold only the fields its operation
lists, spelled and cased as listed. Any other field, or one
the server sets (such as id), is refused with 422 and
param naming it. An operation with no request body lists
no fields: send no body, {} or null. The Stripe and
Postmark webhooks and the LiteLLM callback take their
sender’s body as it comes.
Example
{ "error": { "type": "invalid_request_error", "code": "validation_error", "message": "sort \"nope\" is not one of created_at, invoice_number, amount_due_cents, amount_due, billing_period_start, period, due_at, issued_at, status, payment_status", "request_id": "req_dbjg652q3gpgqfoq5cd0", "param": "sort" }}Too many requests. Wait for the number of seconds in Retry-After,
then retry. The answers that pass the limit carry the
X-RateLimit-* headers too.
Each API key has its own limit, by default 1,000 requests a minute
(HARDCOUNT_), and 1,000 a second on the
usage routes (HARDCOUNT_). The dashboard
sessions of one account share one limit per mode. The routes under
/ and / (sign-in, password reset, invite
accept, setup) count per client address, by default 100 a minute
(HARDCOUNT_). The public invoice,
payment-update and cost-dashboard pages allow 60 a minute per client
address.
The body of an error answer. error. is the broad class,
error. is the exact reason for your code to branch on, and
error. is a sentence for a person. Quote
error. when you ask for help.
object
What went wrong.
object
One of invalid_, authentication_,
rate_ or api_. Every error the API
answers has this shape, including an unknown path (404,
code route_) and a method the path does not take
(405, code method_, with an Allow header).
The few exceptions are listed in
Errors.
The exact reason, such as validation_, not_,
already_, invalid_ or a more specific code
the operation lists. Branch on this, not on message.
What went wrong, written for a person to read.
The id of the request that produced this answer
(req_…). It is normally the same value as the
Hardcount-Request-Id response header. On an answer
replayed for a repeated Idempotency-Key, the body is the
first request’s, so this is the first request’s id, while
the Hardcount-Request-Id header holds the new request’s
id.
The request field or query parameter the error is about. Sent only when the error names one.
A request body may hold only the fields its operation
lists, spelled and cased as listed. Any other field, or one
the server sets (such as id), is refused with 422 and
param naming it. An operation with no request body lists
no fields: send no body, {} or null. The Stripe and
Postmark webhooks and the LiteLLM callback take their
sender’s body as it comes.
Example
{ "error": { "type": "rate_limit_error", "code": "rate_limited", "message": "too many requests — please retry after the rate limit resets", "request_id": "req_dbjg652q3gpgqfoq5cd0" }}Headers
Section titled “Headers”Example
12Seconds to wait before the next request can pass, rounded up to a whole second and at least 1.
Example
1000How many requests the limit allows in its period (a minute, or a second on the usage routes).
Example
0How many requests are left in the current period.
Example
1793870460When the whole limit is available again, as Unix seconds. One
request may pass sooner; Retry-After says when.
Stuck, or found a bug? Ask in Discussions · Open an issue