Stripe Integration
Set up HookWatch to receive Stripe webhooks for payment events like successful charges, subscription updates, and refunds.
Prerequisites
- A HookWatch account
- A Stripe account with API access
- A server endpoint to process webhook payloads
Step 1: Create a HookWatch endpoint
- Go to your Endpoints page
- Click "Create Endpoint"
- Enter a name like "Stripe Webhooks"
- Enter your destination URL (where you want webhooks forwarded)
- Copy the generated webhook URL
Your HookWatch URL will look like:
https://hook.hookwatch.dev/wh/abc123xyzStep 2: Configure Stripe webhooks
- Go to Stripe Dashboard > Developers > Webhooks
- Click "Add endpoint"
- Paste your HookWatch URL in the "Endpoint URL" field
- Select the events you want to receive (see recommended events below)
- Click "Add endpoint"
Recommended events for most use cases:
checkout.session.completedpayment_intent.succeededpayment_intent.payment_failedcustomer.subscription.createdcustomer.subscription.updatedcustomer.subscription.deletedinvoice.paidinvoice.payment_failedStep 3: Save your webhook secret
After creating the endpoint in Stripe, you'll see a Signing secret (starts with whsec_). Save this securely
- you'll need it to verify webhook signatures.
Important
HookWatch forwards the original Stripe-Signature header, so you can still verify webhook authenticity on your server.
Step 4: Verify webhooks on your server
Use Stripe's SDK to verify the webhook signature on your server. Here's an example:
Testing the integration
Stripe provides a way to send test webhooks:
- Go to your webhook endpoint in Stripe Dashboard
- Click "Send test webhook"
- Select an event type and click "Send test webhook"
- Check your HookWatch Events page to see the event
You can also use the Stripe CLI to forward test webhooks locally during development.
Common issues
Webhook signature verification fails
Make sure you're using the webhook secret from the specific endpoint you created, not your Stripe API secret key. Each webhook endpoint has its own unique signing secret.
Webhooks not arriving
Check that your endpoint is set to receive events in the correct mode (test vs. live). Stripe test mode and live mode have separate webhook configurations.
400 Bad Request on your server
Ensure you're parsing the raw request body, not JSON. Stripe's signature verification requires the raw body exactly as received.