Skip to main content
Available in🇮🇳 India
Feature AvailabilityThe IP whitelist is being rolled out to merchants in phases, so it may not be available for your account yet. If the IP Whitelist section is not visible on the API Keys page, the feature is not turned on for your account yet.
An IP whitelist limits where your API keys can be used. When your IP whitelist has at least one IP, Razorpay accepts API calls made with your key ID and secret only from the IPs on it. Razorpay blocks calls from any other IP, even if they use the right key ID and secret. This protects you if your key secret leaks. Someone who has the secret still cannot create orders, refunds or linked accounts from their own servers. The Dashboard asks for your server IPs when you generate or regenerate a key. Add or remove IPs later from the IP whitelist section of the API keys page.

How the IP Whitelist Works

The IP whitelist works as follows:
  • Test and Live mode have separate IP whitelists. The Live IP whitelist checks calls made with your Live keys. The Test IP whitelist checks calls made with your Test keys. Switch the mode on the Dashboard to see the other list.
  • Only server-side calls are checked. The IP whitelist applies to every API call authenticated with your key ID and secret, such as creating orders, payments, refunds and Route linked accounts. Checkout runs in your customers’ browsers and apps with only your key ID, so your customers can still pay from anywhere.
  • Add all your servers. Once the IP whitelist has one IP, Razorpay blocks calls from every other IP. If your servers make calls from more than one public IP, for example through several Network Address Translation (NAT) gateways or regions, add all of them.
  • All keys in a mode share one IP whitelist. Regenerating a key keeps the IP whitelist, unless you choose Regenerate without IP whitelist.

Before You Start

The table below lists the rules for the IP whitelist: Know more about standard user roles and permissions.

Add IPs When You Generate or Regenerate a Key

When you generate your first key or regenerate a key, the Dashboard asks for your server IPs first. If you already have an IP whitelist in that mode, the Dashboard fills in the saved IPs for you to check.

Live Mode

To add IPs while you generate or regenerate a Live key:
  1. Log in to the Razorpay Dashboard and select Live mode.
  2. Navigate to Account & Settings → API keys (under Website and app settings) and click Generate Key (or Regenerate Key).
  3. In the Add your server IPs pop-up page, enter the public IPv4 address of every server that calls Razorpay’s APIs in the Server IP addresses text box. Separate the addresses with commas. Click Continue. Add your server IPs pop-up page for Live mode, Step 1 of 3, with two IPs in the Server IP addresses text box
  4. Check the IPs in the Confirm pop-up page and click Confirm. Click Back to change them.
  5. Enter the OTP. This one OTP saves your IPs and creates your key.
  6. Copy your key ID and key secret and store them safely.

Test Mode

To add IPs while you generate or regenerate a Test key:
  1. Log in to the Dashboard and select Test mode.
  2. Navigate to Account & Settings → API keys (under Website and app settings) and click Generate Key (or Regenerate Key).
  3. In the Add your server IPs pop-up page, enter your server IPs in the Server IP addresses text box and click Continue. Razorpay does not ask for an OTP in Test mode. Add your server IPs pop-up page for Test mode, Step 1 of 2, with an empty text box

Generate a Key Without an IP Whitelist

If you cannot add IPs yet, for example because your servers do not have a fixed public IP, generate the key without an IP whitelist. To generate a key without an IP whitelist:
  1. In the Add your server IPs pop-up page, clear the Server IP addresses text box. The button in the next step stays unavailable while the text box has IPs.
  2. Click Generate without IP whitelist (or Regenerate without IP whitelist).
  3. In Live mode, the Continue without an IP whitelist? pop-up page opens with a high-risk warning. Select the I accept the risk and the terms. My business is responsible for all activity on this key. check box. Continue without an IP whitelist pop-up page with a High risk warning and an unselected check box
  4. Click Continue without IP whitelist and enter the OTP.
In Test mode, Razorpay creates the key straight away and shows no warning.
Watch Out!Your key works from any server. Anyone with your key ID and secret can use them from anywhere. This option also removes any IPs already saved for that mode. The IP whitelist section shows Your Live keys work from any server until you add IPs.

Add or Remove IPs Later

Log in to the Dashboard, select the mode (Test or Live) and navigate to Account & Settings → API keys (under Website and app settings). The IP whitelist section shows whether the IP whitelist is On or Off, how many IPs are saved out of 15, and who added each IP and when. Razorpay saves each add and each remove straight away. In Live mode, each one needs an OTP. IP whitelist section in Live mode with 2 of 15 IPs saved, an Add IP addresses text box and a table of the saved IPs

Add IPs

To add IPs to your IP whitelist:
  1. In the Add IP addresses text box, enter one or more public IPv4 addresses. Separate them with commas.
  2. Click Add.
  3. In Live mode, enter the OTP.

Remove an IP

To remove an IP from your IP whitelist:
  1. Click the remove icon in the row of the IP.
  2. In Live mode, enter the OTP.
Razorpay blocks API calls from a removed IP. If you remove the last IP, the IP whitelist turns off and your keys in that mode work from any server again. IPs that Razorpay Support added before self-serve show a dash under Added by and Added on.

Find the Public IP of Your Server

Add the public IP that your server’s API calls come from, which is its outbound IP. This is often not the IP your website runs on and not the private IP your server sees for itself.

Check from the Server

Run this command on each server or container that calls Razorpay’s APIs. The address it prints is the one Razorpay sees.
Run it a few times, and on every server, region and instance. If you get different addresses, your servers use more than one outbound IP and you must add all of them. If the address changes each time you restart or redeploy, your server has no fixed outbound IP. See If Your Server Has No Fixed IP.

Find the IP on a Cloud Provider

The table below lists the IP to add for each setup:

If Your Server Has No Fixed IP

Serverless functions, such as AWS Lambda outside a VPC, and many managed platforms usually send requests from addresses that can change. Other customers of the provider can share these addresses, so you cannot whitelist them reliably. Do one of the following:
  • Route outbound traffic through a NAT gateway with a fixed IP. For AWS Lambda, run the function in a VPC with a NAT gateway and an Elastic IP.
  • Use your platform’s static outbound IP option.
  • Generate your key without an IP whitelist until you have a fixed IP, then add the IPs.

IPs You Should Not Add

Do not add the following:
  • Your laptop or office IP for Live keys, unless your Live servers really call from there. Use Test mode for development.
  • Your website’s IP, if it is not the server that calls Razorpay’s APIs.
  • Private addresses such as 10.0.0.5 or 192.168.1.20. Razorpay never sees these.

Messages You Might See

The table below lists the messages the Dashboard shows and what to do about each: Errors in the key generation step appear under the Server IP addresses text box after you leave it. Errors in the IP whitelist section appear when you click Add. Add your server IPs pop-up page showing the error that 10.0.0.5 is a private address IP whitelist section showing the error that 192.168.1.0 is a private address

If Your API Calls Are Blocked

A call from an IP that is not on the IP whitelist fails with an error. To fix it:
  1. Run the check in Find the Public IP of Your Server on the server that made the call.
  2. Log in to the Dashboard and add that IP to the IP whitelist. The IP whitelist does not affect the Dashboard.
  3. Retry the call.

Best Practices

Follow these practices to get the most from the IP whitelist:
  • Turn on the IP whitelist for your Live keys. Generate a key without an IP whitelist only if your servers have no fixed public IP yet. Add IPs as soon as you have one.
  • Use fixed outbound IPs. Send API calls from addresses that do not change on restart or redeploy, such as an Elastic IP or a NAT gateway with static IPs. See Find the Public IP of Your Server.
  • Add every server that calls Razorpay’s APIs. Include each region, NAT gateway, standby or failover server and scheduled jobs such as refund or reconciliation scripts. Razorpay blocks calls from a server you leave out.
  • Keep Test and Live separate. Add your development machines and office IPs to the Test IP whitelist only. The Live IP whitelist must hold only the servers that make Live API calls.
  • Add the new IP before you remove the old one. When you move servers or change an IP, add the new address first. Check that API calls from it work, then remove the old address.
  • Review the IP whitelist regularly. Remove IPs you no longer use. Check that IPs with a dash under Added by, which Razorpay Support added before self-serve, are still yours.
  • Regenerate keys with care. Regenerating a key keeps your IP whitelist. Regenerate without IP whitelist removes every IP in that mode, so choose it only if that is what you want.
  • Keep your key secret on your servers. Never put it in website code, mobile apps or public code repositories. Store it in a secrets manager or in environment variables. An IP whitelist limits where the secret works, but it does not replace keeping the secret safe.
  • Limit who can make changes. Only users with the Owner, Pseudo Owner or Admin role can change the IP whitelist. Give those roles only to people who need them.

Frequently Asked Questions

No. Checkout uses only your key ID from your customers’ browsers and apps, and Razorpay does not check those calls. Razorpay checks only calls made with your key ID and secret.
No. Webhooks are calls from Razorpay to your server. The IP whitelist checks calls from your server to Razorpay.
No. Website whitelisting controls which websites and apps can accept payments. The IP whitelist controls which servers can call Razorpay’s APIs with your key secret. Know more about business website details.
No. RazorpayX payouts have their own IP allowlist, managed in RazorpayX. Know more about Allowlist IPs. The IP whitelist on this page covers payment APIs.
Last modified on November 30, 2026