StatsHub Docs
APIEndpoint referenceStripe

/stripe/webhook

The body is read raw and verified before anything else looks at it.

POST
/api/stripe/webhook

The body is read raw and verified before anything else looks at it. Stripe signs the exact bytes, so decoding and re-encoding would change key order and break verification — this handler must be the first thing to touch the body.

Every outcome except a signature failure is a 200. Stripe retries a non-2xx, and retrying will not fix an event we chose not to handle or a row that is already up to date.

Authorization

stripeSignature
Stripe-Signature<token>

Stripe webhook signature over the unmodified request body.

In: header

Header Parameters

Stripe-Signature?string

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

body*unknown

Response Body

application/json

application/json

application/json

curl -X POST "https://example.com/api/stripe/webhook"
{  "received": true}