> ## Documentation Index
> Fetch the complete documentation index at: https://www.cashfree.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# IP Whitelist and Public Key

> Learn why Cashfree Payouts requires IP whitelisting and a public key, how to register them, and how these controls add an extra layer of API authentication.

export const posthog_0 = undefined

<AccordionGroup>
  <Accordion title="Why do I have to whitelist the IP address or generate a public key?" onClick={() => posthog_0.capture('Accordion Clicked', { title: "Why do I have to whitelist the IP address or generate a public key?" })}>
    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.
  </Accordion>

  <Accordion title="What is an IP address?" onClick={() => posthog_0.capture('Accordion Clicked', { title: "What is an IP address?" })}>
    A string of characters that identifies each computer using the Internet Protocol to communicate over a network. Computers use IP addresses to communicate with each other over the internet.
  </Accordion>

  <Accordion title="What does it mean to whitelist an IP?" onClick={() => posthog_0.capture('Accordion Clicked', { title: "What does it mean to whitelist an IP?" })}>
    Whitelisted IPs are an index of approved entities. A whitelist approves a list of email addresses, IP addresses for communication.
  </Accordion>

  <Accordion title="What happens after I whitelist my IP address?" onClick={() => posthog_0.capture('Accordion Clicked', { title: "What happens after I whitelist my IP address?" })}>
    The Cashfree production server allows your API requests.
  </Accordion>

  <Accordion title="How many IP addresses can I whitelist?" onClick={() => posthog_0.capture('Accordion Clicked', { title: "How many IP addresses can I whitelist?" })}>
    You can whitelist a maximum of 25 IP addresses.
  </Accordion>

  <Accordion title="Does Cashfree support IPv6?" onClick={() => posthog_0.capture('Accordion Clicked', { title: "Does Cashfree support IPv6?" })}>
    No, we only support API requests from IPv4 at the moment.
  </Accordion>

  <Accordion title="Why does an IP whitelisting error occur even after whitelisting an IP, and how can it be resolved?" onClick={() => posthog_0.capture('Accordion Clicked', { title: "Why does an IP whitelisting error occur even after whitelisting an IP, and how can it be resolved?" })}>
    An IP whitelisting error can occur if multiple Payout accounts exist and the IP address is whitelisted only on one account, but the API keys in use belong to a different account. To resolve this, whitelist the IP address on all Payout accounts and ensure the correct set of API keys is used for the intended account. Switching to the appropriate account usually fixes the issue and prevents further authentication errors.
  </Accordion>

  <Accordion title="When do I use a public key?" onClick={() => posthog_0.capture('Accordion Clicked', { title: "When do I use a public key?" })}>
    If your IP address is not static, generate a public key in the Cashfree portal.
  </Accordion>

  <Accordion title="How to generate a public key from the Cashfree portal?" onClick={() => posthog_0.capture('Accordion Clicked', { title: "How to generate a public key from the Cashfree portal?" })}>
    1. In the Cashfree dashboard, select **Developers** from the navigation panel on the left.
    2. Click **Two-Factor Authentication** from the **Payouts** card.
    3. Select **Public Key** from the **Select 2FA Method** dropdown menu.
    4. Click **Generate Public Key**.
    5. The public key is downloaded to your computer. Use your registered email ID to access the key.

           <img src="https://mintcdn.com/cashfreepayments-d00050e9/rpH767oy7-0Ptnam/static/payouts/payouts/Public_Key.gif?s=e91da17df1288886ea7a441af2db4899" alt="" width="1920" height="972" data-path="static/payouts/payouts/Public_Key.gif" />
  </Accordion>

  <Accordion title="How many public keys can I generate at a time?" onClick={() => posthog_0.capture('Accordion Clicked', { title: "How many public keys can I generate at a time?" })}>
    One. You can generate only 1 public key at a time.
  </Accordion>

  <Accordion title="How to use the public key to send API requests?" onClick={() => posthog_0.capture('Accordion Clicked', { title: "How to use the public key to send API requests?" })}>
    You need to generate a signature and proceed with the API requests.

    Below are the steps to generate the signature:

    1. Retrieve your client ID.
    2. Append this with CURRENT UNIX timestamp separated by a period (.).
    3. Encrypt this data with the generated public key using RSA encryption - this is the signature.
    4. Pass this signature in the header X-CF-Signature.
  </Accordion>

  <Accordion title="Do Payment Gateway (PG) APIs require IP whitelisting?" onClick={() => posthog_0.capture('Accordion Clicked', { title: "Do Payment Gateway (PG) APIs require IP whitelisting?" })}>
    No. Payment Gateway APIs do not require IP whitelisting. Other Cashfree products can require IP whitelisting as part of their API authentication. Check the documentation for the product whose API you are calling.

    If you receive a `Broken Link` or `not enabled` error during testing, confirm that you are not applying another product's IP whitelist requirement to a Payment Gateway API call.

    <iframe src="https://www.cashfree.com/devstudio/preview/pg/embed/faqFeedback?section=payouts%2Fip-whitelist%23do-payment-gateway-pg-apis-require-ip-whitelisting" style={{ width: "100%", height: "65px", border: "none" }} title="FAQs feedback component" />
  </Accordion>

  <Accordion title="Which Client ID should I use for Public Key Signature Authentication, and how do I resolve a 'Signature Mismatched' error?" onClick={() => posthog_0.capture('Accordion Clicked', { title: "Which Client ID should I use for Public Key Signature Authentication, and how do I resolve a 'Signature Mismatched' error?" })}>
    For the Public Key Signature Authentication flow, use the oldest (first) Client ID created for the account. To check the creation dates of your API keys, log in to the [Merchant Dashboard](https://merchant.cashfree.com/auth/login) and go to **Developers > Two-Factor Authentication**.

    To resolve a `Signature Mismatched` error, verify the following:

    * Pass the oldest (first) Client ID in the `X-Client-Id` header.
    * Form the string as `clientId.unixTimestamp` (Client ID, a dot, then the current UNIX timestamp).
    * Encrypt the string using RSA with OAEP padding and the public key downloaded from the Merchant Dashboard. Base64-encode the result and pass it in the `X-Cf-Signature` header.
    * Generate a new signature every 5 minutes. The signature is valid for 5 minutes. See [2FA: IP Whitelisting and Public Keys](/docs/payouts/payouts/integrations/payouts-2fa).
    * Use a Client ID and public key from the same environment (for example, the same Payouts or Secure ID account).

          <iframe src="https://www.cashfree.com/devstudio/preview/pg/embed/faqFeedback?section=payouts%2Fip-whitelist%23which-client-id-should-i-use-for-public-key-signature-authentication-and-how-do-i-resolve-a-signature-mismatched-error" style={{ width: "100%", height: "65px", border: "none" }} title="FAQs feedback component" />
  </Accordion>

  <Accordion title="Which Cashfree IP addresses should I whitelist in my server firewall?" onClick={() => posthog_0.capture('Accordion Clicked', { title: "Which Cashfree IP addresses should I whitelist in my server firewall?" })}>
    To receive Payouts webhooks, whitelist Cashfree's IP addresses on your server. See the list in [IPs to whitelist](/docs/api-reference/payouts/v2/webhooks/webhooks-v2#ips-to-whitelist).
  </Accordion>
</AccordionGroup>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.