← All examples

KYC Screening

Compliance

Verify identity, sanctions, and document checks for Know Your Customer compliance.

Policy rule

A **customer** passes kyc_screening
  if §customer.identity is valid
  and §customer.sanctions is valid
  and §customer.document is valid.

customer.identity. A **customer** passes identity_check
  if the __full_name__ of the **customer** is not empty
  and the __date_of_birth__ of the **customer** is not null
  and the __date_of_birth__ of the **customer** is earlier than 2008-03-21.

customer.sanctions. A **customer** passes sanctions_check
  if the __sanctions_match__ of the **customer** is equal to false
  and the __pep_status__ of the **customer** is equal to false.

customer.document. A **customer** passes document_check
  if the __id_document_type__ of the **customer** is in ["passport", "drivers_license", "national_id"]
  and the __id_verified__ of the **customer** is equal to true.

Input schema

{
"properties": {
"customer": {
"properties": {
"full_name": {
"type": "string"
},
"date_of_birth": {
"type": "string"
},
"sanctions_match": {
"type": "boolean"
},
"pep_status": {
"type": "boolean"
},
"id_document_type": {
"type": "string"
},
"id_verified": {
"type": "boolean"
}
},
"required": [
"full_name",
"date_of_birth",
"sanctions_match",
"pep_status",
"id_document_type",
"id_verified"
],
"type": "object"
}
},
"required": [
"customer"
],
"title": "Customer Model",
"type": "object"
}

Test cases

Clean customer

Expect pass
{
"customer": {
"full_name": "Jane Smith",
"date_of_birth": "1988-04-12",
"sanctions_match": false,
"pep_status": false,
"id_document_type": "passport",
"id_verified": true
}
}

Sanctions match

Expect fail
{
"customer": {
"full_name": "John Doe",
"date_of_birth": "1975-09-01",
"sanctions_match": true,
"pep_status": false,
"id_document_type": "passport",
"id_verified": true
}
}

Integration

Execute this policy from your app using one of the official SDKs.

import { ExecutionClient } from "@policies2/sdk";

const client = new ExecutionClient({
	apiKey: process.env.POLICY_API_KEY!,
	transport: { kind: "rest", baseUrl: "https://api.policy2.net" },
});

const result = await client.executePolicy({
	id: "your-policy-id", // replace with your published policy ID
	reference: "base",
	data: {
		"customer": {
			"full_name": "Jane Smith",
			"date_of_birth": "1988-04-12",
			"sanctions_match": false,
			"pep_status": false,
			"id_document_type": "passport",
			"id_verified": true
		}
	},
});

if (result.result) {
	console.log("policy matched");
} else {
	console.log("policy did not match");
}

Ready to try this policy?

Open in editor