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 →

Webhook events

Every event Hardcount sends, when it sends it, what its data carries, and an example message. How messages are delivered, signed and retried: Webhooks. How to build a receiver step by step: Receive webhooks.

  • Each family of events carries one resource in data, named in the family’s heading: data.invoice, data.subscription and so on. It is the object the API returns for that resource, as it was when Hardcount made the event.
  • “Also in data” lists the other keys an event carries beside the resource. Each is always sent, even when it is empty, such as applied on dunning.escalated.
  • The examples are the real shape of each message. Hardcount sends the body on one line, with its keys in this order; it is indented here. Tests check every example against the code that builds the message (test files). The examples share one fixed invoice, subscription, customer and so on, so a value such as an invoice’s status does not always fit the event: the invoice.finalized example shows a paid invoice.
  • operator in canceled_by and triggered_by means a dashboard user or an API key.

Terms: glossary.

data.invoice is the invoice as GET /v1/invoices/{id} returns it under invoice. Three fields the API works out when you read it are left out: attention, recovery_warning and billing_period_display. Line items are not included; GET /v1/invoices/{id} returns them.

An invoice is final and ready to pay. It is sent once per invoice. A draft sends it when it is finalized. A top-up (billing_reason topup) sends it when it is paid, just before invoice.paid, with its new invoice_number.

Its amount_due_cents is the amount before credit, and credits_applied_cents is 0: Hardcount uses credit when it collects the invoice, just after this event (invoice.finalized shows the amount before credit). Under Stripe Tax, tax_transaction_id can be recorded after this event; GET /v1/invoices/{id} shows it.

Also in data: nothing.

Example message
{
"created_at": "2026-10-01T12:00:00Z",
"data": {
"invoice": {
"amount_due_cents": 0,
"amount_paid_cents": 10825,
"billing_period_end": "2026-10-01T12:00:00Z",
"billing_period_start": "2026-09-01T12:00:00Z",
"billing_reason": "subscription_cycle",
"billing_timezone": "UTC",
"created_at": "2026-10-01T12:00:00Z",
"credits_applied_cents": 0,
"currency": "USD",
"customer_id": "hc_cus_golden",
"discount_cents": 0,
"due_at": "2026-10-01T12:00:00Z",
"id": "hc_inv_golden",
"invoice_number": "HC-000042",
"issued_at": "2026-10-01T12:00:00Z",
"metadata": {
"order": "A-1"
},
"net_payment_term_days": 0,
"paid_at": "2026-10-01T12:01:00Z",
"paid_out_of_band": false,
"payment_card_brand": "visa",
"payment_card_last4": "4242",
"payment_status": "succeeded",
"status": "paid",
"stripe_payment_intent_id": "pi_golden",
"subscription_id": "hc_sub_golden",
"subtotal_cents": 10000,
"tax_amount_cents": 825,
"tax_country": "US",
"tax_inclusive": false,
"tax_name": "Sales tax",
"tax_provider": "manual",
"tax_rate": 8.25,
"tax_status": "ok",
"tenant_id": "hc_ten_golden",
"total_amount_cents": 10825,
"updated_at": "2026-10-01T12:01:00Z"
}
},
"event_type": "invoice.finalized",
"id": "hc_whevt_golden"
}

An invoice is fully paid, by card, credit or an offline payment, or a credit note left nothing due. Its amount_paid_cents is what was paid at that moment: 0 when credit or a credit note covered the rest.

Also in data: nothing.

Example message
{
"created_at": "2026-10-01T12:00:00Z",
"data": {
"invoice": {
"amount_due_cents": 0,
"amount_paid_cents": 10825,
"billing_period_end": "2026-10-01T12:00:00Z",
"billing_period_start": "2026-09-01T12:00:00Z",
"billing_reason": "subscription_cycle",
"billing_timezone": "UTC",
"created_at": "2026-10-01T12:00:00Z",
"credits_applied_cents": 0,
"currency": "USD",
"customer_id": "hc_cus_golden",
"discount_cents": 0,
"due_at": "2026-10-01T12:00:00Z",
"id": "hc_inv_golden",
"invoice_number": "HC-000042",
"issued_at": "2026-10-01T12:00:00Z",
"metadata": {
"order": "A-1"
},
"net_payment_term_days": 0,
"paid_at": "2026-10-01T12:01:00Z",
"paid_out_of_band": false,
"payment_card_brand": "visa",
"payment_card_last4": "4242",
"payment_status": "succeeded",
"status": "paid",
"stripe_payment_intent_id": "pi_golden",
"subscription_id": "hc_sub_golden",
"subtotal_cents": 10000,
"tax_amount_cents": 825,
"tax_country": "US",
"tax_inclusive": false,
"tax_name": "Sales tax",
"tax_provider": "manual",
"tax_rate": 8.25,
"tax_status": "ok",
"tenant_id": "hc_ten_golden",
"total_amount_cents": 10825,
"updated_at": "2026-10-01T12:01:00Z"
}
},
"event_type": "invoice.paid",
"id": "hc_whevt_golden"
}

Someone recorded a payment made outside Hardcount, such as a bank transfer or a cheque. recovered_from is the status the invoice was paid from: finalized, uncollectible, or draft for a top-up, which the payment numbered and issued.

Also in data: recovered_from.

Example message
{
"created_at": "2026-10-01T12:00:00Z",
"data": {
"invoice": {
"amount_due_cents": 0,
"amount_paid_cents": 10825,
"billing_period_end": "2026-10-01T12:00:00Z",
"billing_period_start": "2026-09-01T12:00:00Z",
"billing_reason": "subscription_cycle",
"billing_timezone": "UTC",
"created_at": "2026-10-01T12:00:00Z",
"credits_applied_cents": 0,
"currency": "USD",
"customer_id": "hc_cus_golden",
"discount_cents": 0,
"due_at": "2026-10-01T12:00:00Z",
"id": "hc_inv_golden",
"invoice_number": "HC-000042",
"issued_at": "2026-10-01T12:00:00Z",
"metadata": {
"order": "A-1"
},
"net_payment_term_days": 0,
"paid_at": "2026-10-01T12:01:00Z",
"paid_out_of_band": false,
"payment_card_brand": "visa",
"payment_card_last4": "4242",
"payment_status": "succeeded",
"status": "paid",
"stripe_payment_intent_id": "pi_golden",
"subscription_id": "hc_sub_golden",
"subtotal_cents": 10000,
"tax_amount_cents": 825,
"tax_country": "US",
"tax_inclusive": false,
"tax_name": "Sales tax",
"tax_provider": "manual",
"tax_rate": 8.25,
"tax_status": "ok",
"tenant_id": "hc_ten_golden",
"total_amount_cents": 10825,
"updated_at": "2026-10-01T12:01:00Z"
},
"recovered_from": "uncollectible"
},
"event_type": "invoice.payment_recorded",
"id": "hc_whevt_golden"
}

An invoice was written off as bad debt.

Also in data: nothing.

Example message
{
"created_at": "2026-10-01T12:00:00Z",
"data": {
"invoice": {
"amount_due_cents": 0,
"amount_paid_cents": 10825,
"billing_period_end": "2026-10-01T12:00:00Z",
"billing_period_start": "2026-09-01T12:00:00Z",
"billing_reason": "subscription_cycle",
"billing_timezone": "UTC",
"created_at": "2026-10-01T12:00:00Z",
"credits_applied_cents": 0,
"currency": "USD",
"customer_id": "hc_cus_golden",
"discount_cents": 0,
"due_at": "2026-10-01T12:00:00Z",
"id": "hc_inv_golden",
"invoice_number": "HC-000042",
"issued_at": "2026-10-01T12:00:00Z",
"metadata": {
"order": "A-1"
},
"net_payment_term_days": 0,
"paid_at": "2026-10-01T12:01:00Z",
"paid_out_of_band": false,
"payment_card_brand": "visa",
"payment_card_last4": "4242",
"payment_status": "succeeded",
"status": "paid",
"stripe_payment_intent_id": "pi_golden",
"subscription_id": "hc_sub_golden",
"subtotal_cents": 10000,
"tax_amount_cents": 825,
"tax_country": "US",
"tax_inclusive": false,
"tax_name": "Sales tax",
"tax_provider": "manual",
"tax_rate": 8.25,
"tax_status": "ok",
"tenant_id": "hc_ten_golden",
"total_amount_cents": 10825,
"updated_at": "2026-10-01T12:01:00Z"
}
},
"event_type": "invoice.marked_uncollectible",
"id": "hc_whevt_golden"
}

An invoice was voided. Under Stripe Tax, Hardcount reverses the invoice’s tax just after the void is saved, so the invoice in this event has no tax_reversed_at; GET /v1/invoices/{id} shows it once that is done.

Also in data: nothing.

Example message
{
"created_at": "2026-10-01T12:00:00Z",
"data": {
"invoice": {
"amount_due_cents": 0,
"amount_paid_cents": 10825,
"billing_period_end": "2026-10-01T12:00:00Z",
"billing_period_start": "2026-09-01T12:00:00Z",
"billing_reason": "subscription_cycle",
"billing_timezone": "UTC",
"created_at": "2026-10-01T12:00:00Z",
"credits_applied_cents": 0,
"currency": "USD",
"customer_id": "hc_cus_golden",
"discount_cents": 0,
"due_at": "2026-10-01T12:00:00Z",
"id": "hc_inv_golden",
"invoice_number": "HC-000042",
"issued_at": "2026-10-01T12:00:00Z",
"metadata": {
"order": "A-1"
},
"net_payment_term_days": 0,
"paid_at": "2026-10-01T12:01:00Z",
"paid_out_of_band": false,
"payment_card_brand": "visa",
"payment_card_last4": "4242",
"payment_status": "succeeded",
"status": "paid",
"stripe_payment_intent_id": "pi_golden",
"subscription_id": "hc_sub_golden",
"subtotal_cents": 10000,
"tax_amount_cents": 825,
"tax_country": "US",
"tax_inclusive": false,
"tax_name": "Sales tax",
"tax_provider": "manual",
"tax_rate": 8.25,
"tax_status": "ok",
"tenant_id": "hc_ten_golden",
"total_amount_cents": 10825,
"updated_at": "2026-10-01T12:01:00Z"
}
},
"event_type": "invoice.voided",
"id": "hc_whevt_golden"
}

data.invoice is the invoice the payment was for, in the same shape as for the invoice events. Hardcount has no separate payment object. The invoice holds the charge’s Stripe PaymentIntent (stripe_payment_intent_id), its error (last_payment_error) and whether it was paid outside Hardcount (paid_out_of_band).

The four anomaly events (payment.duplicate_charge, payment.amount_mismatch, payment.currency_mismatch and payment.received_on_voided_invoice) carry the charge that raised the event: incoming_payment_intent_id is that charge, and captured_cents is what it took. Match the charge by incoming_payment_intent_id, not by the invoice’s stripe_payment_intent_id. Each event below says which charge the invoice’s stripe_payment_intent_id is.

Each anomaly is sent once per charge. When Stripe or Hardcount’s reconciler reports the same charge again, no second event is sent. The invoice keeps only its latest anomaly, so a charge reported again after another anomaly on the same invoice is sent again.

A charge was collected. The invoice names its PaymentIntent.

Also in data: nothing.

Example message
{
"created_at": "2026-10-01T12:00:00Z",
"data": {
"invoice": {
"amount_due_cents": 0,
"amount_paid_cents": 10825,
"billing_period_end": "2026-10-01T12:00:00Z",
"billing_period_start": "2026-09-01T12:00:00Z",
"billing_reason": "subscription_cycle",
"billing_timezone": "UTC",
"created_at": "2026-10-01T12:00:00Z",
"credits_applied_cents": 0,
"currency": "USD",
"customer_id": "hc_cus_golden",
"discount_cents": 0,
"due_at": "2026-10-01T12:00:00Z",
"id": "hc_inv_golden",
"invoice_number": "HC-000042",
"issued_at": "2026-10-01T12:00:00Z",
"metadata": {
"order": "A-1"
},
"net_payment_term_days": 0,
"paid_at": "2026-10-01T12:01:00Z",
"paid_out_of_band": false,
"payment_card_brand": "visa",
"payment_card_last4": "4242",
"payment_status": "succeeded",
"status": "paid",
"stripe_payment_intent_id": "pi_golden",
"subscription_id": "hc_sub_golden",
"subtotal_cents": 10000,
"tax_amount_cents": 825,
"tax_country": "US",
"tax_inclusive": false,
"tax_name": "Sales tax",
"tax_provider": "manual",
"tax_rate": 8.25,
"tax_status": "ok",
"tenant_id": "hc_ten_golden",
"total_amount_cents": 10825,
"updated_at": "2026-10-01T12:01:00Z"
}
},
"event_type": "payment.succeeded",
"id": "hc_whevt_golden"
}

A charge the invoice was waiting on failed. It is sent once per charge attempt (PaymentIntent). A decline on the hosted payment page does not send it, because the customer saw it there and can try again.

Also in data: nothing.

Example message
{
"created_at": "2026-10-01T12:00:00Z",
"data": {
"invoice": {
"amount_due_cents": 0,
"amount_paid_cents": 10825,
"billing_period_end": "2026-10-01T12:00:00Z",
"billing_period_start": "2026-09-01T12:00:00Z",
"billing_reason": "subscription_cycle",
"billing_timezone": "UTC",
"created_at": "2026-10-01T12:00:00Z",
"credits_applied_cents": 0,
"currency": "USD",
"customer_id": "hc_cus_golden",
"discount_cents": 0,
"due_at": "2026-10-01T12:00:00Z",
"id": "hc_inv_golden",
"invoice_number": "HC-000042",
"issued_at": "2026-10-01T12:00:00Z",
"metadata": {
"order": "A-1"
},
"net_payment_term_days": 0,
"paid_at": "2026-10-01T12:01:00Z",
"paid_out_of_band": false,
"payment_card_brand": "visa",
"payment_card_last4": "4242",
"payment_status": "succeeded",
"status": "paid",
"stripe_payment_intent_id": "pi_golden",
"subscription_id": "hc_sub_golden",
"subtotal_cents": 10000,
"tax_amount_cents": 825,
"tax_country": "US",
"tax_inclusive": false,
"tax_name": "Sales tax",
"tax_provider": "manual",
"tax_rate": 8.25,
"tax_status": "ok",
"tenant_id": "hc_ten_golden",
"total_amount_cents": 10825,
"updated_at": "2026-10-01T12:01:00Z"
}
},
"event_type": "payment.failed",
"id": "hc_whevt_golden"
}

A second charge succeeded on an invoice that was already paid. Refund it.

The invoice’s stripe_payment_intent_id is the other charge, the one Hardcount recorded on the paid invoice. It is left out when Hardcount recorded none, such as when credit paid the invoice or it was paid outside Hardcount (paid_out_of_band is true).

Also in data: incoming_payment_intent_id, captured_cents.

Example message
{
"created_at": "2026-10-01T12:00:00Z",
"data": {
"captured_cents": 10825,
"incoming_payment_intent_id": "pi_second",
"invoice": {
"amount_due_cents": 0,
"amount_paid_cents": 10825,
"billing_period_end": "2026-10-01T12:00:00Z",
"billing_period_start": "2026-09-01T12:00:00Z",
"billing_reason": "subscription_cycle",
"billing_timezone": "UTC",
"created_at": "2026-10-01T12:00:00Z",
"credits_applied_cents": 0,
"currency": "USD",
"customer_id": "hc_cus_golden",
"discount_cents": 0,
"due_at": "2026-10-01T12:00:00Z",
"id": "hc_inv_golden",
"invoice_number": "HC-000042",
"issued_at": "2026-10-01T12:00:00Z",
"metadata": {
"order": "A-1"
},
"net_payment_term_days": 0,
"paid_at": "2026-10-01T12:01:00Z",
"paid_out_of_band": false,
"payment_card_brand": "visa",
"payment_card_last4": "4242",
"payment_status": "succeeded",
"status": "paid",
"stripe_payment_intent_id": "pi_golden",
"subscription_id": "hc_sub_golden",
"subtotal_cents": 10000,
"tax_amount_cents": 825,
"tax_country": "US",
"tax_inclusive": false,
"tax_name": "Sales tax",
"tax_provider": "manual",
"tax_rate": 8.25,
"tax_status": "ok",
"tenant_id": "hc_ten_golden",
"total_amount_cents": 10825,
"updated_at": "2026-10-01T12:01:00Z"
}
},
"event_type": "payment.duplicate_charge",
"id": "hc_whevt_golden"
}

A charge settled for a different amount than the invoice owed. The invoice was just paid by this charge, so its stripe_payment_intent_id is this charge, and amount_paid_cents is what Hardcount recorded. The event is saved with the payment, so this invoice, and the invoice in that payment’s invoice.paid and payment.succeeded, show the anomaly (payment_anomaly_kind).

Also in data: incoming_payment_intent_id, captured_cents.

Example message
{
"created_at": "2026-10-01T12:00:00Z",
"data": {
"captured_cents": 10825,
"incoming_payment_intent_id": "pi_second",
"invoice": {
"amount_due_cents": 0,
"amount_paid_cents": 10825,
"billing_period_end": "2026-10-01T12:00:00Z",
"billing_period_start": "2026-09-01T12:00:00Z",
"billing_reason": "subscription_cycle",
"billing_timezone": "UTC",
"created_at": "2026-10-01T12:00:00Z",
"credits_applied_cents": 0,
"currency": "USD",
"customer_id": "hc_cus_golden",
"discount_cents": 0,
"due_at": "2026-10-01T12:00:00Z",
"id": "hc_inv_golden",
"invoice_number": "HC-000042",
"issued_at": "2026-10-01T12:00:00Z",
"metadata": {
"order": "A-1"
},
"net_payment_term_days": 0,
"paid_at": "2026-10-01T12:01:00Z",
"paid_out_of_band": false,
"payment_card_brand": "visa",
"payment_card_last4": "4242",
"payment_status": "succeeded",
"status": "paid",
"stripe_payment_intent_id": "pi_golden",
"subscription_id": "hc_sub_golden",
"subtotal_cents": 10000,
"tax_amount_cents": 825,
"tax_country": "US",
"tax_inclusive": false,
"tax_name": "Sales tax",
"tax_provider": "manual",
"tax_rate": 8.25,
"tax_status": "ok",
"tenant_id": "hc_ten_golden",
"total_amount_cents": 10825,
"updated_at": "2026-10-01T12:01:00Z"
}
},
"event_type": "payment.amount_mismatch",
"id": "hc_whevt_golden"
}

A charge settled in a different currency than the invoice’s. charge_currency is the charge’s currency, in upper case; compare it with the invoice’s currency. The payment is recorded as usual and nothing is converted. Review it in Stripe. The invoice is as it was when the charge arrived: its stripe_payment_intent_id may be this charge, an earlier one, or none.

Also in data: incoming_payment_intent_id, captured_cents, charge_currency.

Example message
{
"created_at": "2026-10-01T12:00:00Z",
"data": {
"captured_cents": 10825,
"charge_currency": "EUR",
"incoming_payment_intent_id": "pi_second",
"invoice": {
"amount_due_cents": 0,
"amount_paid_cents": 10825,
"billing_period_end": "2026-10-01T12:00:00Z",
"billing_period_start": "2026-09-01T12:00:00Z",
"billing_reason": "subscription_cycle",
"billing_timezone": "UTC",
"created_at": "2026-10-01T12:00:00Z",
"credits_applied_cents": 0,
"currency": "USD",
"customer_id": "hc_cus_golden",
"discount_cents": 0,
"due_at": "2026-10-01T12:00:00Z",
"id": "hc_inv_golden",
"invoice_number": "HC-000042",
"issued_at": "2026-10-01T12:00:00Z",
"metadata": {
"order": "A-1"
},
"net_payment_term_days": 0,
"paid_at": "2026-10-01T12:01:00Z",
"paid_out_of_band": false,
"payment_card_brand": "visa",
"payment_card_last4": "4242",
"payment_status": "succeeded",
"status": "paid",
"stripe_payment_intent_id": "pi_golden",
"subscription_id": "hc_sub_golden",
"subtotal_cents": 10000,
"tax_amount_cents": 825,
"tax_country": "US",
"tax_inclusive": false,
"tax_name": "Sales tax",
"tax_provider": "manual",
"tax_rate": 8.25,
"tax_status": "ok",
"tenant_id": "hc_ten_golden",
"total_amount_cents": 10825,
"updated_at": "2026-10-01T12:01:00Z"
}
},
"event_type": "payment.currency_mismatch",
"id": "hc_whevt_golden"
}

Money arrived for a voided invoice. Refund it. The invoice is as it was when the charge arrived: its stripe_payment_intent_id may be this charge, an earlier one, or none.

Also in data: incoming_payment_intent_id, captured_cents.

Example message
{
"created_at": "2026-10-01T12:00:00Z",
"data": {
"captured_cents": 10825,
"incoming_payment_intent_id": "pi_second",
"invoice": {
"amount_due_cents": 0,
"amount_paid_cents": 10825,
"billing_period_end": "2026-10-01T12:00:00Z",
"billing_period_start": "2026-09-01T12:00:00Z",
"billing_reason": "subscription_cycle",
"billing_timezone": "UTC",
"created_at": "2026-10-01T12:00:00Z",
"credits_applied_cents": 0,
"currency": "USD",
"customer_id": "hc_cus_golden",
"discount_cents": 0,
"due_at": "2026-10-01T12:00:00Z",
"id": "hc_inv_golden",
"invoice_number": "HC-000042",
"issued_at": "2026-10-01T12:00:00Z",
"metadata": {
"order": "A-1"
},
"net_payment_term_days": 0,
"paid_at": "2026-10-01T12:01:00Z",
"paid_out_of_band": false,
"payment_card_brand": "visa",
"payment_card_last4": "4242",
"payment_status": "succeeded",
"status": "paid",
"stripe_payment_intent_id": "pi_golden",
"subscription_id": "hc_sub_golden",
"subtotal_cents": 10000,
"tax_amount_cents": 825,
"tax_country": "US",
"tax_inclusive": false,
"tax_name": "Sales tax",
"tax_provider": "manual",
"tax_rate": 8.25,
"tax_status": "ok",
"tenant_id": "hc_ten_golden",
"total_amount_cents": 10825,
"updated_at": "2026-10-01T12:01:00Z"
}
},
"event_type": "payment.received_on_voided_invoice",
"id": "hc_whevt_golden"
}

A customer disputed a card payment with their bank (a chargeback), and Hardcount recorded it against the invoice. It is sent once per dispute.

dispute is the dispute as GET /v1/invoices/{id}/disputes lists it, with every field it has there, including stripe_dispute_id, status, reason, amount_cents, currency, evidence_due_by (the deadline to respond in Stripe), opened_at, and closed_at once it is closed. What a dispute does and how to turn on Stripe’s dispute events: Card disputes.

Also in data: dispute.

Example message
{
"created_at": "2026-10-01T12:00:00Z",
"data": {
"dispute": {
"amount_cents": 10825,
"created_at": "2026-10-01T12:00:00Z",
"currency": "USD",
"evidence_due_by": "2026-10-08T12:00:00Z",
"id": "hc_dsp_golden",
"invoice_id": "hc_inv_golden",
"livemode": false,
"opened_at": "2026-10-01T12:00:00Z",
"reason": "fraudulent",
"status": "needs_response",
"stripe_charge_id": "ch_golden",
"stripe_dispute_id": "du_golden",
"stripe_payment_intent_id": "pi_golden",
"updated_at": "2026-10-01T12:00:00Z"
},
"invoice": {
"amount_due_cents": 0,
"amount_paid_cents": 10825,
"billing_period_end": "2026-10-01T12:00:00Z",
"billing_period_start": "2026-09-01T12:00:00Z",
"billing_reason": "subscription_cycle",
"billing_timezone": "UTC",
"created_at": "2026-10-01T12:00:00Z",
"credits_applied_cents": 0,
"currency": "USD",
"customer_id": "hc_cus_golden",
"discount_cents": 0,
"due_at": "2026-10-01T12:00:00Z",
"id": "hc_inv_golden",
"invoice_number": "HC-000042",
"issued_at": "2026-10-01T12:00:00Z",
"metadata": {
"order": "A-1"
},
"net_payment_term_days": 0,
"paid_at": "2026-10-01T12:01:00Z",
"paid_out_of_band": false,
"payment_card_brand": "visa",
"payment_card_last4": "4242",
"payment_status": "succeeded",
"status": "paid",
"stripe_payment_intent_id": "pi_golden",
"subscription_id": "hc_sub_golden",
"subtotal_cents": 10000,
"tax_amount_cents": 825,
"tax_country": "US",
"tax_inclusive": false,
"tax_name": "Sales tax",
"tax_provider": "manual",
"tax_rate": 8.25,
"tax_status": "ok",
"tenant_id": "hc_ten_golden",
"total_amount_cents": 10825,
"updated_at": "2026-10-01T12:01:00Z"
}
},
"event_type": "payment.dispute_opened",
"id": "hc_whevt_golden"
}

A recorded dispute closed. It is sent again if Stripe turns a loss into a win. Its dispute.status is won, lost, warning_closed (an inquiry that never became a chargeback) or prevented. When the first Stripe event Hardcount receives is already the close, both dispute events are sent with the closed status, in either order.

A loss on a top-up’s own payment, in the top-up’s currency, is recorded as a credit note that takes back the unused credit the bank’s money paid for, in the same step: dispute.credit_note_id names it. It is absent when the payment’s credit notes already return all of it, and when Hardcount could not read the customer’s usage not invoiced yet; then POST /v1/invoices/{id}/disputes/{dispute_id}/record-loss writes the note, and no second event is sent.

Also in data: dispute.

Example message
{
"created_at": "2026-10-01T12:00:00Z",
"data": {
"dispute": {
"amount_cents": 10825,
"created_at": "2026-10-01T12:00:00Z",
"currency": "USD",
"evidence_due_by": "2026-10-08T12:00:00Z",
"id": "hc_dsp_golden",
"invoice_id": "hc_inv_golden",
"livemode": false,
"opened_at": "2026-10-01T12:00:00Z",
"reason": "fraudulent",
"status": "needs_response",
"stripe_charge_id": "ch_golden",
"stripe_dispute_id": "du_golden",
"stripe_payment_intent_id": "pi_golden",
"updated_at": "2026-10-01T12:00:00Z"
},
"invoice": {
"amount_due_cents": 0,
"amount_paid_cents": 10825,
"billing_period_end": "2026-10-01T12:00:00Z",
"billing_period_start": "2026-09-01T12:00:00Z",
"billing_reason": "subscription_cycle",
"billing_timezone": "UTC",
"created_at": "2026-10-01T12:00:00Z",
"credits_applied_cents": 0,
"currency": "USD",
"customer_id": "hc_cus_golden",
"discount_cents": 0,
"due_at": "2026-10-01T12:00:00Z",
"id": "hc_inv_golden",
"invoice_number": "HC-000042",
"issued_at": "2026-10-01T12:00:00Z",
"metadata": {
"order": "A-1"
},
"net_payment_term_days": 0,
"paid_at": "2026-10-01T12:01:00Z",
"paid_out_of_band": false,
"payment_card_brand": "visa",
"payment_card_last4": "4242",
"payment_status": "succeeded",
"status": "paid",
"stripe_payment_intent_id": "pi_golden",
"subscription_id": "hc_sub_golden",
"subtotal_cents": 10000,
"tax_amount_cents": 825,
"tax_country": "US",
"tax_inclusive": false,
"tax_name": "Sales tax",
"tax_provider": "manual",
"tax_rate": 8.25,
"tax_status": "ok",
"tenant_id": "hc_ten_golden",
"total_amount_cents": 10825,
"updated_at": "2026-10-01T12:01:00Z"
}
},
"event_type": "payment.dispute_closed",
"id": "hc_whevt_golden"
}

A payment on the invoice was refunded in Stripe, outside Hardcount (the Stripe dashboard, or Stripe’s API called directly), and Hardcount recorded it. It is sent once per refund, when the outcome is decided: at once for most refunds, and for a refund first seen pending, when Stripe says it succeeded, failed or was canceled.

refund is the refund as GET /v1/invoices/{id}/stripe-refunds lists it, with stripe_refund_id, stripe_payment_intent_id, amount_cents, currency, Stripe’s status, and outcome, what Hardcount did with it:

  • credit_note: Hardcount recorded it as the issued credit note credit_note_id, whose card refund is this refund. Hardcount made no refund call for it, and the note reverses its share of the tax.
  • other_payment: a refund of a payment that did not pay the invoice (a second charge, or money on a voided invoice). No credit note.
  • needs_review: a refund of the invoice’s own payment that Hardcount did not record; review_reason says why. The invoice shows a notice until someone records it with a credit note or dismisses it, in the dashboard or with the API.
  • not_refunded: it failed or was canceled before it succeeded. No money moved.

The invoice is as it was: a refund never changes its status or amounts. A later change to the refund, such as a failure, sends nothing more; a recorded note’s refund_status follows it. Refunds Hardcount makes itself send no event. Hardcount hears of a refund made in Stripe only with refund.created on the Stripe webhook endpoint: A refund made in Stripe.

Also in data: refund.

Example message
{
"created_at": "2026-10-01T12:00:00Z",
"data": {
"invoice": {
"amount_due_cents": 0,
"amount_paid_cents": 10825,
"billing_period_end": "2026-10-01T12:00:00Z",
"billing_period_start": "2026-09-01T12:00:00Z",
"billing_reason": "subscription_cycle",
"billing_timezone": "UTC",
"created_at": "2026-10-01T12:00:00Z",
"credits_applied_cents": 0,
"currency": "USD",
"customer_id": "hc_cus_golden",
"discount_cents": 0,
"due_at": "2026-10-01T12:00:00Z",
"id": "hc_inv_golden",
"invoice_number": "HC-000042",
"issued_at": "2026-10-01T12:00:00Z",
"metadata": {
"order": "A-1"
},
"net_payment_term_days": 0,
"paid_at": "2026-10-01T12:01:00Z",
"paid_out_of_band": false,
"payment_card_brand": "visa",
"payment_card_last4": "4242",
"payment_status": "succeeded",
"status": "paid",
"stripe_payment_intent_id": "pi_golden",
"subscription_id": "hc_sub_golden",
"subtotal_cents": 10000,
"tax_amount_cents": 825,
"tax_country": "US",
"tax_inclusive": false,
"tax_name": "Sales tax",
"tax_provider": "manual",
"tax_rate": 8.25,
"tax_status": "ok",
"tenant_id": "hc_ten_golden",
"total_amount_cents": 10825,
"updated_at": "2026-10-01T12:01:00Z"
},
"refund": {
"amount_cents": 4000,
"created_at": "2026-10-01T12:00:00Z",
"credit_note_id": "hc_cn_golden",
"currency": "USD",
"id": "hc_srf_golden",
"invoice_id": "hc_inv_golden",
"livemode": false,
"outcome": "credit_note",
"reason": "requested_by_customer",
"refund_created_at": "2026-10-01T12:00:00Z",
"status": "succeeded",
"stripe_charge_id": "ch_golden",
"stripe_payment_intent_id": "pi_golden",
"stripe_refund_id": "re_golden",
"updated_at": "2026-10-01T12:00:00Z"
}
},
"event_type": "payment.refunded_in_stripe",
"id": "hc_whevt_golden"
}

data.payment_method is the saved payment method as GET /v1/customers/{id}/payment-methods lists it: its type, whether Hardcount can charge it (chargeable, true for a card), a card’s brand, last 4 digits and expiry, and whether it is the default. A method Hardcount can’t charge is never the default. A Stripe event that arrives after the method was removed in Hardcount leaves it removed and sends neither event.

Each event reports a change to the card: a new card, or a new default flag, brand, last 4 digits or expiry. A Stripe event that changes nothing Hardcount has recorded sends no event, so a repeated Stripe event is not sent twice. One Stripe Checkout setup session sends two Stripe events for its card, and the second one sends an event only if it changed the card, for example by making it the default. Subscribe to both events to see every saved card.

A customer saved a payment method. When it is chargeable, invoices waiting for one are charged on the next billing run. stripe_payment_method_id is the method’s Stripe ID.

Also in data: stripe_payment_method_id.

Example message
{
"created_at": "2026-10-01T12:00:00Z",
"data": {
"payment_method": {
"card_brand": "visa",
"card_exp_month": 12,
"card_exp_year": 2030,
"card_last4": "4242",
"chargeable": true,
"created_at": "2026-10-01T12:00:00Z",
"customer_id": "hc_cus_golden",
"id": "hc_pm_golden",
"is_default": true,
"type": "card"
},
"stripe_payment_method_id": "pm_golden"
},
"event_type": "payment_method.attached",
"id": "hc_whevt_golden"
}

A customer’s payment method was set up or replaced through Stripe Checkout. stripe_customer_id is the Stripe customer it was saved to.

Also in data: stripe_customer_id.

Example message
{
"created_at": "2026-10-01T12:00:00Z",
"data": {
"payment_method": {
"card_brand": "visa",
"card_exp_month": 12,
"card_exp_year": 2030,
"card_last4": "4242",
"chargeable": true,
"created_at": "2026-10-01T12:00:00Z",
"customer_id": "hc_cus_golden",
"id": "hc_pm_golden",
"is_default": true,
"type": "card"
},
"stripe_customer_id": "cus_golden"
},
"event_type": "payment_method.updated",
"id": "hc_whevt_golden"
}

data.subscription is the subscription with its plan, as GET /v1/subscriptions/{id} returns it, without current_billing_period_display (a date range the API writes out when you read it). A cancel’s time is the subscription’s canceled_at. A scheduled cancel’s time is its cancel_effective_at, the end of the current period. These fields are left out when they are not set. The example subscription has no cancel, so its examples do not show them.

A subscription was created.

Also in data: nothing.

Example message
{
"created_at": "2026-10-01T12:00:00Z",
"data": {
"subscription": {
"billing_time": "calendar",
"cancel_at_period_end": false,
"code": "acme-pro",
"created_at": "2026-09-01T12:00:00Z",
"current_billing_period_end": "2026-11-01T12:00:00Z",
"current_billing_period_start": "2026-10-01T12:00:00Z",
"customer_id": "hc_cus_golden",
"display_name": "Acme Pro",
"id": "hc_sub_golden",
"next_billing_at": "2026-11-01T12:00:00Z",
"plan_id": "hc_pln_pro",
"started_at": "2026-09-01T12:00:00Z",
"status": "active",
"tenant_id": "hc_ten_golden",
"updated_at": "2026-10-01T12:00:00Z"
}
},
"event_type": "subscription.created",
"id": "hc_whevt_golden"
}

A subscription was canceled. canceled_by says who canceled it: operator (a dashboard user or an API key), customer, schedule (a cancel set for later), dunning (Hardcount’s automatic payment retries ran out) or system (Hardcount itself). A cancel by dunning says dunning.

Also in data: canceled_by.

Example message
{
"created_at": "2026-10-01T12:00:00Z",
"data": {
"canceled_by": "schedule",
"subscription": {
"billing_time": "calendar",
"cancel_at_period_end": false,
"code": "acme-pro",
"created_at": "2026-09-01T12:00:00Z",
"current_billing_period_end": "2026-11-01T12:00:00Z",
"current_billing_period_start": "2026-10-01T12:00:00Z",
"customer_id": "hc_cus_golden",
"display_name": "Acme Pro",
"id": "hc_sub_golden",
"next_billing_at": "2026-11-01T12:00:00Z",
"plan_id": "hc_pln_pro",
"started_at": "2026-09-01T12:00:00Z",
"status": "active",
"tenant_id": "hc_ten_golden",
"updated_at": "2026-10-01T12:00:00Z"
}
},
"event_type": "subscription.canceled",
"id": "hc_whevt_golden"
}

A cancel at period end was scheduled. A cancel now that takes effect at the end of a period that has already ended sends it too, just before subscription.canceled.

Also in data: nothing.

Example message
{
"created_at": "2026-10-01T12:00:00Z",
"data": {
"subscription": {
"billing_time": "calendar",
"cancel_at_period_end": false,
"code": "acme-pro",
"created_at": "2026-09-01T12:00:00Z",
"current_billing_period_end": "2026-11-01T12:00:00Z",
"current_billing_period_start": "2026-10-01T12:00:00Z",
"customer_id": "hc_cus_golden",
"display_name": "Acme Pro",
"id": "hc_sub_golden",
"next_billing_at": "2026-11-01T12:00:00Z",
"plan_id": "hc_pln_pro",
"started_at": "2026-09-01T12:00:00Z",
"status": "active",
"tenant_id": "hc_ten_golden",
"updated_at": "2026-10-01T12:00:00Z"
}
},
"event_type": "subscription.cancel_scheduled",
"id": "hc_whevt_golden"
}

A scheduled cancel was removed. Clearing when no cancel is scheduled sends nothing. A cancel now that scheduled itself for an ended period it then could not bill also sends it, and is refused with unbilled_period.

Also in data: nothing.

Example message
{
"created_at": "2026-10-01T12:00:00Z",
"data": {
"subscription": {
"billing_time": "calendar",
"cancel_at_period_end": false,
"code": "acme-pro",
"created_at": "2026-09-01T12:00:00Z",
"current_billing_period_end": "2026-11-01T12:00:00Z",
"current_billing_period_start": "2026-10-01T12:00:00Z",
"customer_id": "hc_cus_golden",
"display_name": "Acme Pro",
"id": "hc_sub_golden",
"next_billing_at": "2026-11-01T12:00:00Z",
"plan_id": "hc_pln_pro",
"started_at": "2026-09-01T12:00:00Z",
"status": "active",
"tenant_id": "hc_ten_golden",
"updated_at": "2026-10-01T12:00:00Z"
}
},
"event_type": "subscription.cancel_cleared",
"id": "hc_whevt_golden"
}

A plan change for the next billing period was scheduled. The subscription’s pending_plan_id and pending_plan_effective_at show it.

Also in data: nothing.

Example message
{
"created_at": "2026-10-01T12:00:00Z",
"data": {
"subscription": {
"billing_time": "calendar",
"cancel_at_period_end": false,
"code": "acme-pro",
"created_at": "2026-09-01T12:00:00Z",
"current_billing_period_end": "2026-11-01T12:00:00Z",
"current_billing_period_start": "2026-10-01T12:00:00Z",
"customer_id": "hc_cus_golden",
"display_name": "Acme Pro",
"id": "hc_sub_golden",
"next_billing_at": "2026-11-01T12:00:00Z",
"pending_plan_effective_at": "2026-11-01T12:00:00Z",
"pending_plan_id": "hc_pln_team",
"plan_id": "hc_pln_pro",
"started_at": "2026-09-01T12:00:00Z",
"status": "active",
"tenant_id": "hc_ten_golden",
"updated_at": "2026-10-01T12:00:00Z"
}
},
"event_type": "subscription.pending_change.scheduled",
"id": "hc_whevt_golden"
}

A scheduled plan change was canceled. A cancel call on a subscription with no change scheduled sends nothing. If the change took effect at the period end before the cancel reached it, the call answers 409 and sends nothing: subscription.pending_change.applied says what happened.

Also in data: nothing.

Example message
{
"created_at": "2026-10-01T12:00:00Z",
"data": {
"subscription": {
"billing_time": "calendar",
"cancel_at_period_end": false,
"code": "acme-pro",
"created_at": "2026-09-01T12:00:00Z",
"current_billing_period_end": "2026-11-01T12:00:00Z",
"current_billing_period_start": "2026-10-01T12:00:00Z",
"customer_id": "hc_cus_golden",
"display_name": "Acme Pro",
"id": "hc_sub_golden",
"next_billing_at": "2026-11-01T12:00:00Z",
"plan_id": "hc_pln_pro",
"started_at": "2026-09-01T12:00:00Z",
"status": "active",
"tenant_id": "hc_ten_golden",
"updated_at": "2026-10-01T12:00:00Z"
}
},
"event_type": "subscription.pending_change.canceled",
"id": "hc_whevt_golden"
}

A scheduled plan change was applied at the period end. The subscription’s plan_id is the new plan, old_plan_id the one it left, and applied_at when. The subscription is as it was just before the period closed. Closing a period means Hardcount builds its invoice and starts the next period.

Also in data: old_plan_id, applied_at.

Example message
{
"created_at": "2026-10-01T12:00:00Z",
"data": {
"applied_at": "2026-10-01T12:00:00Z",
"old_plan_id": "hc_pln_basic",
"subscription": {
"billing_time": "calendar",
"cancel_at_period_end": false,
"code": "acme-pro",
"created_at": "2026-09-01T12:00:00Z",
"current_billing_period_end": "2026-11-01T12:00:00Z",
"current_billing_period_start": "2026-10-01T12:00:00Z",
"customer_id": "hc_cus_golden",
"display_name": "Acme Pro",
"id": "hc_sub_golden",
"next_billing_at": "2026-11-01T12:00:00Z",
"plan_id": "hc_pln_pro",
"started_at": "2026-09-01T12:00:00Z",
"status": "active",
"tenant_id": "hc_ten_golden",
"updated_at": "2026-10-01T12:00:00Z"
}
},
"event_type": "subscription.pending_change.applied",
"id": "hc_whevt_golden"
}

data.customer is the customer as GET /v1/customers/{id} returns it.

An email to a customer bounced, and Hardcount stopped emailing that address. reason is the email provider’s.

Also in data: reason.

Example message
{
"created_at": "2026-10-01T12:00:00Z",
"data": {
"customer": {
"created_at": "2026-08-02T12:00:00Z",
"display_name": "Acme Inc",
"email": "billing@acme.example",
"email_bounce_reason": "mailbox does not exist",
"email_last_bounced_at": "2026-10-01T12:00:00Z",
"email_status": "bounced",
"external_id": "acme-1",
"id": "hc_cus_golden",
"status": "active",
"stripe_customer_id": "cus_golden",
"tenant_id": "hc_ten_golden",
"updated_at": "2026-10-01T12:00:00Z"
},
"reason": "mailbox does not exist"
},
"event_type": "customer.email_bounced",
"id": "hc_whevt_golden"
}

A customer marked an email from Hardcount as spam, and Hardcount stopped emailing that address. reason is the email provider’s.

Also in data: reason.

Example message
{
"created_at": "2026-10-01T12:00:00Z",
"data": {
"customer": {
"created_at": "2026-08-02T12:00:00Z",
"display_name": "Acme Inc",
"email": "billing@acme.example",
"email_bounce_reason": "mailbox does not exist",
"email_last_bounced_at": "2026-10-01T12:00:00Z",
"email_status": "bounced",
"external_id": "acme-1",
"id": "hc_cus_golden",
"status": "active",
"stripe_customer_id": "cus_golden",
"tenant_id": "hc_ten_golden",
"updated_at": "2026-10-01T12:00:00Z"
},
"reason": "mailbox does not exist"
},
"event_type": "customer.email_complained",
"id": "hc_whevt_golden"
}

Dunning is Hardcount retrying a failed payment on a schedule. data.dunning_run is the run as GET /v1/dunning/runs/{id} returns it under run: its invoice, state, attempts and how it was resolved. Four fields the API adds when you read a run are left out: invoice_number, invoice_amount_due_cents, invoice_currency and max_retry_attempts.

Payment retries started for an invoice.

Also in data: nothing.

Example message
{
"created_at": "2026-10-01T12:00:00Z",
"data": {
"dunning_run": {
"attempt_count": 4,
"created_at": "2026-09-17T12:00:00Z",
"customer_id": "hc_cus_golden",
"id": "hc_drun_golden",
"invoice_id": "hc_inv_golden",
"last_attempt_at": "2026-10-01T11:00:00Z",
"paused": false,
"reason": "payment_failed",
"resolution": "retries_exhausted",
"resolved_at": "2026-10-01T12:00:00Z",
"state": "escalated",
"tenant_id": "hc_ten_golden",
"updated_at": "2026-10-01T12:00:00Z"
}
},
"event_type": "dunning.started",
"id": "hc_whevt_golden"
}

Payment retries ran out, and the final action from your policy was taken. final_subscription_action and final_invoice_action are your policy’s; applied is what was done to this invoice, such as subscription_canceled+invoice_marked_uncollectible, and empty when nothing applied.

Also in data: final_subscription_action, final_invoice_action, applied.

Example message
{
"created_at": "2026-10-01T12:00:00Z",
"data": {
"applied": "subscription_canceled+invoice_marked_uncollectible",
"dunning_run": {
"attempt_count": 4,
"created_at": "2026-09-17T12:00:00Z",
"customer_id": "hc_cus_golden",
"id": "hc_drun_golden",
"invoice_id": "hc_inv_golden",
"last_attempt_at": "2026-10-01T11:00:00Z",
"paused": false,
"reason": "payment_failed",
"resolution": "retries_exhausted",
"resolved_at": "2026-10-01T12:00:00Z",
"state": "escalated",
"tenant_id": "hc_ten_golden",
"updated_at": "2026-10-01T12:00:00Z"
},
"final_invoice_action": "mark_uncollectible",
"final_subscription_action": "cancel"
},
"event_type": "dunning.escalated",
"id": "hc_whevt_golden"
}

Payment retries ended early, for example because the invoice was paid or someone resolved it by hand. The run’s resolution says why.

Also in data: nothing.

Example message
{
"created_at": "2026-10-01T12:00:00Z",
"data": {
"dunning_run": {
"attempt_count": 4,
"created_at": "2026-09-17T12:00:00Z",
"customer_id": "hc_cus_golden",
"id": "hc_drun_golden",
"invoice_id": "hc_inv_golden",
"last_attempt_at": "2026-10-01T11:00:00Z",
"paused": false,
"reason": "payment_failed",
"resolution": "retries_exhausted",
"resolved_at": "2026-10-01T12:00:00Z",
"state": "escalated",
"tenant_id": "hc_ten_golden",
"updated_at": "2026-10-01T12:00:00Z"
}
},
"event_type": "dunning.resolved",
"id": "hc_whevt_golden"
}

data.credit_balance is the customer’s credit balance in one currency, as GET /v1/credits/balance/{customer_id} lists it, after the change that sent the event. The balance events follow the settled balance, not usage, so do not use them to decide whether to keep serving a customer: why.

The settled credit balance in one currency fell below your account’s threshold, threshold_cents. reason says why the balance fell:

  • usage: an invoice drew the credit;
  • expiry: credit expired;
  • adjustment: credit was deducted by hand;
  • refund: a credit note took back credit a top-up bought, for a refund of unused credit, a refund made in Stripe or a lost dispute. Never top up automatically on it: that credit went back because its money went back to the customer.

Also in data: reason, threshold_cents.

Example message
{
"created_at": "2026-10-01T12:00:00Z",
"data": {
"credit_balance": {
"balance_cents": 900,
"currency": "USD",
"customer_id": "hc_cus_golden",
"total_deducted": 500,
"total_expired": 100,
"total_granted": 10000,
"total_retired": 500,
"total_used": 8000
},
"reason": "usage",
"threshold_cents": 1000
},
"event_type": "credit.balance_low",
"id": "hc_whevt_golden"
}

The settled credit balance in one currency reached zero or less. reason says why, as on credit.balance_low.

Also in data: reason.

Example message
{
"created_at": "2026-10-01T12:00:00Z",
"data": {
"credit_balance": {
"balance_cents": 900,
"currency": "USD",
"customer_id": "hc_cus_golden",
"total_deducted": 500,
"total_expired": 100,
"total_granted": 10000,
"total_retired": 500,
"total_used": 8000
},
"reason": "usage"
},
"event_type": "credit.balance_depleted",
"id": "hc_whevt_golden"
}

The settled credit balance in one currency went above zero again.

Also in data: nothing.

Example message
{
"created_at": "2026-10-01T12:00:00Z",
"data": {
"credit_balance": {
"balance_cents": 900,
"currency": "USD",
"customer_id": "hc_cus_golden",
"total_deducted": 500,
"total_expired": 100,
"total_granted": 10000,
"total_retired": 500,
"total_used": 8000
}
},
"event_type": "credit.balance_recovered",
"id": "hc_whevt_golden"
}

A credit note took back prepaid credit from a prepaid commit: credit the customer paid for up front.

  • grant_id: the prepaid credit grant.
  • funding_invoice_id: the invoice that bought it.
  • credit_note_id: the credit note that took the credit back.
  • retired_cents: the credit taken back.
  • refunded_gross_cents: the money the credit note returns.
  • remaining_after_cents: what is left on the grant.

Also in data: grant_id, funding_invoice_id, credit_note_id, retired_cents, refunded_gross_cents, remaining_after_cents.

Example message
{
"created_at": "2026-10-01T12:00:00Z",
"data": {
"credit_balance": {
"balance_cents": 900,
"currency": "USD",
"customer_id": "hc_cus_golden",
"total_deducted": 500,
"total_expired": 100,
"total_granted": 10000,
"total_retired": 500,
"total_used": 8000
},
"credit_note_id": "hc_cn_golden",
"funding_invoice_id": "hc_inv_commit",
"grant_id": "hc_ccl_golden",
"refunded_gross_cents": 500,
"remaining_after_cents": 0,
"retired_cents": 500
},
"event_type": "credit.commit_retired",
"id": "hc_whevt_golden"
}

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