EKYC
Query verified personal and business identity via Cas ID
With the Cas ID app, Cas can verify both the customer's identity and any businesses owned by them.
From there, Cas provides this API to allow customers to grant your application access to their verified identity information.
Steps to integrate eKYC
Below are the steps to integrate eKYC into your product.
-
Create a grant /grant/token with the
scopes
value set toekyc
. -
Open the Cas Link interface using the
grantToken
returned from the step above. See details -
Your customer opens the Cas ID app and scans the QR code on Cas Link.
-
After the user completes the authorization to allow your application access to their information,
your interface will receive apublicToken
, which is used to obtain anaccessToken
for the grant.
ThisaccessToken
is only valid for 5 minutes. If your application needs to access the information again after that, you must repeat from step 1. -
You can now call the Identity Query API.
Call API
Create grant for eKYC
- CURL
- Javascript (Axios)
curl --location 'https://sandbox.bankhub.dev/grant/token' \
--header 'X-BankHub-Api-Version: 2023-01-01' \
--header 'x-client-id: <CLIENT_ID_HERE>' \
--header 'x-secret-key: <SECRET_KEY_HERE>' \
--header 'Content-Type: application/json' \
--data '{
"scopes": "ekyc:personal",
"language": "vi",
"redirectUri": "https://your-domain.vn/link",
}'
const axios = require('axios');
const data = JSON.stringify({
"scopes": "ekyc:personal",
"language": "vi",
"redirectUri": "https://your-domain.vn/link",
});
const config = {
method: 'post',
maxBodyLength: Infinity,
url: 'https://sandbox.bankhub.dev/grant/token',
headers: {
'X-BankHub-Api-Version': '2023-01-01',
'x-client-id': '<CLIENT_ID_HERE>',
'x-secret-key': '<SECRET_KEY_HERE>',
'Content-Type': 'application/json',
},
data: data
};
axios.request(config)
.then((response) => {
console.log(JSON.stringify(response.data));
})
.catch((error) => {
console.log(error);
});
There will be two scopes for individuals and businesses:
- Individual: ekyc:personal
- Business: ekyc:business
For detail API, here
Exchange publicToken for accessToken
- CURL
- Javascript (Axios)
curl --location 'https://sandbox.bankhub.dev/grant/exchange' \
--header 'X-BankHub-Api-Version: 2023-01-01' \
--header 'x-client-id: <CLIENT_ID_HERE>' \
--header 'x-secret-key: <SECRET_KEY_HERE>' \
--header 'Content-Type: application/json' \
--data '{
"publicToken": "bdbde2bad-7685-4f95-987c-71309a4a3"
}'
const axios = require('axios');
const data = JSON.stringify({
"publicToken": "bdbde2bad-7685-4f95-987c-71309a4a3"
});
const config = {
method: 'post',
maxBodyLength: Infinity,
url: 'https://sandbox.bankhub.dev/grant/exchange',
headers: {
'X-BankHub-Api-Version': '2023-01-01',
'x-client-id': '<CLIENT_ID_HERE>',
'x-secret-key': '<SECRET_KEY_HERE>',
'Content-Type': 'application/json'
},
data: data
};
axios.request(config)
.then((response) => {
console.log(JSON.stringify(response.data));
})
.catch((error) => {
console.log(error);
});
For detail API, here
API to query verified Personal or Business Identity Information
- CURL
- Javascript (Axios)
curl --location 'https://sandbox.bankhub.dev/ekyc' \
--header 'X-BankHub-Api-Version: 2023-01-01' \
--header 'Authorization: <ACCESS_TOKEN_HERE>' \
--header 'x-client-id: <CLIENT_ID_HERE>' \
--header 'x-secret-key: <SECRET_KEY_HERE>'
const axios = require('axios');
const config = {
method: 'get',
maxBodyLength: Infinity,
url: 'https://sandbox.bankhub.dev/ekyc',
headers: {
'X-BankHub-Api-Version': '2023-01-01',
'Authorization': '<ACCESS_TOKEN_HERE>',
'x-client-id': '<CLIENT_ID_HERE>',
'x-secret-key': '<SECRET_KEY_HERE>',
},
};
axios.request(config)
.then((response) => {
console.log(JSON.stringify(response.data));
})
.catch((error) => {
console.log(error);
});
For detail API, here