Monitor failed payments
Catch failed charges the second they happen, with the customer, amount, and decline reason attached, so a billing problem becomes a message instead of a churn surprise.
the event
Emit payment.failed once; route it anywhere below.
- customer_idstring
- emailstring
- amountnumberminor units
- currencystringISO 4217
- reasonstringprocessor decline code
- attemptnumber
import { ingest } from "@ingestlayer/sdk";
await ingest("payment.failed", {
customer_id: charge.customer,
email: charge.receipt_email,
amount: charge.amount,
currency: charge.currency,
reason: charge.failure_code,
attempt: charge.attempt,
}, {
idempotencyKey: `${charge.id}:${charge.attempt}`,
});send it to
- Monitor failed payments in SlackSlack
- Monitor failed payments in DiscordDiscord
- Monitor failed payments in TelegramTelegram
- Monitor failed payments in EmailEmail
- Monitor failed payments in WebhookWebhook
- Monitor failed payments in PostgresPostgres
- Monitor failed payments in NotionNotion