
Stripe API Keys: Configure and Accept Your First Payment
Table of Content
Subscribe To Get
WordPress Guides, Tips, and Tutorials
We will never spam you. We will only send you product updates and tips.
If you’re a WordPress developer or a small business owner, setting up payments is one of the most exciting (and sometimes nerve-wracking) steps for you while launching an online business.
To do this, the first payment gateway that comes to mind is Stripe. Stripe makes it easier than ever to accept credit cards, debit cards, subscriptions, and even global payments.
But before you can start accepting payments, you’ll need to configure Stripe into your website through the API keys.
The keys are the digital bridge between your website and Stripe.
Get them right, and your checkout runs smoothly. Get them wrong, and well… let’s just say customers don’t usually come back after a failed payment attempt.
In this guide, I’ll walk you through the complete process of setting up Stripe API keys, including how to find them, secure their setup, and accept your first payment.
What are Stripe API keys, and why do you need them?
Look, I know “API keys” sounds a bit technical and scary. When I first heard the term, I thought about some complex coding that would take weeks to figure out.
But the thing is, they’re basically just secret handshakes between your website and Stripe’s payment system.
Stripe API keys are unique codes that let your website or app connect with Stripe’s payment gateway.
It connects your website with Stripe’s servers, enabling you to process payments, manage customers, and handle transactions safely.
The keys are just like your username and password for your online banking, which tell Stripe that this payment request is legitimate and comes from an authorized source.
Now, why should you care about getting the Stripe api key set up properly?
First of all, without these keys, your website and Stripe can’t communicate.
The beauty of the API keys lies in their simplicity and security. They handle the heavy lifting of payment processing while keeping sensitive financial data away from your website’s servers.
It ensures that you stay compliant with industry security standards without the headache.
If you set up the keys properly, you can accept credit card payments, Apple Pay, Google Pay, and pretty much any other payment method your customers want to use, without sending them to any external checkout pages.
Types of Stripe API key
Stripe gives you a few different types of API keys, but honestly, you only need to worry about two main ones.
- Stripe Publishable Key
- Stripe Secret Key
Stripe offers two workspaces as well. “Test Mode” and “Live Mode”. Both workspaces need these API keys to connect Stripe with your website.
For example, if you want to test your transactions before making the payment form live, you need the “Test Publishable Key” and ”Test Secret Key”. The same goes for live transactions as well.
Stripe publishable key
The Stripe publishable key is the “public face” of your Stripe integration. As the name suggests, this key can be safely exposed to your website’s front end; it’s designed to be seen by browsers and users without compromising security.
The Stripe publishable key handles the initial part of payment processing, collecting the credit card info, and turning it into a secure token.
But it can’t actually charge anyone’s card, nor access sensitive account information or transaction history.
The publishable key always starts with “pk_” and then either “test” or “live,” depending on whether you’re still testing things out or ready to take real payments.
Subscribe to Our Newsletter
Join the exclusive crowd for trending offers, product updates, and advanced WordPress tips.

Stripe secret key
Now this is the key you need to guard with your life. The Stripe secret key is like having the master key to your entire payment system.
This key must be kept private and should never be exposed in frontend code, browser scripts, or any publicly accessible location. Because it is the most sensitive Stripe credential.
If someone gets their hands on this, they could potentially mess with your account, issue refunds, or access customer data.
So, the Stripe secret key should only live in secure places like your WordPress plugin settings or your server’s configuration files.
The key does all the heavy lifting; processes actual payments, refunds, accesses customer and transaction data, creates subscriptions, basically anything that involves real money changing hands.
It starts with “sk_” and, like the publishable key, has either “test” or “live” in the name.
Where to find Stripe API keys for testing?
If you ask, where to find the Stripe api key, then it’s actually a pretty straightforward process once you know where to look.
First things first, log in to your Stripe account. If you don’t have one yet, just go to the Stripe dashboard and sign up for free. There is no charge until you start processing payments.
Once you log in, from the top left corner, click on your profile > Switch to sandbox > Test mode. Here you’ll find the Stripe API key for testing.

Another way to find the Stripe publishable key and secret key: look for “Developers” in the left sidebar. It’s usually near the bottom of the menu. Click on that, then click “API keys.” This is your command center for all API-related things.
At the top of the API keys page, there’s a toggle switch that says “Test data” on one side and “Live data” on the other. Make sure you understand the difference:
- Test data gives you a Stripe API key for testing that lets you simulate payments without processing real money
- Live data gives you the keys for processing actual customer payments
When you’re just getting started, it’s recommended to test the transactions with the Stripe test card numbers for every possible scenario in the test mode first. Because you don’t want to accidentally charge your own credit card while you’re figuring things out.
In the API keys section, you’ll see your publishable key right there. The secret key, on the other hand, is partially hidden for security reasons. You’ll see something like “sk_test_…” with the rest of the key masked out.
Click “Reveal test key” to see the full thing.

To access the live API keys, you just need to toggle the test mode to live mode to see the appropriate keys for real transactions.
Pro tip: When you’re ready to switch from test to live mode, you’ll need to provide some additional business information to Stripe. They need to verify your identity before they’ll let you process real payments. This usually takes a day or two, so plan accordingly.
Security reminder: Never share your secret keys in code repositories, email, or any public channels. Treat them like your bank account password, because in many ways, that’s exactly what they are.
How to configure Stripe into WordPress and accept your first payment
Configuring the Stripe payment gateway into a WordPress website is pretty easy. Just follow a few steps and you’re ready to go.
First, choose a WordPress payment plugin that supports a wide range of payment gateways, including Stripe, to accept online payments.
We’ll take Paymattic for this. It’s one of the best WordPress plugins to accept payments and donations globally. Another major reason for choosing Paymattic is that it provides a total of 14 payment gateways, and Stripe is completely free.
So go to your WordPress dashboard, install and activate the Paymattic plugin. After activation, follow the steps below to configure your Stripe account in the Paymattic dashboard.
- Navigate to Paymattic > Payment Gateways.
- You can find all the available payment gateways here.
- Choose Stripe and make.
- Paste the Public Key and Secret Key here.
- If you’re in the test mode, paste the “Test API Keys”. Use “Live API keys” for live mode.
- Hit Save Settings.

Once you save the settings, your Stripe account will get connected to your website. Now the only thing you need to do is to create a payment form to accept online payments.
Wrapping up
Setting up the keys might feel a little technical at first, but once you know how to generate Stripe API keys and how to set them up, it’s actually a simple process.
Doesn’t matter whether you’re running an online shop, selling courses, or collecting donations, Stripe ensures your transactions are smooth, secure, and hassle-free.
And with Paymattic, you don’t even need to be a tech wizard, just copy and paste, and you’re ready to accept payments.
At the end of the day, your customers care about paying quickly and safely. Get your Stripe keys configured properly, and you’ll not only earn their trust but also set the foundation for steady growth in your online business.
Join the thousands already enjoying Paymattic
Tipu Deb
Hey! Tipu here, working as a Marketing Strategist at WPManageNinja & Paymattic. A nature lover and a person who is addicted to exploring historical events. In my leisure, you’ll find me playing with different musical instruments.
Leave a Reply