Guides
Add Stripe payments to an AI-built app, without writing the payment code.
Ask your coding agent to add the payment button and handle what happens after someone pays. Tofu connects the app to your Stripe account, so the app can unlock what each person buys.
Updated
The short answer
Ask your coding agent to write the payment code for the app. Connect your Stripe account from the app's Payments page in Tofu, then create a payment link. Tofu passes each payment's confirmation to the app; the code your agent wrote gives the buyer access to what they bought. Buyers pay on Stripe's checkout page, and the money goes into your own Stripe account.
Start in a Stripe sandbox, where a test purchase moves no money. The steps below take that test connection through to real payments. If the app is only finished pages with no code running behind them (a static site), use a payment button of its own.
What you need
- An app already online on Tofu that runs code behind its pages. That code receives the message that a payment went through. Not sure which kind of app you have? Ask your coding agent whether the app runs code on a server.
- A paid plan. Connecting and testing work on any paid plan. Real payments open once the plan's first payment has gone through. See the current plans.
- Your own Stripe account. You need Apps administrator rights in that account to install Tofu's app.
- People who sign in to the app. The app unlocks what each person buys, so it has to know who is paying. The Google sign-in guide shows how to add sign-in.
- A coding agent with the app's code. Any coding agent can write the payment button and the code that handles payment confirmations.
This guide uses the app's Payments page in the Tofu dashboard. A coding agent installed on your computer can also carry out the setup after you connect it from the agent setup page.
Step by step
Connect Stripe in a sandbox
On the app's Payments page, choose Connect Stripe. Always start from that button, or from the link Tofu gives your coding agent: an install that starts anywhere else connects nothing. On Stripe's page, choose your account and a sandbox, review the permissions and install Tofu's app. Stripe returns you to Tofu. Check that Payments shows the account you chose and says it takes test payments.
Ask your coding agent to write the payment handler
Tell your agent what a purchase should unlock. Ask it to write and publish a webhook, the part of the app that receives payment messages. The payment code in the docs shows how to check each message's signature with Stripe's library and the secret Tofu supplies.
Ask the agent to give access only after a message confirms the payment went through, and to handle each message once even if it arrives twice. It should keep test purchases separate so they can be cleared later. The page buyers return to after checkout should only say thanks; the confirmed payment message is what gives them access.
Set up events and publish again
In Payments, choose Set up events. Your coding agent gives you two things to enter: the address inside the app that receives payment messages, and the name of the setting where the app reads its secret. Tofu keeps that secret hidden in the app's settings, then sends the address a test message without Stripe's signature, which the app must turn away. Look for Checks signatures; if the page shows anything else, ask your agent to fix the app. Then choose Put it online now so the app gets the saved secret.
Create the payment link and add the button
Choose Create payment link. Enter the product name buyers will see, its price and currency. For a membership, choose how often it repeats; that choice appears once your Stripe account allows it. Check the Stripe account and the sale before you confirm, and Tofu makes the link in that account. Find the new link on the Payments page and give it to your coding agent. Ask it to put the link on a button, add the signed-in person's app account ID to it and publish the change. That ID tells the app who paid.
Make a test purchase
Open the app as a buyer and use its payment button. In the sandbox checkout, use Stripe's test card
4242 4242 4242 4242, any future expiry date and any three-digit CVC. On the Payments page, look for Test payment received under Deliveries. Then check that the app unlocked what was bought. Also check that someone who has not paid cannot use the paid feature.Connect the live Stripe account
To replace the test connection, the app must have passed the signature check in step 3, and a test payment must have reached it. Once your paid plan's first payment has also gone through, choose Connect your live account, which takes you to your live Stripe account so you can install Tofu's app there. That install replaces the test connection and removes the test settings Tofu saved.
Create the live links and publish
Set up events again and create your payment links in live mode. Ask your coding agent to put the live links on the buttons, clear access granted by test purchases and publish the app. Check the account and live mode shown on the Payments page before sharing the app with buyers.
Who does what
| The job | Tofu | You and your coding agent |
|---|---|---|
| Connect Stripe | Connects the app to the Stripe account you approve. | You choose the account and approve the installation on Stripe’s page. |
| Make a payment link | Creates the product, price and link in your Stripe account. | You confirm what is sold and what it costs. Your agent adds the payment button. |
| Confirm a payment | Keeps the secret the app uses to check each payment message, and passes each message on to the app. | Your agent writes the code that checks each message and records the purchase. |
| Give the buyer access | Passes the buyer’s app account ID with the first payment’s message. | You decide what a purchase unlocks. Your agent writes that behaviour into the app. |
A payment button for a static site
A static site is a set of finished pages with no code running behind them. It can send buyers to a Stripe Payment Link you make yourself. You check the payments in Stripe and hand over what was bought yourself. This suits a deposit or a tip, and works on any plan, including Free.
In your Stripe Dashboard, start in a sandbox and open Payment Links, then New. Choose a product and price, or Customers choose what to pay for a tip, then Create link. Give your coding agent the link to put on a button and publish. After a test purchase, create a live link in Stripe and have your agent replace the button's link and publish again.
Before you go live
Buyers pay on Stripe's checkout page, with the product name and price you entered. Before you connect your live Stripe account, work through this list:
- The app refused Tofu's unsigned test message, so Payments shows Checks signatures.
- A test purchase unlocked what it bought, and someone who has not paid could not use it.
- The paid plan's first payment has gone through, which is what opens the live connection.
- The live links are on the buttons, and access granted by test purchases is cleared.
- Payments shows your live Stripe account, and it takes live payments.
Then share the app. Each sale appears in your Stripe account, and the app hears about it through the same message your coding agent handled.
What Tofu does not do
Open a Stripe account for you. Use your own Stripe account and complete Stripe’s checks there.
Handle refunds or payouts. You manage refunds, disputes and payouts in your Stripe account.
Cancel a subscription when you disconnect. Cancel subscriptions in Stripe. They keep renewing after you disconnect Tofu or turn off their payment link. Any link left active can also keep taking new payments after a disconnect, while the app receives no payment messages.
Unlock purchases on a static site. A static site has no code running behind it to hear who paid. Stripe records the payment, and you hand over what was bought yourself.
Take real payments before the plan’s first payment. Real payments open once the paid plan’s first payment has gone through. Until then, use a Stripe sandbox for test payments.
Set up payments from inside a chat app. Only a coding agent installed on your computer can do the setup for you. From a chat app, use the Payments page in the Tofu dashboard for the same steps.
Use live payments for test purchases. Run test purchases in a Stripe sandbox. Stripe's terms prohibit testing in live mode with real card details.
Questions
Does Tofu take a cut of sales?
Tofu adds no fee to your sales. Stripe's standard fees apply, and the money goes into your Stripe account.
Does the coding agent need a Stripe key?
No. This setup uses Tofu's Stripe connection and payment links. Tofu saves the secret the app uses to check payment messages as a hidden setting. You approve the connection on Stripe's page.
Can the app sell a membership?
Yes. Choose how often the payment link repeats; that choice appears once your Stripe account allows it. Stripe charges on the schedule you choose. Tofu tells the app about renewals, failed renewals, changes and cancellations. Ask your coding agent to update the member's access when those messages arrive. The subscription docs cover each message.
What happens when a payment arrives?
Tofu passes the payment's message to the app. The code your coding agent wrote checks it, records the purchase and unlocks what was bought. A message that arrives twice is handled once, and the buyer's app account ID is how the app knows who paid.
Can an app made in ChatGPT use this?
Yes. Use the app's Payments page in the Tofu dashboard for the setup in this guide. Your coding agent can add the payment button and the code that handles payment confirmations to the app you made.
How does the app know who paid?
Your coding agent includes the signed-in person's app account ID with the payment link. The first payment's message carries that ID, so the app can record who bought what. For a membership, the code also saves which person the subscription belongs to, so later renewals update the right account.
Describe an app, or bring one from your agent. Tofu puts it online.
Works with any coding agent
© 2026 Tofu
trytofu.ai