payment_failed, not instead of it. payment_failed fires on every failed charge attempt, so one invoice can produce several. invoice_past_due marks the moment the account itself is behind on payment.
JavaScript
Track it from the browser when your app first learns the invoice is past due, for example when it renders a billing banner. Pass a stableeventId as the third argument so repeat page loads count as one event.
Server-side
Billing changes usually reach you as webhooks, wherewindow._upstack() isn’t available. Send the event from your server with POST /tr/api/events instead. The API key needs the events:write scope.
This Express handler watches Stripe’s customer.subscription.updated event. When the subscription status is past_due, it looks up the subscription’s latest invoice and sends invoice_past_due to Upstack.
customer.subscription.updated for any change to the subscription, so a past-due subscription can trigger the handler more than once. The eventId takes care of that: Upstack skips an event whose eventId it has already seen in the last 30 days, so each invoice is counted once.
If you bill with invoices that have a due date instead of automatic charges, Stripe’s invoice.overdue event is the closer match. It fires a set number of days after an invoice’s due date, and you choose the number of days in Stripe’s billing automations. Its payload is the invoice itself, so you can skip the stripe.invoices.retrieve call.
Properties
Upstack doesn’t reject an
invoice_past_due event with missing properties, but send accountId and invoiceId so you can tell events apart later.
Send
value as well as amount if you want the money owed to show in reports. Upstack’s Invoice Past Due Value measure adds up value. It ignores amount.When to fire
- A subscription’s status changes to
past_due(Stripecustomer.subscription.updated) - An invoice with a due date is still unpaid after that date (Stripe
invoice.overdue) - Your own billing system flags an invoice as overdue
payment_failed.
Where it goes
- Reports. Three measures are available on custom dashboards: Invoice Past Due (count), Invoice Past Due Value, and Cost per Invoice Past Due.
- Klaviyo. Sent by default as the metric
Invoice Past Due - Upstack, so you can start a collection flow from it. See Klaviyo. - Meta, Microsoft Ads and Reddit. Sent by default as a custom event named
invoice_past_due. Meta needs the custom event approved before you can optimize on it. See How to approve Meta custom events. - Other destinations. Not sent by default. Add it on the destination’s Event Mappings tab with a destination event mapping. LinkedIn, Snapchat, AppLovin, and NewsBreak can’t receive custom events.
Related events
payment_failed
Each failed charge attempt, usually before the invoice goes past due
invoice_paid
The invoice is settled and the account recovers
invoice_created
The invoice is issued
subscription_churned
The subscription ends after collection fails