Skip to main content
Whitelisting your IP address provides a layer of authentication. This prevents unauthorised API requests and ensures only verified requests are processed.
IP whitelisting is required for both the sandbox (test) and production environments. You configure it as a two-factor authentication (2FA) method in the Merchant Dashboard.

Prerequisites

Before you whitelist an IP address, ensure the following:
  • You have generated Secure ID API credentials. Secure ID client IDs typically start with CF. Use Secure ID credentials, not Payment Gateway keys.
  • You have a public IPv4 address. Cashfree does not support IPv6, CIDR ranges such as /24, or private IP addresses, including the 10.x.x.x, 172.16.x.x to 172.31.x.x, and 192.168.x.x ranges. Whitelist only individual IPv4 addresses.
  • You plan to whitelist no more than 25 IP addresses.
  • If your service uses dynamic or range-based outbound IP addresses, for example Render, IP whitelisting may not be feasible. Use the Signature Generation (Public Key) method instead.
Complete these steps to generate Secure ID API credentials:
  1. Log in to the Merchant Dashboard.
  2. Select the apps icon (nine dots), then select Secure ID.
  3. Select Switch to Test for sandbox credentials, or stay in production for live credentials.
  4. Go to Developers > Two-Factor Authentication and create the API key.

Whitelist an IP address

To whitelist your IP address, follow these steps:
  1. Log in to the Merchant Dashboard.
  2. Go to Developers > Two-Factor Authentication under the Secure ID card.
  3. Select IP Whitelist from the Select 2FA Method drop-down.
  4. Select Add IP Address.
  5. Enter the IP address you want to whitelist and select Add IP Address to save.
The whitelisted IP addresses are displayed in the grid. After adding a new IP address, wait at least 5 seconds for the change to sync before retrying your API request. Grid showing whitelisted IP addresses in the Cashfree Secure ID dashboard

Switch between 2FA methods

Complete these steps to change the active two-factor authentication method:
  1. Log in to the Merchant Dashboard.
  2. Go to Developers > Two-Factor Authentication.
  3. Select Switch Method to toggle between IP Whitelisting and Public Key.
The Select 2FA Method drop-down only adds IP addresses or generates keys for the method that is already active. Selecting a different option in that drop-down does not change the active method. Include the x-cf-signature header only when Public Key is the active method. Do not send x-cf-signature when IP Whitelisting is the active method.

Find your IP address

Use your public IPv4 address, not a private or local network address. You can find your public IP address using either of the following methods.

Use a browser

Open a browser and visit a service such as whatismyipaddress.com.

Use the command line

From the server that will call the API, run the following command:
The command returns your public IPv4 address.