Enkash APIs
HomePayment GatewayPayoutsCreate Account
HomePayment GatewayPayoutsCreate Account
Login
  1. Employee R&R
  • EnKash Developer Portal Overview
  • Payment Gateway
    • Payment Gateway Overview
    • Payment Gateway Sign Up
    • Payment Methods
    • Supported Integrations
    • Payment Gateway APIs
    • Web Integration
    • Server to Server Integration
    • Test Card Details
    • Authorization
      • About Authorization
      • Get Authorization Token
    • Orders
      • About Order
      • Create Order
      • Get Order Status
      • Get Order By Merchant Order Id
      • Get BNPL Payment Modes
      • Get Dynamic QR Code
      • UPI Intent Links
    • Payments
      • About Payment
      • Submit Payment Detail
      • Get Transaction Status
      • Validate OTP
      • Resend OTP
      • Payment Notify Request
      • Get UPI Transaction Status
      • Verify VPA
    • Refunds
      • About Refund
      • Refund
    • Settlements
      • About Settlement
      • Settlement Reporting
      • Get Settlement Payout By ID
      • Search Settlement Payouts
    • Split Settlements
      • About Split Settlements
      • Create Split Settlement Account
      • Update Split Settlement Account
      • Get All Split Settlement Account
      • Deactivate Split Settlement Account
      • Activate Split Settlement Account
      • Submit Payment with Split Details
      • Edit/Deferred Split Settlement
    • E-Commerce Plugins
    • Payment Links
    • Payment Button
    • Qr Code
      • Create Qr Code
      • Get QR Code
      • Search QR Code
      • createCustomer
      • searchCustomer
      • Cancel QR Code
    • UPI Mandate
      • Create UPI Mandate
      • Update UPI Mandate
      • Revoke UPI Mandate
      • Get UPI Mandate
      • UPI mandate create callback
      • Mandate Pre-debit Notification
      • Execute mandate debit
      • Mandate Debit callback
  • Payment Links
    • Payment Links Overview
    • Payment Link APIs
    • Payment Link
      • Create Payment Link
      • Get Payment Link Details
      • Delete Payment Link
    • Payment Link Webhook
      • Payment Link Webhook Request
  • Bharat Connect (BBPS)
    • About Bharat Connect
    • B2B Invoicing
      • Invoice
        • Create Invoice
        • Confirm Invoice
        • Status Change Invoice
        • Edit Invoice
      • Payment
        • Pay Invoices
        • Payment Confirmation
      • Financing
        • Request Financing
        • Share Bid
        • Respond Bid
      • Onboarding
        • Register Check Entity
        • Search Entity
        • Register Entity
        • Registration Id
      • cdNote
        • Send CdNote Request
        • Confirm CdNote Request
        • Status Change CdNote Request
      • Purchase Order
        • Send Purchase Order Request
        • Confirm Purchase Order Request
        • Edit Purchase Order Request
        • Status Change Purchase Order Request
      • webhook-invoice
        • Webhook Create Invoice Request
        • Webhook Create Invoice Response
        • Webhook Confirm Invoice Request
        • Webhook Confirm Invoice Response
        • Webhook Status Change Invoice Request
        • Webhook Status Change Invoice Response
        • Webhook Edit Invoice Request
        • Webhook Edit Invoice Response
      • webhook-payments
        • Webhook Payment Request
        • Webhook Payment Confirmation Request
        • Webhook Payment Response
        • Webhook Payment Confirmation Response
      • webhook-business-onboarding
        • Webhook Check Entity Response
        • Webhook Register Entity Response
        • Webhook Search Entity Response
        • Webhook Registration Id Response
      • webhook-financing
        • Webhook Financing Response
        • Webhook Respond Bid Response
        • Webhook Share Bid Request
      • webhook-cdNote
        • Webhook Send CdNote Request
        • Webhook Send CdNote Response
        • Webhook Confirm CdNote Request
        • Webhook Confirm CdNote Response
        • Webhook Status Change CdNote Request
        • Webhook Status Change CdNote Response
      • Webhook Purchase Order
        • Webhook Send Purchase Order Request
        • Webhook Send Purchase Order Response
        • Webhook Confirm Purchase Order Request
        • Webhook Confirm Purchase Order Response
        • Webhook Edit Purchase Order Request
        • Webhook Edit Purchase Order Response
        • Webhook Status Change Purchase Order Request
        • Webhook Status Change Purchase Order Response
    • Bill Payments
      • Bill Payments Overview
      • Get Authentication Token
      • Get BillerTypes
      • Get Billers
      • Fetch Bill
      • Create Bill API
      • Create Bill Without Bill Fetch
      • Bill Payment
      • Utility Bill Approval API
      • Get Utility Bill Status
      • Get Utility Bill by Reference Id
      • Get Utility Bills Detail
      • Bill Payment Webhook
  • Payouts
    • Payouts Overview
    • Payouts Sign Up
    • Payout Methods
    • Payout API Response Codes
    • Payouts Integration Steps
    • Encrypting and Decrypting Payload
    • Payouts Status Codes
    • Get Authentication Token
      • Get Authentication Token
    • Beneficiary Apis
      • Create Beneficiary
      • Search Beneficiary
      • Delete Beneficiary
    • Transfer Apis
      • Create Payout
      • Search Payouts
      • Create Batch Payout
    • Payout Account Apis
      • Get Balance
      • Get Source Bank Account Details
      • Add Source Bank Account
      • Fetch Bank Statement
    • Webhook Data Apis
      • Get Webhook Data
      • Create Webhook Data
  • Accounts Payable Management Tool
    • About AP Management Tool
    • Vendor Management
      • Create Vendor
      • Create Bulk Vendors
      • Update Bulk Vendors
      • Get Beneficiaries (V1)
      • Get Beneficiaries
      • Change Vendor Status
      • Get Beneficiary
    • Invoice Management
      • Payout Apis
        • validateInvoices
        • initiate
        • Search Payouts V1
        • bulkCreatePayout
        • Create Payout
        • Update Payouts
        • Search Payouts
        • createBulkPayoutForPartnerIntegration
        • Update Bulk Payouts
        • Update Approval Status
        • Get Invoice Data
        • Delete Payout
    • Bharat Connect 2.0 AP
      • Confirm Invoice Request
      • Payment Request
    • Update Beneficiary
  • Account Receivable
    • Accounts Receivable Overview
    • Get Authentication Token Copy
      • Get Authentication Token
    • Customer Management
      • Customer Apis
        • Activate customer
        • createBulkCustomer
        • bulkUpdate
        • Deactivate customer
        • deleteCustomerByCustomerId
        • updateCustomer
    • Customer Contacts Management
      • Customer Apis
        • getCustomerContactDetails
    • Invoice Management
      • invoice-controller
        • createInvoice
        • invoiceBulkUpload
        • Dispatch Invoice Collection
        • Delete Invoice Collection
        • searchCollectionInvoices
        • getInvoice
        • updateInvoice
    • Payment Reminders
      • customer-reminder-controller
        • createCustomerReminder
        • getCustomerReminders
        • getCustomerReminder
        • deleteReminder
        • updateCustomerReminder
    • Bharat Connect 2.0 AR
      • Payment Confirmation Request
      • Change Invoice Status Request
      • Bulk Create Invoice
  • Expense Management
    • Expense Management Overview
    • Sign Up - Expense Management
    • Token Api
      • About Authorization
      • Token API
    • Expenses
    • Advance
  • Loyalty
    • Overview
    • Sign Up
    • Employee R&R
      • API Integration Guide
      • Common Fields passed in API requests
      • Token Api
        • Client Authentication
        • SSO LOGIN (Single Sign On)
      • Create And Allocate point
        POST
      • Bulk Create And Allocate Points
        POST
      • Get Card Account Details
        POST
      • Get Transaction details
        POST
      • List Users Details
        POST
      • Get User Card Details
        POST
    • Channel Incentives
      • Incentive Create And Allocate point
      • Reward Get Transaction details
      • Incentive Get User Details
    • Points Redemption
      • User Authentication
      • Get Cart for User
      • Search Catalog
      • Get Product Catalog Details
      • Get Product Configs (Denominations)
      • Add to cart
      • Update Cart
      • Create Order
      • Order Search
      • create order
      • Fetch Order Info by Partner order Reference id
    • Point Management APIs
      • Overview
      • Create Event
      • Get Event
      • Update Event
      • Allocate Coins
      • Get Balance
  • Card Management
    • EnKash Card Management Systems Overview
    • Cards We Issue
    • API Reference
    • VKYC
    • Developer Guide
    • Cards Integration Steps
    • Encryption / Decryption of API requests / Response
    • Encryption & Decryption Guide
    • Token Api
      • Partner auth Token
    • Gift Card
      • Create
      • Request Physical
      • Block
      • Replace
      • Get User Details
      • Get Transaction Details
      • Get All Transaction details
    • Meal Cards
      • Create
      • Load Balance
      • Replace
      • Block
      • Request Physical
      • Get User Card Details
      • Get Transaction Details
      • Get All Transaction details
    • Prepaid Cards
      • Create
      • Load Balance
      • Replace
      • Block
      • Request Physical
      • Get User Card Details
      • Get Transaction Details
      • Get All Transaction details
    • Fuel_cards
      • Create
      • Load Balance
      • Replace
      • Block
      • Physical
      • Get User Card Details
      • Get Transaction Details
      • Get All Transaction details
    • Advance Card Feature
      • Create Card Account
      • Set Pin
      • Get Card Account Details
      • Generate Otp Card
      • View Card
      • Update Card Velocity Rules
      • Get Card Velocity Rules
  • Verification Suite
    • Verification Suite Overview
    • Bank Account Verification
      • Bank Account Verification PennyLess/PennyDrop
    • GSTN Verification
      • Gstin Verification
    • PAN Verification
      • Pan Verification
    • UPI(VPA) Verification
      • Vpa Verification
  1. Employee R&R

API Integration Guide

Rewards integration#

Flow#

Screenshot 2024-08-21 at 7.25.58 PM.png

Detailed Step#

Get authorization token - Client Authentication
Post authorization and receipt of access token listed of the EnkashApi’s can be invoked.
For every API call, set request headers and authorization token.
Get cardAccount details api will be called to check card account details.
Create and allocate fund api will be called to fund user.
NOTE:
Partners are expected to mandatorily send “encrypted” requests with the use of encryption logic shared, which are used to check API integrity between Distribution Platform server and Partner.
The code will always be 0, in case of SUCCESS transaction and HTTP status code will be 200. And for all the other failure transactions, response code will be 1 and For all the error responses, please find below the references -
{
"response_code": 1,
"response_message": "Insufficient balance in card account",
"payload": "Insufficient balance in card account"
}
OtbBalance field is the reward Card balance, from which the person can buy/redeem rewards.

APIs#

APIFunction
Get Card Account DetailsThis API is used for fetching a particular card account details. Like balance, account id
Create And Allocate pointThis API is used to create a reward card along with allocating points to the employee, as well as, it can be used to re-allocate points to an existing reward card user.
SSO LOGINThis API facilitates the generation of a sign-in token for reward card holders. This token allows users to bypass the usual login and OTP verification steps, enabling them to directly access the EnKash Redeem Rewards Page.
Get Transaction detailsThis API is used for fetching a List of transaction details and fetch the status of transaction
Search Enkash CardThis API is used for fetching a card details of a user
Bulk Create Card / Allocate PointsThis is used to create users and allocate reward points as well to the users in BULK

How to integrate the SSO with Enkash?#

1.
Retrieve the User {access_token} by passing the required fields in the SSO LOGIN (Single Sign On) API.
2.
Integrate the below URL with the Redeem functionality on the partner’s portal(FOR EMPLOYEE FLOW)
URL - https://invoice-uat.enkash.in/sso/{access_token}/employee_rewards/{partner}
{access_token) - represents the token which has been generated by the partner for a user.
{partner} - The integrating partner name (Eg - HRMS)
Example URL : https://invoice-uat.enkash.in/sso/aF5V6hPScEd9mCowJmbZFKk5Xg/employee_rewards/hrms
This URL will redirect the user to Enkash Rewards Platform .
3.
For HR Admin single sign on, integrate the below URL:
URL - https://invoice-uat.enkash.in/sso/{access_token}/reward_account/{partner}
For HR admin also, kindly pass the enkash card ID for HR / company admin which is generated upon client onboarding
4.
For Production environment , replace - {invoice-uat.enkash.in} with {home.enkash.com}

HTTP CODES#

CodeMessageDescription
200SuccessThe API has been successfully executed
400BAD_REQUESTIndicates the request is invalid or a mandatory parameter must have been missing.
422UNPROCESSABLE_ENTITYIndicates that the api couldn't be processed given the request conditions.
404NOT_FOUNDIndicates somewhere in the code, API couldn’t fetch the required entity from the database. (returned null)
500Internal Server ErrorIndicates an error occurred on Enkash Server

Encryption of Request#

APIs shared have an encryption/decryption mechanism set on them. To pass a request as an encrypted request. Kindly follow the below steps in Java.
Make an encryption class and follow the below steps.
Encryption using AES Algorithm with ECB Mode and PKCS5 padding:

Import the required libraries in Java:#

import java.nio.charset.StandardCharsets;
import java.security.MessageDigest;
import java.util.Arrays;
import javax.crypto.Cipher;
import javax.crypto.spec.SecretKeySpec;
import java.util.Base64;

Create an Encryption Function:#

Implement the encrypt function to perform encryption. This function takes two parameters: the string to be encrypted (strToEncrypt) and a secret key (secret) for encryption.
public static String encrypt(String strToEncrypt, String secret) {
try {
if (CommonUtil.isEmpty(strToEncrypt))
return "";
SecretKeySpec secretKeySpec = getKeySpec(secret);
Cipher cipher = Cipher.getInstance("AES/ECB/PKCS5Padding");
cipher.init(Cipher.ENCRYPT_MODE, secretKeySpec);
byte[] encryptedBytes = cipher.doFinal(strToEncrypt.getBytes(StandardCharsets.UTF_8));
return Base64.getEncoder().encodeToString(encryptedBytes);
} catch (Exception e) {
LOGGER.error("Error while encrypting: " + e.getMessage());
}
return null;
}

Generate a SecretKeySpec#

private static SecretKeySpec getKeySpec(String secretKey) throws NoSuchAlgorithmException {
byte[] key = secretKey.getBytes(StandardCharsets.UTF_8);
MessageDigest sha = MessageDigest.getInstance("SHA-256");
key = sha.digest(key);
key = Arrays.copyOf(key, 16); // Use only the first 128 bits for AES-128
return new SecretKeySpec(key, "AES");
}

Call the encrypt function to get the encrypted data#

String stringToEncrypt = "This is a confidential message.";
String secretKey = "YourSecretKey123";
String encryptedData = encrypt(stringToEncrypt , secretKey);

Now pass the above encryptedData in the API request, It will return an encrypted Response. To Decrypt the response, make a method for decrypt logic like this:-#

public static String decrypt(String strToDecrypt, String secret) {
try {
if (CommonUtil.isEmpty(strToDecrypt))
return "";
SecretKeySpec secretKeySpec = getKeySpec(secret);
Cipher cipher = Cipher.getInstance("AES/ECB/PKCS5PADDING");
cipher.init(Cipher.DECRYPT_MODE, secretKeySpec);
return new String(cipher.doFinal(Base64.getDecoder().decode(strToDecrypt)));
} catch (Exception e) {
LOGGER.error("Error while decrypting: " + e.getMessage());
}
return null;
}

To get the decrypted response, execute the below operation.#

String response = "This is a confidential message.";
String secretKey = "YourSecretKey123";
String decryptedData = decrypt(response, secretKey);
NOTE- Pass the input String without any double quotes(“ “) and the encrypted string should not have any trailing whitespaces.
Modified at 2025-01-08 08:01:04
Previous
Sign Up
Next
Common Fields passed in API requests
Built with