Documentation index for AI agents (llms.txt)
Skip to main content

Stripe

Take payments and subscriptions on your site with your own Stripe account. Money goes straight to you, and your customers, products and payments live in Stripe.

Connect​

  1. Open Settings > Connectors, click Stripe, then Connect.
  2. Stripe opens. Sign in, or create a Stripe account, and approve access for WebTwizz.
  3. You're back in the connector. The project starts in test mode.

Then ask the AI for what you need, like "add a checkout for my three plans".

Paste keys instead​

Choose Paste keys to connect with keys from your Stripe dashboard. Start with your test keys, the Test secret key and Test publishable key from dashboard.stripe.com/test/apikeys, so the preview never charges real cards. Live keys can wait until you go live: a project on pasted keys has Add live keys and Replace keys on its account.

What you see​

Stripe revenue in test mode over 30 days, with recent payments

The screen shows live mode once you're live, and test mode before that. In test mode the headings say so, like Test revenue and Test payments. When the account has both test and live keys, Show live or Show test next to the revenue heading switches the screen to the other mode. Each row opens in Stripe.

  • Stripe needs your business details before you go live: shown at the top when Stripe still needs something from you, with how many items are left. Finish on Stripe takes you there. Test payments keep working meanwhile.
  • Revenue: a chart for 7 days, 30 days or 12 months, then net revenue and how it compares with the period before, the number of payments and refunds, and monthly recurring revenue with the number of subscribers. Each figure opens Stripe. With no payments in the period, a short note takes the chart's place. In test mode a line reminds you that orders placed in the preview aren't fulfilled.
  • Disputes: shown when a customer disputes a payment and Stripe is waiting on your answer, with the amount, who paid, the reply-by date and the reason. Respond on Stripe opens the dispute. All disputes opens Stripe.
  • Failed renewals: subscription payments Stripe couldn't charge, with how many times it tried and when it tries next. Retry charge asks first, naming the customer and the amount, and Charge with the amount charges their saved card now. Copy payment link copies the invoice's payment page, to send to the customer. All invoices opens Stripe.
  • Payouts: your balance, Available and On the way, then your latest payouts to the bank with when they arrived or will arrive. All payouts opens Stripe.
  • Payments: every payment, newest first, with who paid, for what and when, and a tag when it's refunded, partly refunded, disputed, failed or pending. Receipt opens Stripe's receipt. Refund opens an amount field in place, filled with all that's left on the payment: lower it to refund part. The line under it says how much goes back to whom, and that it reaches their card in 5 to 10 days and Stripe keeps its fee, or in test mode that no real money moves. Confirm with Refund and the amount. Show more loads ten more. All payments opens Stripe.
  • Subscriptions: shown when you have active subscribers, with who, the plan and the price. Cancel asks first: they aren't charged again, they keep access until the end of the period they paid for, and nothing is refunded. Confirm with Cancel subscription, and the row then shows Ends at period end. All subscriptions opens Stripe.
Stripe products, the account and the Payments setting in test mode
  • Products: each product with its price, and Showing 24 when you have more. Add product opens a short form: name, price, currency, and One time, Monthly or Yearly. It goes into test mode, and going live copies it at the same price. Once you're live it goes into both. Change price sets a new price: your site shows it with no code change, and subscribers keep the price they signed up at. The More menu has Archive, which asks first and stops the product being bought, and Open in Stripe. On a phone, Change price is in that menu too. All products opens Stripe.
  • Discount codes: your active codes, what each takes off, for how long and how often it's been used. New code asks for the code, the percent off, and First payment only or Every payment. Leave the code empty and one is made up for you. Customers type it at checkout. All codes opens Stripe.
  • Payment links: shown when you have active payment links, with what each sells, its price and its address. Copy link copies it. Turn off asks first, then the link stops taking payments. You can turn it back on in Stripe. Show more loads ten more. All links opens Stripe.

Before you're live, Add product, Change price, Archive and New code only show in test mode.

  • Account: the Stripe account this project uses. On pasted keys it has Add live keys, until the project has them, and Replace keys.
  • Settings:
    • Payments: Test mode or Live. Go live asks first in place: the published site starts charging real cards after your next publish, and your products and prices are copied to live mode first. If the project only has test keys, or Stripe still needs your business details, it says so instead, with Add live keys, Reconnect or Finish on Stripe. Add live keys opens the live key fields with Add keys and go live. A live project has Switch to test, which asks first too.
    • Payment events: whether Stripe tells your site each time an order is paid. It shows After you publish until the site is live. If Stripe turned it off, it still sends to an old address, or it's missing, the row says Turned off, Old address or Missing and has Recreate. Recreate asks first: Stripe sets it up again with a new signing secret, so publish right after.
  • Open Stripe, at the top next to the name, opens your payments in Stripe.

Test mode and live​

Your preview always uses test mode, so you can try checkout without charging anyone. Pay with Stripe's test card 4242 4242 4242 4242, any future expiry date and any CVC.

Go live switches your published site to real payments. It takes effect the next time you publish.

What the AI can do​

The AI works with your Stripe account through its own Stripe tool, and every action shows a card in the chat:

  • Create products and prices, one at a time or a whole catalog at once
  • Change a price. Your site shows the new one without a code change, and existing subscribers keep theirs.
  • Make payment links and discount codes, and show which codes are active and how often they're used
  • Show your payments, revenue and subscriptions
  • Make sure payment events reach your published site
  • Turn on Stripe's customer portal, so subscribers can cancel, change their card and see invoices
  • Go live, or back to test

Going live always asks first. Once you're live, changes to products, prices and discount codes ask first too, and so does switching back to test.

Secrets​

  • NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY: your publishable key, safe to use in the browser
  • STRIPE_PUBLISHABLE_KEY: the same publishable key, for server code that expects this name
  • STRIPE_SECRET_KEY: the secret key, server-side only
  • STRIPE_ACCOUNT_ID: your connected Stripe account's ID
  • STRIPE_WEBHOOK_SECRET: checks that payment events really come from Stripe, server-side only

Good to know​

  • Removing Stripe from a project takes its keys out. Your customers, payments and products stay in Stripe.
  • To charge into a different Stripe account, switch accounts under Account. See Switch or remove an account.