Skip to main content
Fires when a payment attempt fails. Use this event to trigger dunning workflows and identify at-risk subscriptions.

JavaScript

window._upstack('track', 'payment_failed', {
  accountId: 'acct_abc123',
  invoiceId: 'inv_ghi012',
  subscriptionId: 'sub_def456',
  amount: 9900,
  failureReason: 'card_declined',
  failureCode: 'insufficient_funds',
  currency: 'USD'
});

Properties

PropertyTypeRequiredDescription
accountIdstringYesAccount identifier
amountnumberYesFailed payment amount in cents
invoiceIdstringNoInvoice identifier
subscriptionIdstringNoSubscription identifier
failureReasonstringNoFailure reason code
failureCodestringNoDetailed failure code
currencystringNoISO 4217 currency code

When to Fire

  • When card is declined
  • When insufficient funds error occurs
  • When Stripe invoice.payment_failed webhook fires

Stripe Webhook

Maps to invoice.payment_failed.
Track payment failures to identify at-risk customers and trigger dunning workflows.