Skip to Content
SPAPS is proprietary hosted SaaS. Paid access required; pre-1.0 contracts may change. Terms and access
GuidesWebhooks And Event Delivery

Webhooks And Event Delivery

SPAPS has two webhook jobs. It receives trusted provider events such as Stripe and Mailgun, and it delivers outbound events to registered downstream endpoints. Both directions need signing, idempotency, and destination governance because webhook bugs can become billing errors, email leaks, or SSRF risks.

Mental Model

Main Surfaces

SurfaceLocationNotes
Stripe webhooksdomains/stripe/webhook_handler.pySignature validation, idempotent event dispatch, checkout/subscription/invoice handling
Mailgun webhooksdomains/webhooks/router.py, domains/webhooks/signing.pyInbound signature verification and event ingestion
Outbound webhooksdomains/webhooks/delivery.pyHTTP delivery, retries, and signing
Destination governancedomains/webhooks/destination_security.pyDomain/IP checks to reduce SSRF and unsafe destinations

Example Local Inspection

curl http://localhost:3301/health/ready curl http://localhost:3301/api/metrics

Common Mistakes

Never accept arbitrary production webhook destinations without governance. Production startup checks require destination policy to be in an allowed posture.

  • Skipping signature validation because a webhook route is “internal”.
  • Retrying delivery without idempotency.
  • Testing with real provider webhooks instead of deterministic mocked payloads.

See Also