Get paid
Your app can collect payments through Stripe - describe what you want to charge, test with fake money in the built-in sandbox, and switch to real payments when you're ready.
Money flows Stripe → your bank, never through Emergent. Emergent takes no cut of your sales, you pay only your Emergent plan/credits, and Stripe charges its own processing fees like it would anywhere.
The golden rule: test mode first
Payments have two universes: test mode (pretend money, fake cards, nothing charges a real bank account) and live mode (real cash). Never go live until you've tested checkout end-to-end with fake cards. One typo in your pricing prompt could charge real customers the wrong amount.
Step 1: Describe what you want to sell
Tell your Emergent agent exactly what you're charging for. Be specific:
- "Add Stripe payment processing. Users should be able to purchase credits for $10, $25, or $50."
- "Integrate Stripe subscriptions with three tiers: Basic ($9/month), Pro ($29/month), and Enterprise ($99/month)."
- "Add a checkout flow where users can buy individual products from a catalog."
The agent writes all the code - buttons, checkout pages, server logic to confirm payment.
Step 2: The managed sandbox (the default path)
Emergent sets you up with a managed Stripe sandbox: the platform manages the STRIPE_* keys for you. They are fetched automatically when you claim the sandbox, and you can't (and shouldn't) edit them.
Make test payments work
Click Manage (next to Preview) and open the Payments tab.
Click Claim Your Sandbox.
Complete Stripe's account registration and identity check. This step is skipped if you already have a Stripe account.
When you land in the Stripe dashboard, click Install the Emergent App.
The Payments tab shows your next step at each stage, for example "Claim your Stripe sandbox" or "Complete your KYC on Stripe".
Going live on this path needs no manual keys at all: just follow the next steps shown on the Payments tab.
Prefer your own Stripe account?
That's the right path if:
- Different email: your Stripe account is on a different email.
- Country support: Stripe doesn't support your country (Razorpay and PayPal remain options, see below).
To switch over:
- Unlink the sandbox first: open the Payments tab, click the 3-dots next to Stripe, and select Unlink (owner-only; a dialog explains the consequences). You can also ask the agent to do it.
- Already live? Your published app keeps its existing keys and keeps transacting. Unlinking only removes the sandbox link.
- Ask the agent to integrate Stripe with your own keys: test keys go in your project's
.env, and live keys go in Preview → Manage → Secrets → Custom keys.
Never paste a real key into chat: chat content is sent to the AI provider.
Step 3: Test with fake cards
Ask the agent to test:
Test the Stripe checkout flowThe agent will simulate a purchase. You can also manually click your new Buy button and use Stripe's test card numbers - like 4242 4242 4242 4242 for a successful charge, or 4000 0000 0000 0002 to trigger a card decline.
Watch what happens: does the success page show up? Does your database record the sale?
Step 4: Switch to real money (when ready)
- Managed sandbox: once KYC is complete, going live is handled through the platform.
- Your own account: flip your Stripe dashboard from Test to Live, copy the live keys (
pk_live_,sk_live_), update them in Preview → Manage → Secrets → Custom keys, then click Re-publish.
Before going live, re-read your pricing prompts. A typo like "$999/month" instead of "$9.99/month" will charge customers real money at the wrong amount.
Outside the US, or on mobile?
- Regional providers: depending on your market, other payment integrations are available, for example Razorpay for India and PayPal. Ask the agent which fits your country and currency.
- Mobile (Expo) apps: Stripe isn't available on mobile-only projects, mobile in-app purchases go through RevenueCat (and Razorpay/PayPal remain available). App-store purchases also carry the stores' own fees, see Monetisation: in-app purchases & subscriptions.
When does money reach your bank?
Stripe holds funds for a few days (usually 2-7 business days for your first payouts, then 2 days ongoing) before depositing to your bank account. You set up your bank details in the Stripe dashboard under Settings → Bank accounts and scheduling.
If something looks wrong
- Checkout button does nothing: check the browser console for errors. Your publishable key might be missing or mistyped.
- Payments fail in preview with the managed sandbox: make sure you've claimed the sandbox and completed KYC, test payments don't work before that.
- Payment succeeds but user doesn't get access: your webhook might not be set up. Ask the agent:
Set up Stripe webhooks to handle payment confirmation. - Test card declined in test mode: make sure you're using a Stripe test card, not a real one.
Go deeper: Stripe · Payment methods & regional billing
