Use this API call to generate KYC forms on behalf of your customers.
)
which is the UserId value of your onBehalf customer. Verifications submitted with this parameter will also be visible to your customers
through their portal account.
const apiEndpoint = 'https://dev.bronid.com/idform';
// request body
const kycData = {
"metadata_serviceUid": "XL7ULiU6B4QE9Y2iWFZnhtMDKFN2",
"metadata_secretKey": "api_sec_NJAtNcRtUrPlf7xYDrMNP9URI-ZfN314",
"metadata_version": "4",
"metadata_userId": "yourUniqueUserId",
"metadata_onBehalf": "REPLACE_WITH_YOUR_CUSTOMER_SERVICE_UID",
"metadata_tags": ["tag1", "tag2"],
"bronLink_dataAccessType": "idForm",
"type": "individual",
"fields": {
"country": "AUS",
"firstName": "Jane",
"middleName": "ok",
"lastName": "Citizen",
"gender": "female",
"dateOfBirth": "20/10/1980",
"address": "125 york st",
"email": "email@gmail.com"
}
};
console.log('Running request...')
// submit the KYC data to the bronID API
try {
const response = await fetch(apiEndpoint, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify(kycData),
});
if (!response.ok) {
const errorData = await response.json();
console.log('error! click the results to expand them');
console.log(JSON.stringify(errorData, null, 2));
} else {
const bronIdResult = await response.json();
const printResult = 'bronId API response: ' + JSON.stringify(bronIdResult, null, 2);
console.log(printResult);
}
} catch (error) {
console.log('Fetch error: ', error);
}
// Click “▶ run” to try this code live and run your first KYC.