Get Documents
GET
‎https://<domain>/<api prefix>/<version>/user/kyc/documents/
This API endpoint will return kyc document data with verify status.
HTTP/1.1 200 OK
Content-Type: application/json
Body:
{
"status_code": 200,
"errors": {},
"data": {
"documents": {
"<document_key>": {
"type": "<doc_type>",
"doc_type": "<doc_key>",
"doc_name": "<doc_name>",
"verify_status": <verify_status>,
"note": "<note>",
"data":"<base64_data>"
},
...
},
"kyc_verify_status": <kyc_verify_status>
}
}
Sample Code
Node
var request = require('request');
var options = {
'method': 'GET',
'url': 'https://<domain>/<api prefix>/<version>/user/kyc/documents/',
'headers': {
'apikey': '<apikey>',
'Authorization': 'Bearer <access token>',
}
};
request(options, function (error, response) {
if (error) throw new Error(error);
console.log(response.body);
});
PHP
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://<domain>/<api prefix>/<version>/user/kyc/documents/',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_HTTPHEADER => array(
'apikey: <apikey>',
'Authorization: Bearer <access token>',
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
Upload Documents
POST
‎https://<domain>/<api prefix>/<version>/user/kyc/documents/
This API endpoint will upload user kyc documents.
Request Body
Name | Type | Description |
---|
| | ID Proof :- Allowed file formats includes: Documents(.PDF) and Images (.JPG, .PNG) and maximum size: 8MB. |
| | Utility Bills:- Allowed file formats includes: Documents(.PDF) and Images (.JPG, .PNG) and maximum size: 8MB. |
| | Account statement:-Allowed file formats includes: Documents(.PDF) and Images (.JPG, .PNG) and maximum size: 8MB. |
HTTP/1.1 200 OK
Content-Type: application/json
Body:
{
"status_code": 200,
"errors": {},
"data": {}
}
Sample Code
Node
var request = require('request');
var fs = require('fs');
var options = {
'method': 'POST',
'url': 'https://<domain>/<api prefix>/<version>/user/kyc/documents/',
'headers': {
'apikey': '<apikey>',
'Authorization': 'Bearer <access token>',
},
formData: {
'document': {
'value': fs.createReadStream('<file_path>'),
'options': {
'filename': '<file_name>',
'contentType': null
}
},
'document1': {
'value': fs.createReadStream('<file_path>'),
'options': {
'filename': '<file_name>'
'contentType': null
}
},
'document2': {
'value': fs.createReadStream('<file_path>'),
'options': {
'filename': '<file_name>',
'contentType': null
}
}
}
};
request(options, function (error, response) {
if (error) throw new Error(error);
console.log(response.body);
});
PHP
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://<domain>/<api prefix>/<version>/user/kyc/documents/',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS => array('document'=> new CURLFILE('<file_path>'),'document1'=> new CURLFILE('<file_path>'),'document2'=> new CURLFILE('<file_path>')),
CURLOPT_HTTPHEADER => array(
'apikey: <apikey>',
'Authorization: Bearer <access token>',
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
Error Responses
| | | |
| | | Please upload all required KYC documents and submit the form. Maximum upload size is 8MB. |
| | document, document1, document2 | File type '<file_type>' is not allowed. Allowed types are: 'image/png, application/pdf, image/jpeg'. |
Delete Document
DELETE
‎https://<domain>/<api prefix>/<version>/user/kyc/documents/
This API endpoint will delete a kyc document.
Query Parameters
Name | Type | Description |
---|
| | Document key: document, document1 or document2. |
HTTP/1.1 200 OK
Content-Type: application/json
Body:
{
"status_code": 200,
"errors": {},
"data": {}
}
Sample Code
Node
var request = require('request');
var options = {
'method': 'DELETE',
'url': 'https://<domain>/<api prefix>/<version>/user/kyc/documents/',
'headers': {
'apikey': '<apikey>',
'Authorization': 'Bearer <access token>',
}
};
request(options, function (error, response) {
if (error) throw new Error(error);
console.log(response.body);
});
PHP
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://<domain>/<api prefix>/<version>/user/kyc/documents/',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'DELETE',
CURLOPT_HTTPHEADER => array(
'apikey: apikey',
'Authorization: Bearer <access token>',
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
Error Responses
| | | |
| | | Sorry! Some error occurred. You can not remove your document now. KYC Documents not found. |
| | | This field is required and it may not be blank. Invalid document key. |