Webhooks 101
Learn the basics of deploying, ingesting, and verifying webhooks from Straddle.
The Straddle APIs utilize webhooks to notify you in real-time when certain events occur within your platform or account. At their core, webhooks are simply HTTP POST requests to a pre-configured endpoint that you control.
How Webhooks Work
-
Event Occurs: A relevant event happens within the Straddle platform (e.g., a customer makes a payment).
-
Webhook Sent: Straddle sends a POST request to your designated endpoint with a JSON payload describing the event.
-
Your Response: To indicate successful processing, return a 2xx (200–299) HTTP status code within 15 seconds. This assures Straddle you’ve received the event and prevents unnecessary retries.
Make sure to disable CSRF protection on your webhook endpoint if your framework has it enabled by default.
Why Verify?
To ensure that the webhook you receive is indeed from Straddle and not from a malicious source, it’s important to:
-
Verify the Signature: Check the cryptographic signature attached to the event.
-
Verify the Timestamp: Validate the event’s timestamp to prevent replay attacks.
See the Why Verify Webhooks section for more details.
Key Concepts at a Glance
Verification
Ensure authenticity by verifying signatures and timestamps.
Timely Response
Respond with a 2xx status code within 15s to confirm receipt.
Filtering Events
Subscribe only to the events you need to reduce noise.
Replay & Recovery
Easily replay events from the dashboard if something goes wrong.
Dashboard Console
The Straddle Dashboard provides a comprehensive webhook console for managing your webhook integration:
-
Configure Endpoints: Add or edit endpoints that receive webhooks.
-
Select Event Types: Subscribe to the events that matter to you.
-
Monitor Deliveries & History: View timestamps, statuses, and payload data of past deliveries.
-
Inspect Payloads: Examine each event’s payload to assist in debugging.
-
Retry & Replay: Manually resend events that may have failed.
-
Activity Tracking: Understand what happened and when.
Get Started Quickly
Use the Dashboard
Set up endpoints and configure event types right from the dashboard.
Test with Dummy Data
Use Svix Play or the built-in debugger to simulate events before going live.
Secure Your Endpoint
Implement signature and timestamp checks to ensure payload integrity.
Go Live
Once tested, deploy your endpoint and start receiving real-time events.
While the dashboard is the quickest way to get started, you can also use the Straddle API to build custom webhook management workflows tailored to your environment.
With these fundamentals in place, you’re ready to confidently integrate and handle webhooks from Straddle.