Skip to content

Integration

Webhooks + Bastle

What syncs from Webhooks, what it makes possible, and how to connect it.

Live

This connector ships today. Connect it from workspace settings and Bastle backfills the history the source will serve.

What does the Webhooks integration do?

Bastle sends outbound webhooks for subscription, charge, trial and dunning events derived from every connected source, signed with an HMAC header and retried on a backoff schedule across roughly fourteen hours. Endpoints subscribe with exact event types or wildcard patterns, and delivery history is visible in settings. This is shipped and self-serve today.

What syncs

Bastle reads the following from Webhooks and normalises it into the same entities every other source produces. Ingestion is read-only: nothing is created, changed or cancelled upstream.

  • Customer events: created, updated.
  • Subscription events: created, updated, cancelled.
  • Money events: charge succeeded, charge failed, refund created.
  • Trial events: started, converted, cancelled.
  • Dunning events: recovered, failed.
  • System events: import completed, backfill completed.
  • Cadence: enqueued as the event is written, drained by a scheduled dispatcher.

Once connected

What Webhooks data unlocks

Connecting a source is not the point; what you can answer afterwards is. These are the questions this data makes answerable.

Normalised events across every source

A cancellation from Stripe, Recurly and the write API arrive in one shape. Anything you build downstream is written once rather than once per provider.

Signed deliveries

Each request carries an HMAC signature over the payload, so a receiver can verify a delivery genuinely came from Bastle before acting on it.

Retries that survive an outage

A failed delivery is retried on an escalating schedule spanning roughly fourteen hours, so a receiver down for a deploy does not silently lose events.

Pattern subscriptions

An endpoint can subscribe to exact types, to a prefix wildcard such as every subscription event, or to everything. An empty subscription list means all events.

Setup

Connecting Webhooks

The whole flow, start to first chart. No implementation call and no data engineer.

  1. Open Settings → WebhooksEndpoints are managed here, with a preview of recent deliveries and their response codes and latencies.
  2. Add an endpoint URLBastle POSTs a JSON envelope containing the event id, type, creation time and data payload.
  3. Choose event typesPick exact types, use a prefix wildcard, or subscribe to everything. Narrow subscriptions mean less traffic and fewer receiver branches.
  4. Verify the signature on your sideRecompute the HMAC over the raw request body with your endpoint secret and compare in constant time before doing any work.

The gap this fills

Subscription analytics tools generally read data and stop there, which leaves you polling an API to find out that a customer cancelled. Outbound webhooks invert that: Bastle tells you. Because the events are derived after normalisation, they are the same shape regardless of which billing system produced them — a downstream service written against a Bastle cancellation event keeps working when you migrate processors.

Delivery semantics

Deliveries are enqueued when the underlying event is written and drained by a scheduled dispatcher. A failed attempt is retried after one minute, then five, then thirty, then two hours, then twelve, for six attempts in total across roughly fourteen hours. Delivery is at-least-once: a receiver that times out after processing may see the same event again, so key your handlers on the event id.

Verifying a delivery

Every request carries a signature header computed as an HMAC over the raw body with your endpoint's secret. Verify it against the raw bytes — not the re-serialised JSON, which may differ by whitespace or key order — and compare in constant time. A webhook receiver that skips verification is a public write endpoint for anyone who learns the URL.

Choosing what to subscribe to

Subscribing to everything is convenient and usually wrong: most receivers care about two or three types and will branch past the rest. Prefix wildcards are the middle ground when you want a whole family, such as every subscription event, without enumerating each one.

Related

Other sources

Companies billing through Webhooks usually have at least one of these in the stack too.

Webhooks and Bastle: common questions

How does Bastle sign webhook deliveries?

With an HMAC-SHA256 signature over the raw request body, sent as a header. Recompute it on your side using your endpoint secret and the exact bytes received, then compare in constant time before processing the request.

What happens if my endpoint is down?

The delivery is retried on an escalating schedule — one minute, five, thirty, two hours, twelve — for six attempts spanning roughly fourteen hours. After that the delivery is marked failed and remains visible in the delivery history rather than disappearing.

Can I receive an event more than once?

Yes. Delivery is at-least-once, so a receiver that processes an event and then times out will see it again on retry. Every envelope carries an event id; key your handler on it and repeated deliveries become harmless.

Do webhooks work with the write API as a source?

Yes. Events are emitted after normalisation, so data pushed through the write API produces the same subscription, charge and trial events as data ingested from a billing connector, plus an import-completed event when a batch lands.

Connect Webhooks and see your own history.

Bastle backfills what Webhooks will serve, then keeps current over webhooks — usually a couple of minutes before the first real chart. Free while in beta, no card required.