Skip to main content
Install Cashfree Agent Skills to bring Cashfree product knowledge into your AI coding assistant (Claude Code, Cursor, VS Code Copilot, Gemini CLI, and more) to answer integration questions and generate accurate code without leaving your editor.

View end points

Cashfree uses API keys to allow access to the API. Once you have signed up at our merchant site, you will be able to see your AppId and SecretKey. Cashfree expects API key to be included in all API requests to the server. Use the endpoint /api/v1/credentials/verify to verify your credentials.

Generate API keys

Follow the instructions below to generate API keys:
  1. Log in to your Secure ID dashboard and click Developers on the navigation panel.
  2. Click API Keys.
  3. Click Generate API Keys from the API Keys screen.

    Generate API Keys

  4. The New API Keys popup displays with the client ID and client secret information.
  5. Click Download API Keys to download the information and save them in your local system folder. Do not share the keys with anyone because they are confidential. You can generate a maximum of 10 API keys.
API Keys - Production Environment: You need to perform an OTP authentication to generate API keys for production environment.

Whitelist your IP address

Whitelisting the IP address or generating a public key provides a layer of authentication. These cybersecurity techniques prevent anonymous or unknown disbursement requests and allow only verified requests. Your IP address needs to be whitelisted in the Cashfree production server or it rejects all incoming requests. Follow the instructions below to whitelist your IP:
  1. Log in to your Secure ID dashboard and click Developers from the navigation pane > Two-Factor Authentication from the Secure ID card.
  2. Choose IP Whitelist from the Select 2FA Method drop-down.
  3. Click Add IP Address.
  4. Enter the IP address you want to whitelist in the respective field and click Add IP Address to save the details. Note that only IPv4 must be whitelisted, not IPv6. The whitelisted IPs appear in the dashboard.
You can whitelist up to 25 IP addresses. If you need to whitelist more than 25 IP addresses or if your IP addresses are dynamic (not static), use the Signature Generation method.
How to find my IP address?Depending on your operating system, you can retrieve the IP of the system via multiple methods. You can also find your IP using helper sites such as https://whatismyipaddress.com/.

2FA API signature generation

To generate a signature, you need to generate the public key. You then use the generated public key to generate the signature.

Generate public key

  1. Log in to your Secure ID dashboard and click Developers from the navigation pane > Two-Factor Authentication from the Secure ID card.
  2. Select Public Key from the Select 2FA Method drop-down.
  3. Click Generate Public Key. You can have only one active public key at a time, and you can download it only once.
  4. The public key downloads to your computer. In the Production environment, the public key file is password protected. To open it, use the unique password sent to the email address registered with your Cashfree account.
In the Sandbox (test) environment, you do not need a password to access or extract the public key PEM file.

Generate signature

Follow the steps below to generate your signature:
  1. Retrieve your clientId (one which you are passing through the header X-Client-Id)
  2. Append this with CURRENT UNIX timestamp separated by a period (.)
  3. Encrypt this data using RSA-OAEP with SHA1 and your public key (.pem file).
  4. Base64-encode the encrypted output. The result is your signature.
  5. Pass this signature through the header X-Cf-Signature.
This method generates a signature that is valid for 5 minutes. Generate a new signature every 5 minutes.
In the case of using our library, go through the libraries section. During the initialization process, you need to pass the key as a parameter.

2FA FAQs

The following questions cover common two-factor authentication (2FA) setup and signature errors.
No. Because of product architecture limitations, you can’t disable 2FA in any environment, including sandbox. Depending on your integration, use either IP whitelisting or Public Key authentication as your 2FA method.
A signature mismatch error means that your request included a signature in the x-cf-signature header, but the signature failed validation. If the request has no signature at all, you receive the x-cf-signature missing error instead, which the next question covers.To resolve a signature mismatch error, verify the following:
  • In the x-client-id header, pass the same Client ID that you used to form the signature string.
  • Form the string as {client-id}.{unix_timestamp}, where the timestamp is the current UNIX time in seconds.
  • Encrypt the string with your public key (.pem file) using RSA-OAEP padding and SHA1, then Base64-encode the result.
  • Generate a new signature every 5 minutes. A signature with a timestamp older than 5 minutes fails validation.
  • Use a Client ID and public key from the same environment. For example, a sandbox Client ID doesn’t work with a production public key.
Also include the x-api-version header (for example, 2022-09-13) in each request. For the complete procedure, see Generate signature.
This error occurs when your account uses Public Key as its 2FA method. With Public Key 2FA, every API call must include the x-cf-signature header.If you intend to use API keys without providing a signature, log in to the Merchant Dashboard, go to Developers > Two-Factor Authentication on the Secure ID card, and select IP Whitelist from the Select 2FA Method drop-down. Then whitelist your server IP addresses.

Configure success rate alerts

Configure email alerts for each KYC API to be notified when the success rate (SR) falls below a specified threshold for any endpoint. These alerts help you proactively monitor API performance and take timely action to maintain smooth verification workflows. To configure alerts for your Secure ID account:
  1. Log in to your Secure ID dashboard using your credentials.
  2. Select Settings from the top navigation menu.
  3. Select Email Notifications under the Secure ID section.
  4. Select the SR Alerts tab and enable the specific API endpoints you want to monitor.
  5. Select Email Notification from the Manage Notifications drop-down, and enter the email addresses to receive alerts.
  6. Select Next, review your configuration, and select Submit.

Contact us for any queries

For identifying, diagnosing, and resolving problems related to API requests, ensure the information below is communicated while contacting us:
  • Share the API request and response details along with referenceId or verificationId.
  • Mention the registered email ID and environment in the email.
  • Use your registered email address (with Cashfree) to send the email or mention the registered email address.
  • Include your account manager in the CC of the email request.
For dashboard queries, share the screenshot and .har file of the screen.