How to create a read-only restricted key in Stripe
Create a Stripe restricted key that can only read charges, refunds, customers and subscriptions, to share revenue numbers safely with another app.
A restricted key is a Stripe API key with only the permissions you choose. To share revenue numbers safely with an app like SimpleDash, create a key with custom permissions: Read access to Charges, Refunds, Customers and Subscriptions, and None for everything else. It can't charge cards, refund payments or change your account.
Why a restricted key, not your secret key
Your secret key (sk_live_…) can do anything in your Stripe account, including moving money. Never paste it into another service. A restricted key (rk_live_…) can do only what you allow, and you can delete it at any time without affecting anything else.
Create the key
Sign in to the Stripe Dashboard and open Developers → API keys.
Choose Create secret key. On Assign permissions to your key, choose custom permissions. Don't choose full access, which creates an unrestricted secret key.
In Key name, name it after the app you'll give it to, for example "SimpleDash", so you'll know later what it's for.
Set these four to Read:
- Charges
- Refunds
- Customers
- Subscriptions
Leave every other permission on None.
Choose Create key and complete Stripe's two-factor check. Then click the key to copy it. It starts with rk_live_ (or rk_test_ in a sandbox or test mode). Copy it now: Stripe won't show it again.
Keep it safe
- Paste it only into the app it's for. Don't share it in chats or email.
- To stop the app's access, delete the key in Developers → API keys. Nothing else is affected.
- If you think it leaked, delete it and create a new one.
Try it in a sandbox first?
Create the key in a Stripe sandbox (or test mode) to try things out with test payments. Those keys start with rk_test_.
Related
Sources
- Stripe: Restricted API keys
Last updated
Traffic to revenue
Connect visits to sales without guessing: send purchases to GA4, fix payment-page referrals, then read sales by source and landing page. With the limits.
What is MRR
MRR is monthly recurring revenue: what your active subscriptions bring in each month. How it's calculated, what to leave out, and where to see it in Stripe.