Business verification (KYB 2.0): company applicants and their beneficiaries (UBOs, shareholders, directors, representatives and other roles).
A company is an applicant with type: "company" whose
fixedInfo.companyInfo holds the company data; it is verified on a
KYB level. Beneficiaries are linked to it, either as existing
applicants or from beneficiaryInfo; a new beneficiary gets its own
applicant only when the level configures a verification level for
that role.
Values
BENEFICIARY_TYPES
BENEFICIARY_TYPES: Vec [
"ubo",
"shareholder",
"representative",
"director",
"companyOfficer",
"investor",
"secretary",
"founder",
"legalAdvisor",
"authorizedSignatory",
"trustee",
"trustBeneficiary",
"trustSettlor",
"trustProtector",
"managingPartner",
"equityPartner",
"fundInvestor",
"fundManager",
"investmentManager",
"investmentAdviser",
"fundAdministrator",
"depositary",
"custodian",
"primeBroker",
"accountUser"
]
UBO_SUBTYPES
UBO_SUBTYPES: Vec [
"ownershipUbo",
"controlUbo",
"substituteUbo"
]
Functions
add-beneficiary
fn (company-applicant-id: Str, beneficiary: Map): Map
fn (company-applicant-id: Str, beneficiary: Map, opts: Map): Map
Link a beneficiary to a company. Returns {id, applicantId, types, shareSize, beneficiaryInfo, ...}; keep id (the beneficiary id, not
the applicant id) to unlink it later.
Example
ubo ::sumsub::kyb/add-beneficiary("65f0c1e2a3b4c5d6e7f80912", {
types: ["ubo", "director"],
shareSize: 60,
subtypes: ["ownershipUbo"],
beneficiaryInfo: {firstName: "Ada", lastName: "Lovelace", country: "GBR"}
})
beneficiaries
fn (applicant: Any): Vec
The beneficiaries on a company applicant (as returned by
::sumsub::applicants/get-applicant):
fixedInfo.companyInfo.beneficiaries, falling back to
info.companyInfo.beneficiaries; [] when none. Pure.
Example
::sumsub::kyb/beneficiaries({fixedInfo: {companyInfo: {beneficiaries: [{id: "b1"}]}}}) // [{id: "b1"}]
::sumsub::kyb/beneficiaries({}) // []
beneficiary-request
fn (company-applicant-id: Str, beneficiary: Map): Map
The spec for linking a beneficiary. beneficiary takes types
(required, roles from BENEFICIARY_TYPES), then either applicantId
(an existing applicant) or beneficiaryInfo ({firstName, lastName, dob, country, email, ...} for a person, {companyName, registrationNumber, ...} for a company), plus shareSize (percent),
subtypes (UBO_SUBTYPES, with ubo only) and natureOfControl
(required for controlUbo). Exposed for testing.
Example
spec ::sumsub::kyb/beneficiary-request("abc", {types: ["ubo"], applicantId: "def"})
spec.path // "/resources/applicants/abc/fixedInfo/companyInfo/beneficiaries"
spec.body // {types: ["ubo"], applicantId: "def"}
is-err(::sumsub::kyb/beneficiary-request("abc", {types: []})) // true
create-company
fn (level-name: Str, external-user-id: Str, company-info: Map, options: Map): Map
fn (level-name: Str, external-user-id: Str, company-info: Map, options: Map, opts: Map): Map
Create a company applicant on a KYB level. Returns the applicant.
Example
company ::sumsub::kyb/create-company("kyb-level", "acme-ltd", {
companyName: "Acme Ltd",
country: "GBR",
registrationNumber: "12345678"
}, {})
create-company-request
fn (level-name: Str, external-user-id: Str, company-info: Map, options: Map): Map
The spec for creating a company applicant. company-info needs
companyName and country (alpha-3); optional fields include
registrationNumber, incorporatedOn (YYYY-MM-DD), type,
legalAddress, address ({street, town, state, postCode, country}; state is required for US and Canadian registry checks),
taxId, leiCode, website, email, phone, noUBOs,
noShareholders. options adds applicant fields (email, lang,
sourceKey, metadata). Exposed for testing.
Example
spec ::sumsub::kyb/create-company-request("kyb-level", "acme-ltd", {companyName: "Acme Ltd", country: "GBR"}, {})
spec.path // "/resources/applicants?levelName=kyb-level"
spec.body.fixedInfo.companyInfo.companyName // "Acme Ltd"
is-err(::sumsub::kyb/create-company-request("kyb-level", "acme-ltd", {}, {})) // true
link-applicant
fn (company-applicant-id: Str, applicant-id: Str, types: Vec<Str>): Map
fn (company-applicant-id: Str, applicant-id: Str, types: Vec<Str>, opts: Map): Map
Link an existing applicant to a company in the given roles; shorthand
for add-beneficiary with applicantId.
Example
link ::sumsub::kyb/link-applicant("65f0c1e2a3b4c5d6e7f80912", "65f0c1e2a3b4c5d6e7f80913", ["director"])
link.id
remove-beneficiary
fn (company-applicant-id: Str, beneficiary-id: Str): Map
fn (company-applicant-id: Str, beneficiary-id: Str, opts: Map): Map
Unlink a beneficiary by its beneficiary id (from add-beneficiary or
beneficiaries).
Example
::sumsub::kyb/remove-beneficiary("65f0c1e2a3b4c5d6e7f80912", "65f0c1e2a3b4c5d6e7f80a00")
update-company-info
fn (applicant-id: Str, fields: Map): Map
fn (applicant-id: Str, fields: Map, opts: Map): Map
Overwrite the company data fields you supply (PATCH .../fixedInfo/companyInfo).
Example
::sumsub::kyb/update-company-info("65f0c1e2a3b4c5d6e7f80912", {website: "https://acme.example"})