Stripe webhook
POST
/billing/webhook
const url = 'https://api.sloose.com/billing/webhook';const options = { method: 'POST', headers: {'Stripe-Signature': 'example', 'Content-Type': 'application/json'}, body: '{}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.sloose.com/billing/webhook \ --header 'Content-Type: application/json' \ --header 'Stripe-Signature: example' \ --data '{}'Stripe calls this; you should not. The signature is verified against STRIPE_WEBHOOK_SECRET over the raw request body, and each event is processed once, keyed on its event id, so a redelivery is harmless.
A handler that fails answers 500 on purpose, so Stripe retries. Everything else is acknowledged.
Parameters
Section titled “Parameters”Header Parameters
Section titled “Header Parameters”Stripe-Signature
required
Stripe’s signature over the raw body.
string
Stripe’s signature over the raw body.
Request Bodyrequired
Section titled “Request Bodyrequired”The raw Stripe event, signed with the Stripe-Signature header.
Media typeapplication/json
A Stripe event.
object
Examplegenerated
{}Responses
Section titled “Responses”Acknowledged.
Missing or invalid signature.
A handler failed. Answered deliberately so Stripe retries.
No webhook secret is configured on this deployment.