Guide

How to accept payments with Stripe

In this guide you will add card payments to an app built with Puter AI Builder using Stripe. You need a Stripe account and its secret key. The builder writes the rest.

Updated 7 October 2026 · 4 min read

Steps

  1. Sign up for Stripe

    Create an account at stripe.com. You do not need a registered business yet. A new account starts in test mode, where payments use fake cards and move no money.

  2. Copy your secret key

    Open the API keys page in the Stripe Dashboard. There are two keys. The publishable key starts with pk_test_ and the secret key starts with sk_test_. Copy the secret key.

  3. Give the key to the builder

    Paste the secret key into the builder and say what you want to sell, for example "add a Buy button for the $40 workshop ticket and take payment with Stripe".

  4. Test the checkout

    In the preview, click your Buy button. Checkout opens in a new tab, because Stripe does not run inside the preview frame. Pay with card number 4242 4242 4242 4242, any future expiry date and any three-digit CVC. The payment shows up under Payments in your Stripe Dashboard. Stripe lists more test cards, such as cards that get declined. Checkout works in the draft preview, so you can test before you publish.

Example requests

Say what you sell, the price, and what should happen after someone pays. For example:

  • "Add a Buy button for my $29 ebook and show a download link after payment."
  • "Sell tickets to my workshop at $40 each."
  • "Add a donate button where people choose $5, $10 or $25."
  • "Add two plans, Basic at $9 a month and Pro at $19 a month."

Selling subscriptions

Ask for a monthly or yearly plan, for example "charge $9 a month for the pro plan". Checkout works the same way as a one-time payment.

Subscribers sign in with a Puter account before they pay, so the app knows who has a plan. Each time a subscriber opens a paid feature, the app checks with Stripe that their subscription is still active. A new plan works as soon as the subscriber returns from Checkout. Renewals, failed payments and cancellations take effect within a few minutes. One-time purchases do not need sign-in.

To check a renewal without waiting a month, use Stripe's test clocks, which move a test subscription forward in time.

To let subscribers cancel or change their card, the builder asks you to turn on Stripe's customer portal and paste its login link, then adds a Manage subscription link to your app.

Taking real payments

When the app works in test mode, activate your Stripe account by adding your business details and a bank account for payouts. Then copy your live secret key, which starts with sk_live_, give it to the builder with "switch to this live key", and publish. Make one small real purchase to check that it works, then refund it in the Stripe Dashboard.

Treat the secret key like a password. The builder keeps it in your app's backend, not in the pages your visitors load. For your live key, consider a restricted key (rk_live_) with only Checkout Sessions: Write (add Customers: Write and Subscriptions: Read if you sell subscriptions), so a leaked key cannot refund money or read your customers. If you think a key has leaked, roll it on the API keys page and give the new one to the builder.

Common questions

Does Puter take a cut of payments?

No. Payments go to your own Stripe account. Stripe charges its own per-payment fee.

Can I ask for payments before I have a key?

Yes. The builder builds the rest of the app first, then asks you for the key.

Where do I see orders and refunds?

In your Stripe Dashboard.

Build a shop that takes payments

A three-product shop with Stripe Checkout. Have your test secret key ready to paste.

Open with this prompt