● Set up · Getting paid
Stripe webhook
so every payment is recorded.
Stripe tells Vodmill about payments by calling a webhook. Without it a customer pays and the app never gives them the plan or the credits. Set it up before you turn selling on.
01Add the endpoint
- Open Stripe Dashboard, Developers, Webhooks, Add endpoint.
- Endpoint URL
https://your-domain/webhooks/stripe: your public URL plus/webhooks/stripe. - Events to send the five below.
- Signing secret Save, reveal the signing secret (
whsec_…) and paste it in the console under System, Integrations, Stripe webhook signing secret (orSTRIPE_WEBHOOK_SECRETin.env). - Secret key Paste the secret key (
sk_live_…orsk_test_…) in the same section.
checkout.session.completed
checkout.session.async_payment_succeeded
invoice.paid
customer.subscription.updated
customer.subscription.deleted
Until the secret is set
The endpoint answers 503 {"error":"Webhook secret not set"} (checked on a fresh 1.0.0 install). Every call's signature is verified before anything is trusted (src/server/billing.ts).
02What each event does
| Event | Effect |
|---|---|
checkout.session.completed (credit pack, paid) | Adds the pack's credits and records the payment |
checkout.session.completed (plan) | Puts the workspace on the plan and links the subscription |
checkout.session.async_payment_succeeded | Same as a completed checkout, for payment methods that confirm later |
invoice.paid | Records the payment, adds the plan's monthly credits, marks the subscription active |
customer.subscription.updated | Stores the subscription status (for example past_due) |
customer.subscription.deleted | Marks it canceled and moves the workspace to the first active free plan |
Every event is recorded once by its id, so Stripe's retries never add credits twice. If an invoice arrives before the checkout event, the server answers with an error on purpose so that Stripe sends it again a little later.
03Test first, then go live
- Use test keys (
sk_test_…) and a test-mode webhook. - Buy a credit pack in the app with Stripe's test card.
- Check the workspace's credits on the console's Workspaces page, and the delivery in Stripe's dashboard.
- Switch to the live keys and add a live-mode webhook. It has its own signing secret: paste that one too.
If a customer paid but has no plan or credits, see Troubleshooting.