API Keys

Generate and regenerate Test and Live API Keys using the Razorpay Dashboard.


API keys are unique identifiers that let you securely connect your application to Razorpay's services. An API key is a combination of the key_id and key_secret, which are required to make any API request to Razorpay. You will need to add this API key to your code as part of your integration process, ensuring secure access to Razorpay's payment services while protecting your data. Essentially, API keys act like passwords for your app, providing safe access to Razorpay's payment and other services while protecting your data.

Watch Out!

To generate API keys, you must provide the website details where you will collect payments. If you do not have the option to generate API keys, it may be because website details are yet to be provided. We collect website information during the onboarding process.

  • If you have not shared your website yet, please . We will verify your website within 3 working days. Once the verification is complete, you can generate API keys.
  • If you have already shared your website details and they have been verified, you can find the details on your . Navigate to Account & SettingsWebsite and app settings.

If you still encounter issues, raise a request with our

.

Follow these steps to generate API keys:

  1. Log in to your with the appropriate credentials.
  2. Select the mode (Test or Live) for which you want to generate the API key.
    • Test Mode: The test mode is a simulation mode that you can use to test your integration flow. Your customers will not be able to make payments in this mode.
    • Live Mode: When your integration is complete, switch to live mode and generate live mode API keys. In the integration, replace test mode keys with live mode keys to accept customer payments.
  3. Navigate to Account & SettingsAPI Keys (under Website and app settings) → Generate Key to generate key for the selected mode.

The Key Id and Key Secret appear on a pop-up page.

Watch this video to see how to generate API keys in the test mode.


Watch Out!

  • After generating the keys from the Dashboard, download and save them securely. You can use only one set of API keys. If you don't remember your API keys, you must from the dashboard and update them wherever the previous keys were used for payment gateway integrations.
  • API Keys are universal; that is, they are applicable to all websites and apps that you have whitelisted for your Merchant ID.
  • Do not share your API Key secret with anyone or on any public platforms. This can pose security threats to your Razorpay account.
  • Once you generate the API Keys, only the Key Id is visible on the Dashboard, not the Key secret, as it can pose security threats to your Razorpay account.
  • Use the Live API Keys to accept live payments and the Test API Keys for test transactions.

Once generated, you will be able to see the Key Id, the date the key was created and the expiry date for the API Key on screen.

Live mode API keys generated on the Razorpay dashboard

You also have the option to regenerate the key if required.

Two-Factor Authentication

To regenerate API keys, you must validate your identity via OTP and send it to your registered mobile number. However, this step is skipped if you already performed OTP validation while logging in to the Dashboard.

If you have not set up two-factor authentication, you will be prompted to verify your mobile number before regenerating keys.

To regenerate API key:

  1. Log in to the .
  2. Select the mode from the menu ribbon for which you want to generate the API key.
  3. Navigate to Account & SettingsAPI Keys (under Website and app settings) → Generate new key to generate key for the selected mode.

This allows you to deactivate the old key immediately or within 24 hours.

LET'S BE PARTNERS

Do you specialise in website development, or manage tech platforms like ERP/CRM/SaaS and would like to embed our best-in-class payments stack on your or your client's platform?

Take it a step further and

, India's most comprehensive program for all things payments and beyond.

  • Become the preferred vendor for your clients
  • Gain expertise in fintech and delight your clients
  • Achieve exponential growth for your clients
  • Generate additional wealth for your business

Ready to join the winning team?

!

1. Can I generate multiple API keys if I have only one MID?

No, if you have only one MID, you can generate only one API key.

2. Can I generate multiple API keys if I have multiple MIDs?

Yes, you can generate one API key for each MID if you have multiple MIDs.

3. Can I use my existing API key when expanding to new Razorpay platforms?

Yes, if your existing API key is saved, you can continue using the same keys as you expand to new platforms.

4. What should I do if I do not have the previous API key saved?

If you do not have the previous API key saved, you must regenerate new API keys and relaunch all previous products or apps with the updated keys.

5. My account is activated but I cannot generate API keys as my website is not verified. What do I do?

Website details are required to generate API keys. If you do not have the option to generate API keys, it may be because website details are yet to be provided. If you have not shared your website yet, please

. We will verify your website within 3 working days, and once the verification is complete, you can generate API keys.

6. Why am I unable to generate the API keys?

Your website or app link must be verified to generate an API key. This step ensures that only verified sources (website/app) can collect payments through the payment gateway.

7. Who has access to the API Keys?

Only users with the Owner or Admin role have access to the API keys. Know more about

.

1. Do I need API keys to integrate a payment app with Shopify?

No, API keys are not required to integrate a payment app with Shopify. OAuth is to handle the authentication process.

2. Why am I being asked for an API key while integrating with Shopify?

If you are integrating a non-payment app with Shopify, only the API key is required and not the key_secret. However, Shopify does not require API keys to integrate payment apps.

3. I am unable to access case_key while integrating with Shopify. How can I access the case_key?

Only users with admin role access can access the case_key.


Was this page helpful?


api keys
generate api keys
test api key
live api key
regenerate api key