EnKash API Document
HomePayment GatewayPayoutsCreate Account
HomePayment GatewayPayoutsCreate Account
Login
  1. Payouts
  • Payouts Overview
  • Payouts Sign Up
  • Payout Methods
  • Payouts Integration Steps
  • Ecrypting and Decrypting Payload
  • Get Authentication Token
    • Get Authentication Token
      POST
  • Beneficiary Apis
    • Create Beneficiary
      POST
    • Search Beneficiary
      POST
    • Delete Beneficiary
      DELETE
  • Transfer Apis
    • Create Payout
      POST
    • Search Payouts
      POST
    • Create Batch Payout
      POST
  • Payout Account Apis
    • Get Source Bank Account Details
      GET
    • Add Source Bank Account
      POST
    • Get Balance
      GET
  1. Payouts

Ecrypting and Decrypting Payload

For all payouts APIs, it's essential to encrypt the request payload before sending it for processing. Similarly, the response is encrypted and needs to be decrypted before consumption. This security measure ensures that transaction requests and responses are securely transmitted. You can refer to below examples to encrypt/decrypt payloads.
For all payout apis request and response format is:
Request Format:
{
    "request":"{ecrypted_request_string}"
}
Response Format:
{
    "request":"{ecrypted_response_string}"
}
To encrypt a request payload, you can utilize the provided example with the following logic:

Encryption Logic:#

Parameters:#

strToEncrypt: The payload string that you want to encrypt.
secretKey: The client's secret key used for encryption. This should be provided by the client.

Usage:#

Construct an object with the required fields.
Convert the request object to a JSON string.
Call the encrypt method with the JSON payload and the client's secret key.
It will return the encrypted payload as a Base64 encoded string.
NOTE
Ensure to securely handle and store the secret key.
This encryption logic uses AES encryption with ECB mode and PKCS5 padding

Decryption Logic#

To decrypt a payload, you can utilize the provided Java method decrypt with the following logic:

Parameters:#

strToDecrypt: The encrypted payload string that you want to decrypt.
secretKey: The client's secret key used for decryption. This should match the secret key used for encryption.

Usage:#

Call the decrypt method with the encrypted payload string and the client's secret key
It will return the decrypted payload as a string
If the payload represents a JSON object, you can convert it back to an object
NOTE
Ensure to securely handle and store the secret key.
This decryption logic uses AES decryption with ECB mode and PKCS5 padding
Previous
Payouts Integration Steps
Next
Get Authentication Token
Built with