Appearance
Webhooks
Webhooks let your WeWeb backend run workflows when something happens in Stripe—for example when a payment succeeds, a subscription is created, or a checkout session is completed—even when the user is no longer on your site.
What you need
- Webhook enabled on your Stripe connection in WeWeb.
- A webhook endpoint in the Stripe Dashboard pointing to your WeWeb backend URL.
- A backend workflow in WeWeb with a Stripe trigger that matches the events you care about.
Step 1: Enable the webhook in WeWeb
- In WeWeb, open Integrations → Stripe and edit your connection (for the environment you use: Editor, Staging, or Production).
- Set Stripe Webhook to Enabled.
- Set Webhook Path (e.g.
/stripe/webhook). The full URL is your backend base URL +api+ this path (e.g.https://your-backend.weweb.io/api/stripe/webhook). Use Copy url to copy it. - Leave Webhook Secret Key empty for now; you’ll paste it after creating the endpoint in Stripe.
Step 2: Add the endpoint in Stripe
- Go to Stripe Dashboard → Webhooks.
- Click Add endpoint.
- Endpoint URL — paste the URL you copied from WeWeb (the one that includes
apiand your path). - Choose which events to send (e.g.
checkout.session.completed,payment_intent.succeeded,invoice.paid,customer.subscription.updated). You can add more later. - After saving, Stripe shows a Signing secret (
whsec_...). Copy it.
Step 3: Paste the signing secret in WeWeb
Back in your Stripe connection in WeWeb, paste the Signing secret into Webhook Secret Key and save. This lets WeWeb verify that incoming requests really come from Stripe.
Step 4: Create a backend workflow with a Stripe trigger
- In WeWeb, create a backend workflow (Data & API or Workflows, depending on your setup).
- Set the trigger to a Stripe trigger and choose the one that matches the events you selected (e.g. On checkout session event, On payment intent event).
- In the workflow, the Stripe payload is in context.event. The event type (e.g.
completed,succeeded) is in context.event.action. - Use a Switch action on
context.event.actionto branch (e.g. run different logic whenactionissucceededvsfailed).
Available webhook triggers
| Trigger | When it runs | Useful for |
|---|---|---|
| On checkout session event | Session completed or expired | Grant access, save order, send confirmation after Checkout. |
| On payment intent event | Created, succeeded, failed, or canceled | Update order status, grant access, retry logic. |
| On subscription event | Created, updated, deleted, paused, resumed | Sync plan status, send emails, provision/revoke access. |
| On invoice event | Created, updated, paid, payment_failed, finalized | Send receipts, dunning, renewals. |
| On charge event | Succeeded, failed, refunded, updated | Analytics, receipts, refund handling. |
| On customer event | Created, updated, deleted | Sync customer data. |
| On product event | Created, updated, deleted | Sync catalog. |
| On price event | Created, updated, deleted | Sync pricing. |
Next: Workflow examples

