Add Stripe checkout (one-time and subscriptions)
Take real payments — one-off purchases and recurring subscriptions.
When to use this
When you're ready to charge for a product, service, plan or booking deposit.
Before you start
- A Stripe account — free to create at stripe.com. Stay in test mode while building; you don't need a live business account to try this.
- Your products in Stripe: create each thing you sell (Stripe Dashboard → Products), one-time or recurring, and copy each price's ID (starts with
price_). - Your Stripe secret key (Dashboard → Developers → API keys, the test one starting
sk_test_). Paste it where your builder stores secrets — never into a page or a chat message. - Logins should already work (customers need an account to have a subscription).
The prompt
Add Stripe payments to my app. Outcome: customers can pay securely for [what I'm selling — e.g., a product / a plan / a booking deposit]. Requirements: - A checkout for [one-time payment of $X / a subscription at $X per month / both]. - A pricing section with [these plans and prices] and a clear call to action. - After payment: a confirmation page, a receipt by email, and mark the order/subscription as active. - Use Stripe Checkout so I never store card details myself. Must-haves: keep all Stripe secret keys on the server (never in the frontend), verify each payment with a Stripe webhook before granting access, and handle declined cards, cancellations and refunds gracefully. Set it up in Stripe TEST mode first. When done, tell me how to test a payment and exactly what to change to go live.
Already building? Paste this into your project. Starting fresh? Open a free account with a compatible builder below.
Build it on
What this creates
- A pricing page listing what you sell
- A checkout flow that hands payment to Stripe's own secure page
- A "thanks, you're in" page after successful payment
- A record of who paid for what, so your app knows their status
Check it worked
Paste the prompt, wait for the build to finish, then confirm these — in plain language, no technical checks needed:
- Clicking a buy button opens Stripe's payment page with the correct price and currency
- Paying with Stripe's test card (4242 4242 4242 4242, any future date, any CVC) completes and returns you to the thank-you page
- The payment appears in your Stripe dashboard's test payments
- Your app now treats that account as a paying customer (their status changed)
- Cancelling at the payment screen returns you to the site without charging or unlocking anything
Something missing? That's normal — ask for it in one short follow-up message rather than re-running the whole prompt.
Next steps
Let customers manage their own subscription
As soon as recurring payments work
Add a "Manage my subscription" button on the account page that sends the customer to Stripe's own customer portal, where they can update their card, change plan or cancel, and then returns them to my site. Show their current plan and next billing date on the account page.
You'll know it worked when: A paying test customer can cancel from the portal, and your app shows the updated status afterwards.
Lock the paid content properly
Right after checkout works
Make sure paid-only content is genuinely restricted to paying customers: check that someone with a free account, and someone not logged in at all, cannot reach it by typing the address directly. The restriction must be enforced on the data itself, not only by hiding buttons. Show non-paying visitors a short upgrade message instead.
You'll know it worked when: A free test account sees the upgrade message and cannot reach the paid content by any route you can find.
Send a receipt-style welcome email
Once payments are reliable
After a successful payment, send the customer a short friendly email confirming what they bought, what they now have access to, and how to get help. Send me a notification of the sale as well.
You'll know it worked when: A test purchase produces an email to the customer and a notification to you.
Watch out for
- Test mode looks identical to live mode. Before launch, swap the test key for the live one and run one real payment yourself — many people discover on their first customer that they never switched.
- Payment success and access are two different things. Confirm the account's status actually changed after paying; if it didn't, say exactly that in one follow-up message rather than re-running the prompt.
- Never put your secret key in a page or a prompt. It goes in your builder's secrets area only. If it ever leaks, roll it in Stripe immediately.
- Refunds, taxes and invoices live in Stripe, not in your app — don't try to rebuild them.
Platform notes
Connect Stripe first on all three. Base44 sets up Stripe by prompt with a test sandbox; Lovable auto-generates the Stripe functions and tables; v0 uses the Stripe marketplace integration. Always test in Stripe test mode before going live.
Spend fewer credits
Every builder charges you for the work its AI does — so the cheapest habit is thinking before you build. These six rules cut most of the waste, whichever platform you choose.
- Plan in a free chat first. Sketch the whole thing in ChatGPT, Claude or Gemini — pages, features, what each form collects, what it should look like. Thinking there is free; thinking inside a builder is billed.
- Start from a written prompt, not a sentence. "Make me a website" is the most expensive sentence in AI building. A complete first prompt — like the ones on this site — saves dozens of correction rounds.
- Don't be lazy with the details. Every detail you leave out comes back as a correction you pay for. Business name, colors, every page, every form field, what happens after someone submits — put it all in the first prompt.
- One change per message afterwards. "Fix the header, and the form, and the colors" produces a tangle that costs more to unpick than it saved.
- Stuck? Stop patching. If the same fix fails about three times, don't send a fourth correction — describe the whole section's desired end state in one fresh message instead.
- Start free. Upgrade when you need more. Use the free allowance to build and explore your first version. Upgrade when you need more usage or paid features, and check any connected service costs before launch.
The prompts on this page are written to do most of this work for you — that's the point of them.
Read the full guideRelated prompts
Last reviewed: 2026-07-27