Auto AML Check with Onfido API

Jul 20 · 1 min read
const axios = require('axios')

module.exports.amlChecked = createApplicant

const onfidoKey = 'onfidoKey'// onfido API key

const inputUserData = {
first_name: 'firstName'
last_name: 'lastName'
dob: 'dateofBirth'
country: 'country'
addresses: 'address'

async function createApplicant (user) {
const res = await'/applicants', inputUserData)
const data = await createCheck(
return data

async function createCheck (applicantId) {
const { data } = await${applicantId}/checks,
'type': 'express',
'reports': [
'name': 'identity',
'variant': 'kyc'
'name': 'watchlist',
'variant': 'full'

const output = {
url: data.download_uri,
reports: data.reports
return output
Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade