Get your API key

Lesson 2 of 5

Test mode and API keys

Get test keys, keep the Key Secret on the server only, and pay with Razorpay's test cards and test UPI IDs.

7 min Log in to open
One step at a time, like flipping pages.

By the end of this lesson you will have Razorpay test keys stored in the right place, know exactly which value may go where, and have paid ₹499 with a test card and a test UPI ID without spending real money.

You need: a Razorpay account for practice (sign-up needs an email or phone number), your project folder open with your coding agent · Time: 7 minutes

  1. For practice, create your own Razorpay account at razorpay.com. You sign up with an email or phone number and confirm it with an OTP. You do not need to finish KYC to use test mode; Razorpay says test mode does not involve real money.

    For a real client project, the plan is different: the client creates the account in the business's name (lesson 5). They can add you as a team member, or share the test keys with you through a safe channel such as a password manager. Only the account's owner or admin roles can see API keys.

    Once you are inside the Dashboard, find the Test / Live mode switch and make sure it says Test. Labels move around in Razorpay's Dashboard from time to time; if you can't find something, look for the words "Test mode" and "API Keys".

    Why?

    Test mode and live mode have separate keys, payments and webhooks. Starting in Test means a mistake in your code costs nothing, and nothing in test mode can ever charge a real customer.

Log in free to read the rest of this lesson

Every lesson is free. A free account unlocks all of them and saves your progress.

Still to come in this lesson:

  1. Generate your test keys
  2. Keys in .env, on the server only
  3. If the Key Secret leaks
  4. Pay with test money
  5. Recap