How to Accept Payments in Your App
Your app needs to make money. Stripe is the standard — free to set up, and you only pay when you make a sale (2.9% + $0.30 per transaction).
This guide was written as of April 2026. If anything looks different, let us know.
Before you start
What you'll have at the end
Stripe publishable key and secret key in your .env file
Free tier
Free to set up. 2.9% + $0.30 per successful charge.
Create a Stripe account
Go to stripe.com and sign up. You'll start in test mode automatically — no real money involved until you're ready.
Get your API keys
In the Stripe dashboard, go to Developers > API Keys. Copy your Publishable Key and Secret Key. Make sure you're in Test mode (toggle at the top).
Add to your .env file
Add these to your .env file:
STRIPE_PUBLISHABLE_KEY=pk_test_...
STRIPE_SECRET_KEY=sk_test_...
Notice they start with pk_test and sk_test — that means test mode. Safe to experiment with.
Test mode vs live mode
Test mode uses fake card numbers. No real money moves. Use card number 4242 4242 4242 4242 with any future date and any CVC.
When you're ready for real payments, switch to live mode and update your .env with the live keys (pk_live and sk_live).
Create a product
In the Stripe dashboard, go to Products > Add Product. Set a name and price. No code needed — Stripe generates a price ID you'll use in your app.
Verify it works
You should have two new lines in your .env file with test keys. Your AI tool can now add payment buttons and checkout flows.
Tell Your AI Tool
Copy this prompt and paste it into your AI coding tool. It tells your AI exactly what credentials you just set up.
I've set up Stripe in test mode. My keys are in my .env file: - STRIPE_PUBLISHABLE_KEY (starts with pk_test) - STRIPE_SECRET_KEY (starts with sk_test) Add a payment button for [product] at [price]. Use Stripe Checkout for the payment flow.
Paste the prompt into the chat panel (Cmd+L or Ctrl+L). Cursor can also read your .env file directly — if your credentials are there, it already knows.
YepAPI Tip
Build a paid tool — an SEO checker, an AI writing assistant, a data dashboard. YepAPI powers the features. Stripe handles the money.
Was this guide helpful?
Stripe Payments — FAQ
Yes. Creating a Stripe account and integrating it costs nothing. Stripe takes 2.9% + $0.30 per successful transaction — you only pay when you make money.
Test mode lets you simulate payments with fake card numbers. No real money moves. Use card 4242 4242 4242 4242 to test. Switch to live mode when you're ready for real transactions.
After your app works and has users. Payments add complexity — get the core product right first, then monetize.
Start vibe coding with one API key.
One API key. 100+ endpoints. Yep, that's it.