Stripe webhooks: disputes, failed payments and payouts as signals

Point a Stripe event destination at a Pulso webhook source and turn disputes, failed payments and failed payouts into signals, each with the steps to handle it.

Stripe sends an event for everything that happens in your account. Send the ones that need a person to a Pulso webhook source and each becomes a signal with a playbook: a dispute to answer before its deadline, a customer whose card keeps failing, a payout that didn’t reach the bank.

Connect Stripe#

Add Stripe to Pulso to create a webhook source called Stripe; it shows these steps with the source’s URL and takes its signing secret, then creates the monitors below that you pick, with their playbooks and a report. To start from scratch instead, create a webhook data source called Stripe.

  1. In Stripe, open the Webhooks tab in Workbench and click Create an event destination.
  2. Select Your account.
  3. Choose the Snapshot payload format and an API version. Stripe recommends Thin for new code, but a thin event only carries the event type and the id of the object it’s about, with no amount, status or reason for a monitor to filter on.
  4. Select the event types, such as those on this page, then Webhook endpoint as the destination type.
  5. Paste the source’s Endpoint URL, https://hooks.pulso.run/webhooks/<id>/<token>, as the destination’s Endpoint URL and save.
  6. Open the destination, reveal its Signing secret (whsec_…) and paste it as the source’s signing secret: below these steps in Add to Pulso, or from scratch in its signature settings with the Stripe scheme.

Through Stripe’s API, the same destination is a POST /v2/core/event_destinations with "type": "webhook_endpoint", "event_payload": "snapshot", the event types in enabled_events and the Pulso URL in webhook_endpoint.url.

One source can take every Stripe event: each event carries its type, and each monitor picks its own with a filter. To try it, create the destination in a sandbox and trigger an event with the Stripe CLI, for example stripe trigger payment_intent.succeeded; it shows up under the source’s Recent events.

What arrives#

A snapshot event is the whole Event object, with the object it’s about in data.object. This is Stripe’s Event example with its Dispute example as data.object, trimmed:

{
  "id": "evt_1NG8Du2eZvKYlo2CUI79vXWy",
  "object": "event",
  "api_version": "2019-02-19",
  "created": 1686089970,
  "data": {
    "object": {
      "id": "du_1MtJUT2eZvKYlo2CNaw2HvEv",
      "object": "dispute",
      "amount": 1000,
      "balance_transactions": [],
      "charge": "ch_1AZtxr2eZvKYlo2CJDX8whov",
      "currency": "usd",
      "evidence_details": {
        "due_by": 1682294399,
        "has_evidence": false,
        "past_due": false,
        "submission_count": 0
      },
      "metadata": {},
      "payment_intent": null,
      "reason": "general",
      "status": "warning_needs_response"
    }
  },
  "livemode": false,
  "pending_webhooks": 0,
  "request": { "id": null, "idempotency_key": null },
  "type": "charge.dispute.created"
}

Its monitors see these columns:

Column Value
id evt_1NG8Du2eZvKYlo2CUI79vXWy
type charge.dispute.created
created 1686089970
data.object.id du_1MtJUT2eZvKYlo2CNaw2HvEv
data.object.amount 1000
data.object.currency usd
data.object.charge ch_1AZtxr2eZvKYlo2CJDX8whov
data.object.reason general
data.object.status warning_needs_response
data.object.evidence_details.due_by 1682294399
data.object.evidence_details.has_evidence false
data.object.balance_transactions [], the whole list in one column
data.object.metadata {}
data.object.payment_intent null
livemode false
request.id null

Amounts are integers in the currency’s smallest unit, so 1000 is $10.00, and times are Unix timestamps in seconds.

Monitors to build#

Disputes to answer#

Large failed payments#

Subscriptions that keep failing#

Failed payouts#

Heartbeat: payments stop arriving#

Add payment_intent.succeeded to the destination’s events and create a heartbeat monitor on the source: filters type equals payment_intent.succeeded, Frequency hourly, a grace period of 30 minutes. If an hour goes by without a successful payment, it raises a signal, which catches a broken checkout as well as a destination Stripe disabled. Pick hours your shop actually sells in with a custom schedule, like 0 9-21 * * *.

Limits#

Sources: Stripe’s webhooks guide, how events work, the Event, Dispute and PaymentIntent objects, and the event types.


Add Stripe to Pulso: a webhook source, 5 monitors with their playbooks and a report, then these steps with the source's URL.

Add to Pulso

See the monitors, their playbooks and the report