After having created a user at a handle with /register, you can start the KYC verification process on the user with this endpoint. The verification results for a handle are asynchronously returned at the /check_kyc endpoint, and further details on handling failures can be found in the documentation there.
In sandbox only, you can register a user that will always fail KYC by passing in a "first_name", "last_name", or "full_name" field with a value of "FAIL" (case-insensitive). For example, values of "fail", "Fail", and "fAiL" will all result in failures, but values like "Fail ", "FAILURE", and "fail1" will pass sandbox KYC.
Requests
The request body at this endpoint is the header_msg JSON object.
header.user_handle
should have the registered handle to be verified.
Both authsignature
and usersignature
headers are required for this request. The usersignature header should be generated with a keypair registered to the user (either registered from the /register endpoint or the /register_wallet endpoint). See authentication section for more details on how to generate this signature.
You can also pass a kyc_level
key into the request body if you have a specific KYC flow approved for your app. If your funds flow needs different KYC requirements, contact us!
POST /0.2/request_kyc HTTP/1.1
Host: sandbox.silamoney.com
authsignature: [GENERATED AUTHSIGNATURE HEX STRING HERE]
usersignature: [GENERATED USERSIGNATURE HEX STRING HERE]
Content-Type: application/json
{
"header": {
"created": 1234567890,
"auth_handle": "handle.silamoney.eth",
"user_handle":"user.silamoney.eth",
"version": "0.2",
"crypto": "ETH",
"reference": "<your unique id>"
},
"message": "header_msg"
}
***
HTTP/1.1 200 OK
{
"reference":"ref",
"message":"user submitted for KYC review.",
"success": true,
"status":"SUCCESS",
"verification_uuid": "482d405f-2dc4-4cbc-9f37-13e0dfa8be5a"
}
***
For custom user-onboarding flows:
***
POST /0.2/request_kyc HTTP/1.1
Host: sandbox.silamoney.com
authsignature: [GENERATED AUTHSIGNATURE HEX STRING HERE]
usersignature: [GENERATED USERSIGNATURE HEX STRING HERE]
Content-Type: application/json
{
"header": {
"created": 1234567890,
"auth_handle": "handle.silamoney.eth",
"user_handle":"user.silamoney.eth",
"version": "0.2",
"crypto": "ETH",
"reference": "ref"
},
"message": "header_msg",
"kyc_level": "CUSTOM_KYC_FLOW_NAME"
}
***
HTTP/1.1 200 OK
{
"reference":"ref",
"message":"user submitted for KYC review.",
"success": true,
"status":"SUCCESS",
"verification_uuid": "482d405f-2dc4-4cbc-9f37-13e0dfa8be5a"
}
// Normal flow
const res = await Sila.requestKYC(userHandle, walletPrivateKey);
// Custom flow
const res = await Sila.requestKYC(userHandle, walletPrivateKey, 'flow_name');
// Success Response Object
console.log(res.statusCode); // 200
console.log(res.data.reference); // Random reference number
console.log(res.data.status); // SUCCESS
console.log(res.data.message); // User submitted for KYC review
### Default KYC Request
payload={
"user_handle": "user.silamoney.eth" #Required
}
User.requestKyc(silaApp,payload,user_private_key, use_kyc_level=False)
### Custom KYC Request
payload = {
"user_handle": "user.silamoney.eth" #Required
"kyc_level": "CUSTOM_KYC_FLOW_NAME"
}
User.requestKyc(silaApp,payload,user_private_key, use_kyc_level=True)
### Success Response Object
{
status: 'SUCCESS',
message: 'user submitted for kyc',
}
### Failure Response Object
{
status: 'FAILURE',
message: 'error',
}
### ***SECURITY ALERT***
### ***This sdk never transmits private keys over the network,it is advised to use a secure way for managing user private keys***
// Normal Flow
ApiResponse response = api.requestKYC(userHandle, userPrivateKey);
// Custom Flow
String kycLevel = "CUSTOM_KYC_FLOW_NAME";
ApiResponse response = api.requestKYC(userHandle, userPrivateKey, kycLevel);
// Success Response Object
System.out.println(response.getStatusCode()); // 200
System.out.println(((BaseResponse)response.getData()).getReference()); // Random reference number
System.out.println(((BaseResponse)response.getData()).getStatus()); // SUCCESS
System.out.println(((BaseResponse)response.getData()).getMessage()); // user submitted for KYC review.
// Normal flow
$userHandle = 'user.silamoney.eth';
$userPrivateKey = 'some private key'; // Hex format
$response = $client->requestKYC($userHandle, $userPrivateKey);
// Custom flow
$userHandle = 'user.silamoney.eth';
$userPrivateKey = 'some private key'; // Hex format
$kycLevel = 'CUSTOM_KYC_FLOW_NAME';
$response = $client->requestKYC($userHandle, $userPrivateKey, $kycLevel);
// Success 200
echo $response->getStatusCode(); // 200
echo $response->getData()->getReference(); // Random reference number
echo $response->getData()->getStatus(); // SUCCESS
echo $response->getData()->getMessage(); // User submitted for KYC review.
// Normal flow
ApiResponse<object> response = api.RequestKYC(userHandle, walletPrivateKey);
// Custom flow
ApiResponse<object> response = api.RequestKYC(userHandle, walletPrivateKey, "flow_name");
// Success Response Object
Console.WriteLine(response.StatusCode); // 200
Console.WriteLine(((BaseResponse)response.Data).Reference); // Random reference number
Console.WriteLine(((BaseResponse)response.Data).Status); // SUCCESS
Console.WriteLine(((BaseResponse)response.Data).Message); // user submitted for KYC review.
Key | Type | Description |
---|---|---|
header | JSON object | Required. Requires these keys in JSON format: created, auth_handle, user_handle. See the /check_handle endpoint for the complete list of fields in this object. |
kyc_level | String | Optional. The optional kyc_level field is used to request a non-default verification flow for an entity if you have a specific KYC flow approved for your app. |
Responses
Status Code |
| Description |
---|---|---|
200 |
| The verification process for the user registered under |
400 |
| Bad request format - check |
401 |
|
|
403 |
|
|
Updated about a month ago