Step-by-step setup
Part 1 : The Stripe side
If you already have your Stripe secrets, you can skip ahead to “Part 2 - The Base44 side” setupCreate your Stripe account

- Stripe will ask you for your contact info, business details and banking information.
- Not ready to provide those yet? No problem. You can start using Stripe’s sandbox environment, which lets you test everything without moving real money.
Get your API key

- Copy and save your secret key somewhere secure, but also keep it handy. You’ll need to paste it into Base44 later.
Get your webhook secret
- Go to the Stripe Workbench and open the Webhooks tab.
-
Click “Add endpoint” (or “add destination”).
-
Choose the event(s) you need.
For example, “checkout.session.completed” is commonly used for one-time payments via Stripe checkout.You can choose different events depending on what your app does:- Invoice.paid - is great for subscriptions.
- payment_intent.succeeded - is great for manual payments.
- customer.subscription.deleted - is great for managing cancellations.
-
When asked to choose a destination type, select: Webhook endpoint.
You might also see Amazon EventBridge which is a tool for advanced apps built with Amazon Web Services (AWS) and used mostly by developers connecting multiple cloud services. If that’s not you, just stick with Webhook endpoint.
-
Add your destination name and app’s URL as the endpoint, then select “Create destination.”
After saving, copy the signing secret

Part 2 : The Base44 side
Activate backend functions

- Open Base44 and select the app you want to connect to Stripe.
- Click on the app’s Dashboard
- Click on Settings.
- Scroll down and click on App Settings.
- Find the section labeled Backend Functions.
- Click the “Activate” button.
Connect Stripe to your app
-
In your app’s AI chat, type: integrate with Stripe.
-
Click on “Update secrets” in the chat and when prompted, paste in:
- Your API key (from Stripe step 2)
- Your webhook secret (from Stripe Step 3)
Running tests
Before you go live, it’s a good idea to test your setup using Stripe’s sandbox mode.- Test API key: Stripe gives you a sandbox secret key that works just like the real one but without moving money. You can find that in Stripe’s API Keys doc.
- Test cards: Stripe provides sample card numbers to simulate payments. You can find them in Stripe’s testing Doc.
How to build real payment features in Base44
Once Stripe is connected to your Base44 app, you can start accepting real payments and not just test ones. But what happens next? You’ll likely want to do something after a payment goes through, like:- Add credits to the user’s account
- Unlock a digital product
- Mark the user as “Pro” or subscribed
- Remove access after a refund
Instead, your app needs to make those updates based on a logged-in user’s session for safety and security. We explain more below, but the short version is:
- Always let the user trigger the update
- Your prompts in the AI Chat should reflect that, so the flow works as expected
One-time payment for credits
One-time payment for credits
- Create a backend function to start the Stripe Checkout session
- Add the user’s ID to the Stripe session so we know who paid
- Redirect the user back to a PaymentSuccess page
- Create another function that checks the payment and adds the credits
- Make sure the credits only get added once, even if someone refreshes the page
Sell a digital product (eBooks, online courses, digital art, etc.)
Sell a digital product (eBooks, online courses, digital art, etc.)
- Trigger a checkout session from the frontend
- Set the product name and price in the backend function
- After successful payment, verify the session and grant the user download access
- Store a record of the purchase in a collection
- Make sure to prevent multiple downloads from re-verifying the same session
Book a service (yoga, coaching, etc.)
Book a service (yoga, coaching, etc.)
- Choose a service and time slot
- Go through Stripe Checkout to pay
- Be redirected to a confirmation page
- Verify the Stripe session and match it to the logged-in user
- Save the booking details (service, time, user ID) to a Bookings collection
- Prevent double-booking from repeated confirmation attempts
Start a subscription
Start a subscription
- Start a Stripe Checkout subscription session from the frontend
- After the user returns, verify the subscription via session ID
- Tag the user as “Pro” or update their account type
- Store the subscription ID so I can manage cancellations or billing updates later
Cancel a subscription
Cancel a subscription
- Let users cancel their subscription using the Stripe customer portal or a button in the app
- After cancellation, detect it using a backend function triggered by the user
- Remove their “Pro” tag or downgrade their access
- Optionally, show a message or redirect them to a downgraded page
Issue a refund and revoke access
Issue a refund and revoke access
When a refund is detected:
- Call a backend function from the frontend using a logged-in admin or system user
- Check if the refunded payment session exists and belongs to a user
- Revoke access or subtract credits from the user’s account
- Prevent accidental double-processing using a session log
Sell tickets for an event
Sell tickets for an event
- Send them to a Stripe Checkout page
- After payment, redirect them back to the app
- Confirm the payment using the session ID
- Save their name and email as an attendee for the event
- Optionally, show a thank-you page or generate a simple ticket
Accept tips or donations
Accept tips or donations
- Let users pick a suggested amount ($5, $10, $25) or enter a custom amount
- Redirect them to a Stripe payment page
- After payment, send them to a thank-you page
- Optionally, save their donation in a Donations collection linked to their account
Accept international payments
Accept international payments
Please:
- Enable payment methods like iDEAL, Bancontact, Apple Pay, and Google Pay
- Use Stripe’s automatic currency conversion
- Show prices in USD, but let Stripe handle local pricing at checkout
- Make sure checkout works for international users
Send branded invoices
Send branded invoices
- Create a backend function to generate and send an invoice to a user
- Use the Stripe API to send an email with a secure payment link
- Let me include a description, amount, and due date
- After the invoice is paid, update the user’s record in the app
Build a simple marketplace (Advanced - Stripe Connect)
Build a simple marketplace (Advanced - Stripe Connect)
- Let users register as sellers and connect their Stripe accounts
- When a customer makes a purchase, send the payment to the correct seller
- Optionally take a small fee for the platform
- Track transactions and show each seller their earnings
Why you can’t use Stripe webhooks alone
Stripe does offer a feature called a webhook which is like a little bot that notifies your app when a payment is successful. However, Base44 has some important security rules:- Webhook functions can’t update user data directly (like credits, roles, or subscriptions)
- Even if you use a service key, you may see errors like:
- 403 Forbidden
- “You must be logged in to access this app”
The right way: Let the user trigger the update
Here’s how to securely update user data after a payment:- The user picks something to buy (credits, product, service, etc.)
- Your app calls a backend function to create a Stripe Checkout session — this includes their user ID
- The user is sent to Stripe to pay
- After payment, they’re redirected back to your app
- On the success page, your app uses the Stripe session ID to:
- Confirm the payment
- Match the session to the logged-in user
- Make the update (like adding credits)
FAQ
Do I need a business to use Stripe?
Do I need a business to use Stripe?
Can I test payments in my Base44 app without using real money?
Can I test payments in my Base44 app without using real money?
Where do I find the keys I need to connect Stripe to my app?
Where do I find the keys I need to connect Stripe to my app?
- Your API key is in your Stripe dashboard → Developers → API Keys.
- Your webhook secret is underStripe Workbench → Webhooks , after you set up your endpoint.
You’ll need both to connect Stripe to your Base44 app.
Do I need to write code to accept payments in my Base44 app?
Do I need to write code to accept payments in my Base44 app?
Can I start in test mode and switch to live payments later?
Can I start in test mode and switch to live payments later?
What kinds of payments can I accept in my Base44 app?
What kinds of payments can I accept in my Base44 app?
- Credit and debit cards
- Apple Pay and Google Pay
- Local payment methods (like iDEAL, Bancontact, etc.)
- Multiple currencies with automatic conversion
Can I charge users in my app on a recurring basis?
Can I charge users in my app on a recurring basis?
Can users manage their own billing in my app?
Can users manage their own billing in my app?
How can I troubleshoot Stripe issues in my Base44 app?
How can I troubleshoot Stripe issues in my Base44 app?
- Open your Dashboard in Base44.
- Go to Code → Functions.
- Find the function related to your payment flow (e.g., createCheckout for a store).
- Click on the function, then scroll to the Logs section.
If your app is a store and the createCheckout function fails, the logs might show:
- “Product not found” → one of the items in the cart is missing or has an incorrect ID
- “Invalid price” → a product is missing a price or set to 0
- “Missing success_url” → Stripe doesn’t know where to send users after they pay
- “API Key invalid” → Stripe isn’t connected properly