If you already have a Stripe or PayPal account, or need a provider Swarmz Payments does not offer, ask the AI to build checkout with it. The AI writes the payment code, you paste your keys into a secure form, and the money goes to your own account under your provider's terms. There is no special screen for this: you do it by chatting.
Important
The AI sets up your own provider only when you ask for it in so many words, for example "I want to use my own Stripe account." Otherwise it suggests Swarmz Payments. See Take payments with Swarmz Payments.
What you need#
- A Stripe or PayPal account. Start in test mode.
- Swarmz Cloud turned on for the project, because payments need server code. The AI asks you to enable it first if it is not on.
- The keys from your provider. In Stripe these are in the Dashboard under Developers, API keys. Stripe's own guide to keys is at docs.stripe.com/keys.
Set it up#
Step 1: Tell the AI what you want
For example: "Add checkout for my three plans using my own Stripe account." Say which provider by name.
Step 2: Answer the setup questions
The AI asks about what you sell, prices and what should happen after payment. If it asks you to enable Swarmz Cloud, do that first.
Step 3: Add your keys in the secure form
The AI asks for each key through a form in the chat. You never type a key into the message box. Each key is saved under a name in Tools, Cloud, Secrets. For Stripe the names look like
STRIPE_SECRET_KEY,STRIPE_WEBHOOK_SECRETandSTRIPE_PUBLISHABLE_KEY. PayPal usesPAYPAL_in place ofSTRIPE_.Step 4: Add the webhook
A webhook tells your app when a payment succeeds. The AI creates a server function for it and gives you its address. Paste that address into your provider's dashboard, then copy the signing secret it shows you and enter it in the secure form when asked.
Step 5: Test with test keys
Use your provider's test mode and its test card numbers. Check that the right thing happens after a payment, such as a confirmation page or a saved order.
Step 6: Go live
Replace the test keys with live ones. Open Secrets, choose Rotate secret on each key, paste the live value and publish your app. See Publish your app.
How the AI builds it#
- Prices and amounts are worked out on the server, not in the browser, so a visitor cannot change what they pay.
- A server function creates the checkout or payment session.
- A webhook function checks the provider's signature and records the paid status in your database. Your pages read that status.
- Only the public (publishable) key is ever sent to the browser. The secret key and the webhook secret stay in Secrets.
Good to know#
- Connectors are different. The Stripe connector in Tools, Connectors only lets the AI read data from your account. Take payments with the keys method on this page. See Connect an integration.
- Keep keys out of chat. If you paste a secret key into the message box, treat it as leaked: create a new one at your provider. See Keep API keys and secrets safe.
- You manage the account. Refunds, payouts, disputes, tax and compliance happen in your provider's dashboard.
- Not working? See Payments in my app aren't working.
Common questions#
Can I use Stripe and Swarmz Payments together?
A project that uses your own provider keeps Swarmz Payments off. The AI builds with what you asked for.
Can I use a provider other than Stripe or PayPal?
Yes, if it has a standard API. Name it and the AI follows the same pattern, with keys saved as <PROVIDER>_SECRET_KEY style names.
Do I need to know code?
No. You paste keys and the webhook address. The AI writes the rest.
Was this helpful?
Related articles
Take payments with Swarmz Payments
Add card, Apple Pay and Google Pay checkout to your app, test it with fake cards, then verify your business to go live.Keep API keys and secrets safe
Store API keys and passwords for your app in Cloud Secrets, so they never end up in your code or chat.In Cloud: data, sign-in and storagePayments in my app aren't working
Fix checkout problems: test versus live mode, verification, the published site, your own payment keys and payouts.In TroubleshootingWhat is Swarmz Cloud?
Swarmz Cloud is the backend for your app: a database, user accounts, file storage and server functions, set up and looked after for you.In Cloud: data, sign-in and storage
Still have a question?
Ask about this article, or talk to a person.