payment_intent.succeeded, charge.refunded, and charge.dispute.created event automatically creates a Financial Event in your ledger — no polling, no manual entry. Once events land, Precipiq’s correlation worker scores them against recent AI decisions so you can see which agent actions drove which revenue outcomes.
Setup
Get your Precipiq API key
In the Precipiq dashboard, go to Settings → API keys and copy your
pq_live_... value. You’ll need it in the next step.Create the Stripe webhook endpoint
In the Stripe dashboard, create a new endpoint pointing at:Subscribe at minimum to these three events:
payment_intent.succeededcharge.refundedcharge.dispute.created
whsec_ — copy it.Add the Precipiq API key as a custom header
On the same Stripe webhook endpoint, add a custom header so Precipiq can identify your organisation:
| Header | Value |
|---|---|
X-Precipiq-Key | pq_live_... |
Save the signing secret in Precipiq
In the Precipiq dashboard, go to Settings → Integrations → Stripe, paste the
whsec_... secret, and save. Precipiq uses this to verify the stripe-signature header on every incoming payload and rejects anything that doesn’t match.What happens when an event lands
When Stripe delivers a webhook, Precipiq processes it in four stages:- Signature verification — the
stripe-signatureheader is checked against your savedwhsec_secret. Payloads that fail verification are rejected immediately. - Duplicate detection — Stripe retries webhooks aggressively. If Precipiq has already seen the
stripe_event.id, the duplicate is silently discarded withprocessed: false, reason: "duplicate event; already processed". - Financial Event creation — the amount, currency, and event type are extracted from the payload and written as a new Financial Event in your ledger.
- Correlation — the correlation worker runs every 5 minutes and scores the new event against recent decisions. High-confidence matches become auto-links; middling matches appear as suggested links for you to review.
Sign conventions
Stripe always sends positive amounts. Precipiq applies the correct sign at ingestion based on the event type:| Stripe event | Precipiq type | Sign |
|---|---|---|
payment_intent.succeeded | payment | + |
charge.refunded | refund | − |
charge.dispute.created | chargeback | − |
Zero-decimal currencies
Security
- The webhook receiver fails closed — if no
STRIPE_WEBHOOK_SECRETis configured, signature verification is impossible and no webhooks are ingested. - Both a valid
stripe-signatureheader and a validX-Precipiq-Keyheader are required. Possession of either one alone is not enough to inject events into your ledger. - The endpoint is rate-limited at 100 requests per second. This is well above normal Stripe traffic volumes and acts as a safeguard against replay floods if a signing secret is ever leaked.