Monitor your Stripe webhook

If your Stripe webhook endpoint goes down for an hour, customers think their cancellation worked. Refunds didn't process. Subscriptions didn't activate. You don't find out from Stripe — you find out from a support ticket the next day.

A naïve monitor that just sends GET /api/stripe/webhook won't help: it'll always return 405 (method not allowed), or you'll get fake data through your verifier and reject everything. Here's how to do it right.

Approach 1 — POST a synthetic payload (recommended)

Valpero supports POST monitors with custom headers and body. Stripe's webhook endpoint should accept a synthetic ping with a special test key — your endpoint should specifically allow it.

1. Add a code path that recognizes pings

@router.post("/api/stripe/webhook")
async def stripe_webhook(request: Request):
    if request.headers.get("x-valpero-ping") == settings.VALPERO_PING_TOKEN:
        return {"ok": True, "ping": True}
    body = await request.body()
    sig = request.headers.get("stripe-signature", "")
    # …normal Stripe verification below

2. Create a Valpero monitor

HTTP, POST, body {}, headers X-Valpero-Ping: <your token>. Add a keyword check for "ping": true.

If your endpoint is unreachable, returns 5xx, or stops returning the keyword, Valpero alerts you within 30 seconds (Pro plan).

Approach 2 — Watch a downstream side-effect

If you can't add a synthetic-ping branch, watch what happens after a real webhook. The cheapest version is a heartbeat monitor — your webhook handler hits a Valpero heartbeat URL after every successful event:

import requests
requests.get("https://valpero.com/heartbeat/PING_TOKEN")

If no event arrives in N minutes, you get an alert. Catches both "endpoint down" and "Stripe is no longer sending us events."

Don't use heartbeats alone. They miss the case where your endpoint quietly returns 200 but doesn't process the event. Combine with Approach 1.

Bonus — alert on Stripe's own status

Add a Valpero monitor against https://status.stripe.com/ with a keyword check for All Systems Operational. When Stripe itself is degraded, you'll know before your customers ask.

Wrapping up

Three monitors total — synthetic POST, heartbeat, Stripe's own status. None of them costs more than 30 seconds of latency overhead. All three together turn the webhook into a system you can sleep through.

// share:
// try the tools: SSL · DNS · Ping · Headers

Stop checking by hand. Get paged automatically.

Free forever for one site. No card required.

Start free →
// related
Custom domain for your status page
6 min read
Redeeming an AppSumo / lifetime deal code
3 min read
Free web tools — what each one does
5 min read