Skip to main content

Upload KYC

POST 

/v1/users/upload/kyc

Submit KYC documents and information for user verification

Encryption Requirements

The following parameters must be encrypted before sending:

  • firstName
  • lastName
  • panNumber
  • aadharNumber

Code for encryption

const crypto = require("crypto");

const encrypt = (plainText, password) => {
try {
const iv = crypto.randomBytes(16);
const key = crypto.createHash('sha256').update(password).digest('base64').substr(0, 32);
const cipher = crypto.createCipheriv('aes-256-cbc', key, iv);

let encrypted = cipher.update(plainText);
encrypted = Buffer.concat([encrypted, cipher.final()])
return iv.toString('hex') + ':' + encrypted.toString('hex');

} catch (error) {
console.log(error);
}
}

// To generate encryption
const sampleText = "apple";
const encryptedText = encrypt(sampleText, SECRET_KEY);
console.log(encryptedText);

Contact for SECRET_KEY

For access to SECRET_KEY for encryption, please contact support@onmeta.in


Common Bad Request (400) Errors

Below are common 400 Bad Request error responses and their explanations:

  1. KYC Already Verified

    {
    "success": false,
    "error": {
    "code": 400,
    "message": "KYC already verified for this customer"
    }
    }

    Cause: The customer account associated with the email has already completed KYC verification. Re-submitting KYC for an already verified customer is not allowed.

  2. Invalid Encrypted Data

    {
    "success": false,
    "error": {
    "code": 400,
    "message": "Invalid encrypted data"
    }
    }

    Cause & Fix: Decryption failed on the server for encrypted fields (firstName, lastName, panNumber, aadharNumber). Please check:

    • Ensure you are using the correct encryption algorithm: AES-256-CBC.
    • Verify that you are using the correct SECRET_KEY provided by Onmeta.
    • Ensure the IV is prefixed correctly in the format iv:encryptedData in hexadecimal.

Request

Responses

Success