Webhook setup
Stripe webhook endpoint
Stripe already signs every webhook with your endpoint's signing secret. stubkit verifies the HMAC-SHA256 with a five- minute replay tolerance and processes the event.
Endpoint to paste
https://api.stubkit.com/v1/webhooks/stripe/your-appUse one endpoint per tenant — the signing secret is tenant-scoped.
Dashboard steps
- Stripe Dashboard → Developers → Webhooks → Add endpoint.
- URL: the endpoint above.
- Events to send (minimum):
customer.subscription.createdcustomer.subscription.updatedcustomer.subscription.deletedinvoice.paidinvoice.payment_failedcharge.refunded
- Copy the signing secret (
whsec_...) and paste it into dash.stubkit.com → Apps → your app → Settings → Providers.
Tenant user routing
stubkit uses stubkit_user_id in the subscription metadata to map a Stripe subscription to a tenant user. Set it when you create the checkout session:
await stripe.checkout.sessions.create({
mode: 'subscription',
line_items: [{ price: 'price_123', quantity: 1 }],
subscription_data: {
metadata: {
stubkit_user_id: currentUserId,
stubkit_entitlement: 'pro',
},
},
});What we store
The raw event body is archived under stripe/<tenant>/yyyy/mm/dd/<event.id>.json. stubkit uses event.id as the idempotency key, so re-sent webhooks (Stripe retries aggressively) never create duplicate state.