Stripe webhook handler
POST
/webhooks/stripe
const url = 'https://example.com/api/webhooks/stripe';const options = {method: 'POST', headers: {'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://example.com/api/webhooks/stripe \ --header 'Content-Type: application/json' \ --data '{}'Handles checkout.session.completed, subscription events. Idempotent via event ID.
Request Body required
Section titled “Request Body required ” Media type application/json
object
Responses
Section titled “ Responses ”Success
Media type application/json
object
ok
required
boolean
Signature verification failed