Use this API call to perform KYC verification of sole traders.
const apiEndpoint = 'https://dev.bronid.com/verify';
// request body
const kycData = {
"metadata_version": "4",
"metadata_serviceUid": "XL7ULiU6B4QE9Y2iWFZnhtMDKFN2",
"metadata_secretKey": "api_sec_NJAtNcRtUrPlf7xYDrMNP9URI-ZfN314",
"metadata_userId": "yourUniqueUserId",
"type": "soleTrader",
"fields": {
"country": "GBR",
"name": "entity name",
"entityNumber": "123456",
"principalPlaceOfBusinessRequired": "Principal office GBR"
},
"stakeholders": [
{
"type": "individual",
"role": "individuals",
"fields": {
"country": "GBR",
"firstName": "Jane",
"middleName": "ok",
"lastName": "Citizen",
"gender": "female",
"dateOfBirth": "20/10/1980",
"address": "210 Pentonville Road",
"unitNumber": "",
"streetNumber": "210",
"streetName": "Pentonville",
"streetType": "Road",
"locality": "London",
"postcode": "N19AA",
"phone": "2074999000",
"email": "email@gmail.com"
}
}
]
};
console.log('Running request. Please wait...')
// 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.