Skip to main content
This walkthrough takes a fake client, Test Client, from two documents to a risk assessment. It runs against the sandbox with the key you created in Test in the sandbox.

What you need

Use fake data only. These calls send a reference, so the files are filed on your own case instead.

The plan

  1. POST /v1/kyc/extract with the payslip.
  2. POST /v1/kyc/extract with the CIN.
  3. Build values from what was read plus what the client declared.
  4. POST /v1/kyc/assess with values and the documents entries unchanged.
Why two reads and not one: doc_type applies to every file in a call, so one document type per call. Why a CIN in a payslip walkthrough: with the default rules a verification needs a government photo ID among the documents (required:photo_id is critical). A payslip alone would be blocked. A payslip is supporting evidence, not identity. Why annual_income is typed in step 3: the reader is told never to estimate. A payslip shows one period’s pay, so annual_income comes back only if the payslip prints it. The walkthrough takes income from the client’s own application form, and the payslip supplies the employer and the occupation.

Complete code

Run it:
All three versions were run against a local stand-in server that returns canned /extract answers and runs Sahl’s verification and scoring code on the body they send, so the printed numbers below are what the engine computes for this input. The live reader will return the fields it sees on your files, which can differ.

Expected output

case is a real id in your answer. The order of the payslip fields can differ. In a production environment with the full sanctions list loaded, the screening line is the info check Sanctions screening — no matches; PEP not list-screened. If your environment only has the 30-name sample list, flags also shows screening and compliance risk becomes Medium (2 points).

What each step returned

1. Payslip

A payslip has no document checks, so checks is empty. It gives employer, occupation and the holder name. It is also what kyc.documents_read reports on.

2. National ID (CIN)

checks shows four passes: its key fields were read, it is not expired, the CIN number is well-formed (format:cin:, one or two letters then five to seven digits, for example BK123456) and the holder is an adult. The sample uses country MA and id_type National ID, which the engine accepts as they are.

4. Assessment

Shortened. The full answer repeats every check and the policy block. How to read it:
  • passed: true: no critical check failed.
  • The single flag is completeness at 61 percent: the walkthrough sent no address, phone or email, no PEP answer. A person should fill them in. The engine’s list of required data points is North American: it also asks for a province and a sin/ssn, which a Moroccan file cannot always give, so a Moroccan file stays below 100 percent. It also costs one risk point, so compliance risk is Low (the ceiling for Low is 1 point).
  • Risk profile 58 is the arithmetic in Risk assessment. Capacity 20 comes from income 84,000, liquid assets 20,000 and net worth 60,000, read here as MAD. The engine reads amounts as plain numbers against fixed bands that are not currency specific.

Try the failure paths

In the console

Open Cases, find client-0001 in sandbox. The documents, the checks and the verdict are filed there. The same calls are in Developers, Call log.

Next

Recipes

Five working use cases.

Go live

What to check before production.