Skip to content
Every tutorial here is 100% free — and always will be
LSLovableStudent
Ecommerceadvanced

Add Stripe Subscriptions

Checkout, webhooks and access control driven by real subscription state.

When to use it

Recurring revenue

Lovable Prompt
Add subscription billing to this project.

Plans: [LIST YOUR PLANS AND PRICES].

Requirements:
- Create checkout sessions from server code only. The secret key must be a server secret.
- Add a webhook endpoint that verifies the signature before doing anything.
- Treat the webhook, not the browser redirect, as the source of truth for subscription state.
- Store subscription status, plan and current period end against the user.
- Gate features on the stored subscription status.
- Handle cancellation, payment failure and reactivation.
- Make webhook handling idempotent so duplicate deliveries do not double-apply.

Test with a successful card, a declined card, and an abandoned checkout.

Build your version of this prompt

Fill in your details and the prompt below updates as you type. Anything you skip stays as a square-bracket placeholder so you can see what's still missing.

Your prompt
Add subscription billing to this project.

Plans: [List your plans and prices].

Requirements:
- Create checkout sessions from server code only. The secret key must be a server secret.
- Add a webhook endpoint that verifies the signature before doing anything.
- Treat the webhook, not the browser redirect, as the source of truth for subscription state.
- Store subscription status, plan and current period end against the user.
- Gate features on the stored subscription status.
- Handle cancellation, payment failure and reactivation.
- Make webhook handling idempotent so duplicate deliveries do not double-apply.

Test with a successful card, a declined card, and an abandoned checkout.

1 field still empty — the prompt works better when they're filled in.

How to use this prompt
  1. Fill in the fields above — plain language beats jargon.
  2. Copy the prompt and paste it into Lovable as a single message.
  3. Let it finish before you send anything else, then read what changed.
  4. If the result is close but not right, describe the difference rather than restating the whole prompt.

Suggested follow-up prompt

Review what you just built for Add Stripe Subscriptions.

1. List anything you changed that I did not ask for, and undo it.
2. Check it works on a 375px-wide phone screen: no horizontal scrolling, tap targets at least 44px.
3. Confirm every form shows a clear error and a clear success state.
4. Tell me in plain language what is still missing before this is safe to publish.

Do not add new features in this step.

Why it works

It names the webhook as the source of truth and requires idempotency, which are the two things generated billing code usually gets wrong.

Was this prompt helpful?

Guides that use this prompt

Website made, maintained and hosted by PromptSites.com

PromptSites logo