Cashfree Payments Developer Documentation home pagelight logodark logo
  • Discord
  • Create Account
  • Create Account
Payments
Payouts
Secure ID
Partners and Platforms
Payments APIs
Payouts APIs
Secure ID APIs
Partners APIs
Additional APIs
API Reference
AI and Tools
Help Center
Payout APIs
  • Overview
  • Getting Started
  • Account
  • Authentication
    • POST
      Authorize
    • POST
      Verify
V2
  • Overview
  • Transfers V2
  • Beneficiary V2
  • Webhooks Version V2
  • Response Codes
V1
  • Overview
  • Batch Transfer V1.3
  • Beneficiary
  • Incidents
  • Transfers
  • Transfers V1.2
  • Webhook Version V1
One Escrow
  • POST
    Create Virtual Account
  • POST
    Transfer Funds Between VAs
  • GET
    Get Account Statement
  • POST
    Allocate Funds to Virtual Account
  • GET
    Get Fund Source Details
  • POST
    Add Registered Recharge Account(Whitelist Bank Account)
  • POST
    Debit Connected Wallet
Cashgram
  • End Points
  • Postman Collection
  • Webhooks
  • POST
    Create Cashgram
  • POST
    Deactivate Cashgram
  • GET
    Get Cashgram Status
  • Response Codes
Authentication

Authorize

Use this API to authenticate with the Cashfree system and obtain the authorization bearer token. All other API calls must have this token as Authorization header in the format 'Bearer <token>' (without quotes) for them to get processed.
URLs
  • Production/Live: https://payout-api.cashfree.com/payout/v1/authorize
  • Sandbox/Test: https://payout-gamma.cashfree.com/payout/v1/authorize

Click to view the steps to generate a public key and the signature.

If you do not have a static IP, you can generate a public key and pass it with the API request. To generate a public key,
  1. Go Payouts Dashboard > Developers section on the left-side navigation > Payouts > Two-Factor Authentication > Public Key.
  2. Click Generate Public Key. The public key will be downloaded to your computer and the password to access it will be your email ID registered with Cashfree Payments. Only one Public Key can be generated at a time.
Below are the steps 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 encrypt with Public key you received - this is the signature.
  4. Pass this signature through the header X-Cf-Signature. 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.
Copy
Ask AI
<?php
public static function getSignature() {
    $clientId = "<your clientId here>";
    $publicKey =
openssl_pkey_get_public(file_get_contents("/path/to/certificate/public
_key.pem"));
    $encodedData = $clientId.".".strtotime("now");
    return static::encrypt_RSA($encodedData, $publicKey);
}
private static function encrypt_RSA($plainData, $publicKey) { if (openssl_public_encrypt($plainData, $encrypted, $publicKey,
OPENSSL_PKCS1_OAEP_PADDING))
    $encryptedData = base64_encode($encrypted);
    else return NULL;
    return $encryptedData;
}
?>

Was this page helpful?

Internal Transfer V1.2Verify
githubyoutubewebsite
Assistant
Responses are generated using AI and may contain mistakes.