NAV
cURL NodeJS

Open Services Platform

Welcome to the Preventor Open Services Platform! You can use our API to access Preventor API endpoints.

You can view code cURL examples in the dark area to the right, and you can switch the programming language of the examples with the tabs in the top right.

Onboarding based on Biometrics

In order to carry out the onboarding process with higher quality and greater certainty of customer identification, use the Onboarding process based on Biometrics.

BasedOnBiometrics

Steps

  1. Biometrics: Get token for every biometrics transaction Here.
  2. Biometrics: Create a new biometrics user Here.
  3. Biometrics: Upload Upload biometric images of the user Here.
  4. Biometrics: Enroll biometric user Here.
  5. Compliance: Get OAuth 2.0 token to be able to invoke the create user API Here.
  6. Compliance: Invoke the create user service with the information obtained from biometrics Here.

Authentication

OAuth 2.0

To authorize compliance platform, use this code

# With shell, you can just pass the correct header with each request
curl --location --request POST 'https://api.preventor.com/security/oauth/token' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--header 'x-api-key: <api-key>' \
--header 'Authorization: Basic <basic-auth-sign>'\
--header 'x-tenant: <tenant-name>' \
--header 'x-env: <env>' \
--header 'x-banknu: <bank-nu>' \
--data-urlencode 'grant_type=<grant-type>' \
--data-urlencode 'scope=<scope>' \
--data-urlencode 'client_id=<client-id>' \
--data-urlencode 'password=<password>' \
--data-urlencode 'username=<username-email>'
var request = require("request");
var options = {
  method: "POST",
  url: "https://api.preventor.com/security/oauth/token",
  headers: {
    "Content-Type": "application/x-www-form-urlencoded",
    "x-api-key": "<api-key>",
    Authorization: "Basic <basic-auth-sign>",
    "x-tenant": "<tenant-name>",
    "x-env": "<env>",
    "x-banknu": "<bank-nu>",
  },
  form: {
    grant_type: "<grant-type>",
    scope: "<scope>",
    client_id: "<client-id>",
    password: "<password>",
    username: "<username-email>",
  },
};
request(options, function (error, response) {
  if (error) throw new Error(error);
  console.log(response.body);
});

Make sure to replace all <variables> with your information.

Preventor uses API keys to allow access to the API.

Preventor expects for the API key to be included in all API requests to the server in a header that looks like the following:

Authorization: Basic ZWE1ODc0ZWQtMDg0Yi00NzY2LTk2NTYtMTk2ZDhlNmQ3MDY5Om51YmFuayQkMjAyMA==

Headers

Name Description
Authorization Username and password for basic authentication. (base64)
x-tenant Name of the tenant assigned by Preventor
x-env Schema name
x-banknu Entity Id
x-api-key Api Key of the company

Request Body

Name Description
grant_type Kind of authorization
scope Level of authorization
client_id ID of Request Client
password Password assigned by Preventor
username Username assigned by Preventor

Account

Create Account

curl --location --request POST 'https://api.preventor.com/onboarding/accountOnboarding' \
--header 'X-tenant: <tenant-name>' \
--header 'X-env: <env>' \
--header 'Authorization: Bearer <bearer-token>' \
--header 'X-banknu: <banknu>' \
--header 'X-lang: <lang>' \
--header 'X-tzone: <zone>' \
--header 'Content-Type: application/json' \
--header 'User-Agent: <user-agent>' \
--header 'X-Real-IP: <real-ip>' \
--header 'x-api-key: <api-key>' \
--data-raw '{
   "request_type": "A",
   "product_code": "10",
   "account_number": "PVTACC0000000001",
   "account_type": "AT_XAU",
   "id": "8adc1652-ad36-4234-846b-61d52cd1e2052",
   "date_opened": "2020-05-13",
   "date_closed": "2021-05-13",
   "initial_deposit_amount": "20.00",
   "initial_deposit_type": "DEP",
   "account_name": "Account XAU",
   "account_status": "1",
   "account_currency": "XAU",
   "account_balance": "0.00",
   "routing_number": "1000000101",
   "bank_name": "Bank name"
}'
var request = require("request");
var options = {
  method: "POST",
  url: "https://api.preventor.com/onboarding/accountOnboarding",
  headers: {
    "X-tenant": "<tenant-name>",
    "X-env": "<env>",
    Authorization: "Bearer <bearer-token>",
    "X-banknu": "<banknu>",
    "X-lang": "<lang>",
    "X-tzone": "<zone>",
    "Content-Type": "application/json",
    "User-Agent": "<user-agent>",
    "X-Real-IP": "<real-ip>",
    "x-api-key": "<api-key>",
  },
  body: JSON.stringify({
    request_type: "A",
    product_code: "10",
    account_number: "PVTACC0000000001",
    account_type: "AT_XAU",
    id: "8adc1652-ad36-4234-846b-61d52cd1e2052",
    date_opened: "2020-05-13",
    date_closed: "2021-05-13",
    initial_deposit_amount: "20.00",
    initial_deposit_type: "DEP",
    account_name: "Account XAU",
    account_status: "1",
    account_currency: "XAU",
    account_balance: "0.00",
    routing_number: "1000000101",
    bank_name: "Bank name",
  }),
};
request(options, function (error, response) {
  if (error) throw new Error(error);
  console.log(response.body);
});

This endpoint create an account.

HTTP Request

POST https://api.preventor.com/onboarding/accountOnboarding

Headers

Name Description
Authorization Bearer Token
x-tenant Name of the tenant assigned by Preventor
x-env Schema name
x-banknu Entity Id
x-lang Language
x-tzone Time Zone
x-api-key Api Key of the company
x-user-agent User Agent Navigator

Request Body

Name Description
request_type Type of action [“A”:”Add”, “U”:”Update”,”D”:”Delete”]
product_code Name of the tenant assigned by Preventor
account_number Account number
account_type Account type
id Identifier unique
date_opened Opening date
date_closed Closing date
initial_deposit_amount Initial deposit amount when creating the account
initial_deposit_type Initial deposit type when creating the account
account_name Account name
account_status Account status
account_currency Account currency
account_balance Amount account balance
routing_number Account routing number
bank_name Account bank name

Customer

Create Customer

curl --location --request POST 'https://api.preventor.com/onboarding/customerOnboarding' \
--header 'X-tenant: <tenant-name>' \
--header 'X-env: <env>' \
--header 'Authorization: Bearer <bearer-token>' \
--header 'X-banknu: <banknu>' \
--header 'X-lang: <lang>' \
--header 'X-tzone: <zone>' \
--header 'Content-Type: application/json' \
--header 'User-Agent: <user-agent>' \
--header 'X-Real-IP: <real-ip>' \
--header 'x-api-key: <api-key>' \
--data-raw '{
   "request_type": "A",
   "cif_status": "1",
   "customer_flag": "Y",
   "type_of_person": "P",
   "full_name": "JOHN SMITH BROWN",
   "first_name": "JOHN",
   "middle_name": "SMITH",
   "last_name": "BROWN",
   "id": "8adc1652-ad36-4234-846b-61d52cd1e2052",
   "cust_api_ref_id":"cu-xyz-abc-001",
   "addresses": [
       {
           "id": 1,
           "request_type": "A",
           "address_type": 1,
           "address_line1": "26 LINDA   MAR DR",
           "address_line2": "",
           "address_state":"FL",
           "address_city":"SAINT AUGUSTINE",
           "address_zipcode": "32080-4900",
           "address_country":"US",
           "transaction_id": "cu-xyz-abc-001",
           "address_primary_flag": "P"
       }
   ],
   "iddocuments":[
       {
           "id":1,
           "request_type":"A",
           "doc_type":6,
           "doc_number":"B207680293231",
           "doc_issued_country":"US",
           "doc_issued_date": "2018-01-26",
           "doc_expiration_date":"2026-09-27",
           "doc_primary_flag":"P",
           "transaction_id":"cu-xyz-abc-001"
       }
       ],
           "taxiddocuments":[
       {
           "id":1,
           "request_type":"A",
           "doc_type":6,
           "doc_number":"B207680293230",
           "doc_issued_country":"US",
           "doc_issued_date": "2018-01-26",
           "doc_expiration_date":"2026-09-27",
           "doc_primary_flag":"P",
           "transaction_id":"cu-xyz-abc-001"
       }
       ],
       "phones": [
       {
           "id": 1,
           "request_type": "A",
           "phone_number": "903923421",
           "phone_country_prefix": "US",
           "phone_primary_flag": "P",
           "phone_type": 2
       }
   ],
   "emails": [
       {
           "id": 1,
           "request_type": "A",
           "email": "[email protected]",
           "email_primary_flag": "P"
       }
   ]
}'
var request = require("request");
var options = {
  method: "POST",
  url: "https://api.preventor.com/onboarding/customerOnboarding",
  headers: {
    "X-tenant": "<tenant-name>",
    "X-env": "<env>",
    Authorization: "Bearer <bearer-token>",
    "X-banknu": "<banknu>",
    "X-lang": "<lang>",
    "X-tzone": "<zone>",
    "Content-Type": "application/json",
    "User-Agent": "<user-agent>",
    "X-Real-IP": "<real-ip>",
    "x-api-key": "<api-key>",
  },
  body: JSON.stringify({
    request_type: "A",
    cif_status: "1",
    customer_flag: "Y",
    type_of_person: "P",
    full_name: "JOHN SMITH BROWN",
    first_name: "JOHN",
    middle_name: "SMITH",
    last_name: "BROWN",
    id: "8adc1652-ad36-4234-846b-61d52cd1e2052",
    cust_api_ref_id: "cu-xyz-abc-001",
    addresses: [
      {
        id: 1,
        request_type: "A",
        address_type: 1,
        address_line1: "26 LINDA   MAR DR",
        address_line2: "",
        address_state: "FL",
        address_city: "SAINT AUGUSTINE",
        address_zipcode: "32080-4900",
        address_country: "US",
        transaction_id: "cu-xyz-abc-001",
        address_primary_flag: "P",
      },
    ],
    iddocuments: [
      {
        id: 1,
        request_type: "A",
        doc_type: 6,
        doc_number: "B207680293231",
        doc_issued_country: "US",
        doc_issued_date: "2018-01-26",
        doc_expiration_date: "2026-09-27",
        doc_primary_flag: "P",
        transaction_id: "cu-xyz-abc-001",
      },
    ],
    taxiddocuments: [
      {
        id: 1,
        request_type: "A",
        doc_type: 6,
        doc_number: "B207680293230",
        doc_issued_country: "US",
        doc_issued_date: "2018-01-26",
        doc_expiration_date: "2026-09-27",
        doc_primary_flag: "P",
        transaction_id: "cu-xyz-abc-001",
      },
    ],
    phones: [
      {
        id: 1,
        request_type: "A",
        phone_number: "903923421",
        phone_country_prefix: "US",
        phone_primary_flag: "P",
        phone_type: 2,
      },
    ],
    emails: [
      {
        id: 1,
        request_type: "A",
        email: "[email protected]",
        email_primary_flag: "P",
      },
    ],
  }),
};
request(options, function (error, response) {
  if (error) throw new Error(error);
  console.log(response.body);
});

This endpoint create a customer.

HTTP Request

POST https://api.preventor.com/onboarding/customerOnboarding

Headers

Name Description
Authorization Bearer Token
x-tenant Name of the tenant assigned by Preventor
x-env Schema name
x-banknu Entity Id
x-lang Language
x-tzone Time Zone
x-api-key Api Key of the company
x-user-agent User Agent Navigator

Request Body

Name Description
request_type Type of action [“A”:”Add”, “U”:”Update”,”D”:”Delete”]
cif_status Customer status
customer_flag Customer flag YES or NOT
type_of_person Customer type
full_name Customer full name
first_name Customer first name
middle_name Customer middle name
last_name Customer last name
id Customer identifier
cust_api_ref_id Customer ticket reference from authentic id
addresses Customer addresses
iddocuments Customer documents
taxiddocuments Customer tax documents
phones Customer phones
emails Customer emails

Update Customer

curl --location --request POST 'https://api.preventor.com/onboarding/customerMaintenance' \
--header 'X-tenant: <tenant-name>' \
--header 'X-env: <env>' \
--header 'Authorization: Bearer <bearer-token>' \
--header 'X-banknu: <banknu>' \
--header 'X-lang: <lang>' \
--header 'X-tzone: <zone>' \
--header 'Content-Type: application/json' \
--header 'User-Agent: <user-agent>' \
--header 'X-Real-IP: <real-ip>' \
--header 'x-api-key: <api-key>' \
--data-raw '{
   "request_type": "U",
   "id": "8adc1652-ad36-4234-846b-61d52cd1e2052",
   "first_name": "JONATHAN"
}'
var request = require("request");
var options = {
  method: "POST",
  url: "https://api.preventor.com/onboarding/customerMaintenance",
  headers: {
    "X-tenant": "<tenant-name>",
    "X-env": "<env>",
    Authorization: "Bearer <bearer-token>",
    "X-banknu": "<banknu>",
    "X-lang": "<lang>",
    "X-tzone": "<zone>",
    "Content-Type": "application/json",
    "User-Agent": "<user-agent>",
    "X-Real-IP": "<real-ip>",
    "x-api-key": "<api-key>",
  },
  body: JSON.stringify({
    request_type: "U",
    id: "8adc1652-ad36-4234-846b-61d52cd1e2052",
    first_name: "JONATHAN",
  }),
};
request(options, function (error, response) {
  if (error) throw new Error(error);
  console.log(response.body);
});

This endpoint update a customer.

HTTP Request

POST https://api.preventor.com/onboarding/customerMaintenance

Headers

Name Description
Authorization Bearer Token
x-tenant Name of the tenant assigned by Preventor
x-env Schema name
x-banknu Entity Id
x-lang Language
x-tzone Time Zone
x-api-key Api Key of the company
x-user-agent User Agent Navigator

Request Body

Name Description
request_type Type of action [“A”:”Add”, “U”:”Update”,”D”:”Delete”]
cif_status Customer status
customer_flag Customer flag YES or NOT
type_of_person Customer type
full_name Customer full name
first_name Customer first name
middle_name Customer middle name
last_name Customer last name
id Customer identifier
cust_api_ref_id Customer ticket reference from authentic id
addresses Customer addresses
iddocuments Customer documents
taxiddocuments Customer tax documents
phones Customer phones
emails Customer emails

Get Customer

curl --location --request POST 'https://api.preventor.com/onboarding/getCustomer' \
--header 'X-tenant: <tenant-name>' \
--header 'X-env: <env>' \
--header 'Authorization: Bearer <bearer-token>' \
--header 'X-banknu: <banknu>' \
--header 'X-lang: <lang>' \
--header 'X-tzone: <zone>' \
--header 'Content-Type: application/json' \
--header 'User-Agent: <user-agent>' \
--header 'X-Real-IP: <real-ip>' \
--header 'x-api-key: <api-key>' \
--form 'cifCod=8adc1652-ad36-4234-846b-61d52cd1e2052'
var request = require("request");
var options = {
  method: "POST",
  url: "https://api.preventor.com/onboarding/getCustomer",
  headers: {
    "X-tenant": "<tenant-name>",
    "X-env": "<env>",
    Authorization: "Bearer <bearer-token>",
    "X-banknu": "<banknu>",
    "X-lang": "<lang>",
    "X-tzone": "<zone>",
    "Content-Type": "application/json",
    "User-Agent": "<user-agent>",
    "X-Real-IP": "<real-ip>",
    "x-api-key": "<api-key>",
  },
  formData: {
    cifCod: "8adc1652-ad36-4234-846b-61d52cd1e2052",
  },
};
request(options, function (error, response) {
  if (error) throw new Error(error);
  console.log(response.body);
});

This endpoint get a customer.

HTTP Request

POST https://api.preventor.com/onboarding/getCustomer

Headers

Name Description
Authorization Bearer Token
x-tenant Name of the tenant assigned by Preventor
x-env Schema name
x-banknu Entity Id
x-lang Language
x-tzone Time Zone
x-api-key Api Key of the company
x-user-agent User Agent Navigator

Request Body

Name Description
cifCod Customer ID

Transaction

Register Monetary Transaction

curl --location --request POST 'https://api.preventor.com/onboarding/registerMonetaryTransaction' \
--header 'X-tenant: <tenant-name>' \
--header 'X-env: <env>' \
--header 'Authorization: Bearer <bearer-token>' \
--header 'X-banknu: <banknu>' \
--header 'X-lang: <lang>' \
--header 'X-tzone: <zone>' \
--header 'Content-Type: application/json' \
--header 'User-Agent: <user-agent>' \
--header 'X-Real-IP: <real-ip>' \
--header 'x-api-key: <api-key>' \
--data-raw '{
   "id":"8adc1652-ad36-4234-846b-61d52cd1e2052",
   "routing_number":"10000014",
   "product_code":"10",
   "account_number":"PVTACC100002003400",
   "account_balance_after_posting":"50.3336",
   "account_balance_hold":"0.00",
   "account_balance_available":"50.3336",
   "account_balance_aggregate":"0.00",
   "trans_posting_date":"2020-05-15T12:00:00.000Z",
   "trans_effective_date":"2020-05-15T12:00:00.000Z",
   "trans_code":"TT_001",
   "trans_amount":"150803.247745453",
   "trans_currency":"USD",
   "trans_exchange_rate":"0.000166885",
   "account_trans_amount": "25.1668",
   "trans_base_rate":"0.2652",
   "trans_base_amount": "40000.00",
   "customer_trans_id":"100-203030253453-0-332",
   "trans_reference":"ref0XAU1",
   "trans_hash":"hash-ab-sda-12123-125",
   "trans_ach_id":"ach-001",
   "trans_description":"Transaction PVTACC100002003400 deposit 40000 USD",
   "trans_cash":"0.00",
   "trans_cash_back":"0.00",
   "trans_no_cash":"0.00"
}'
var request = require("request");
var options = {
  method: "POST",
  url: "https://api.preventor.com/onboarding/registerMonetaryTransaction",
  headers: {
    "X-tenant": "<tenant-name>",
    "X-env": "<env>",
    Authorization: "Bearer <bearer-token>",
    "X-banknu": "<banknu>",
    "X-lang": "<lang>",
    "X-tzone": "<zone>",
    "Content-Type": "application/json",
    "User-Agent": "<user-agent>",
    "X-Real-IP": "<real-ip>",
    "x-api-key": "<api-key>",
  },
  body: JSON.stringify({
    id: "8adc1652-ad36-4234-846b-61d52cd1e2052",
    routing_number: "10000014",
    product_code: "10",
    account_number: "PVTACC100002003400",
    account_balance_after_posting: "50.3336",
    account_balance_hold: "0.00",
    account_balance_available: "50.3336",
    account_balance_aggregate: "0.00",
    trans_posting_date: "2020-05-15T12:00:00.000Z",
    trans_effective_date: "2020-05-15T12:00:00.000Z",
    trans_code: "TT_001",
    trans_amount: "150803.247745453",
    trans_currency: "USD",
    trans_exchange_rate: "0.000166885",
    account_trans_amount: "25.1668",
    trans_base_rate: "0.2652",
    trans_base_amount: "40000.00",
    customer_trans_id: "100-203030253453-0-332",
    trans_reference: "ref0XAU1",
    trans_hash: "hash-ab-sda-12123-125",
    trans_ach_id: "ach-001",
    trans_description: "Transaction PVTACC100002003400 deposit 40000 USD",
    trans_cash: "0.00",
    trans_cash_back: "0.00",
    trans_no_cash: "0.00",
  }),
};
request(options, function (error, response) {
  if (error) throw new Error(error);
  console.log(response.body);
});

This endpoint register a transaction monetary to specific account.

HTTP Request

POST https://api.preventor.com/onboarding/registerMonetaryTransaction

Headers

Name Description
Authorization Bearer Token
x-tenant Name of the tenant assigned by Preventor
x-env Schema name
x-banknu Entity Id
x-lang Language
x-tzone Time Zone
x-api-key Api Key of the company
x-user-agent User Agent Navigator

Request Body

Name Description
id Transaction identifier
routing_number Transaction routing number
product_code Financial Product code
account_number Account number
account_balance_after_posting Amount account balance after posting
account_balance_hold Amount account balance hold
account_balance_available Amount account balance available
account_balance_aggregate Amount account balance aggregate
trans_posting_date Date transaction posting date
trans_effective_date Date transaction effective date
trans_code Transaction Code
trans_amount Transaction Amount
trans_currency Transaction Currency
trans_exchange_rate Rate transaction exchange
account_trans_amount Amount account transaction
trans_base_rate Rate transaction base
trans_base_amount Amount transaction base
customer_trans_id Customer transaction identifier
trans_reference Transaction reference number
trans_hash Transaction hash
trans_ach_id Transaction achive identifier
trans_description Transaction description
trans_cash Transaction cash
trans_cash_back Transaction cash back
trans_no_cash Transaction no cash

Biometrics Framework

The Preventor Biometrics Framework API uses liveness mechanisms, document reader, photo match to carry out our Onboarding and Authentication processes.

We support 8,880 types of documents, 200 countries and 88 languages.

Architecture

Bio Authentication

To authorize, use this code: You

# With shell, you can just pass the correct header with each request
curl -u "<api-key>:<api-secret>" --location
--request POST 'https://api.preventor.id/v1/auth/token' \
--header 'x-api-key: <api-key>' \
--header 'x-tenant: <tenant-name>' \
--header 'x-ip: <request-client-ip>' \
--header 'x-env: <request-tenant-env>' \
--header 'x-banknu: <request-tenant-banknu>' \
--header 'Content-Type: application/json' \
--data-raw '{
    "transactionType": "ONBOARDING"
}'
var request = require("request");
var options = {
  method: "POST",
  url: "https://api.preventor.id/v1/auth/token",
  headers: {
    "Authorization": "Basic " + new Buffer("<api-key>" + ":" + "<api-secret>").toString("base64")),
    "x-api-key": "<api-key>",
    "x-ip": "<client-ip>",
    "x-tenant": "<tenant-name>",
    "x-env": "<request-tenant-env>",
    "x-banknu": "<request-tenant-banknu>",
    "Content-Type": "application/json",
  },
  body: JSON.stringify({ transactionType: "ONBOARDING" }),
};
request(options, function (error, response) {
  if (error) throw new Error(error);
  console.log(response.body);
});

Make sure to replace all <variables> with your information.

Preventor uses API keys to allow access to the API.

Preventor expects for the API key to be included in all API requests to the server in a header that looks like the following:

Authorization: Basic ZWE1ODc0ZWQtMDg0Yi00NzY2LTk2NTYtMTk2ZDhlNmQ3MDY5Om51YmFuayQkMjAyMA==

The above command returns JSON structured like this:

{
  "token": "<genetared-token>"
}

This endpoint retrieve a token to run one process at a time.

HTTP Request

POST https://api.preventor.id/v1/auth/token

Headers

Name Description
Authorization Basic username and password base64
x-api-key Api Key of the company
x-tenant Name of the tenant assigned by Preventor
x-env Schema name
x-banknu Entity Id

Request Body

Name Description
transactionType Type of transaction [“ONBOARDING” , “AUTHENTICATION”]
documentType Type of document [ "ID_CARD", "PASSPORT", "DRIVER_LICENSE", "VISA"]

Create Bio User

To create bio user, use this code:

curl --location
--request POST 'https://api.preventor.id/v1/workflow/enroll/user' \
--header 'x-api-key: <api-key>' \
--header 'Authorization: Bearer <your-bearer-token>' \
--header 'x-tenant: <tenant-name>' \
--header 'x-ip: <request-client-ip>' \
--header 'x-env: <request-tenant-env>' \
--header 'x-banknu: <request-tenant-banknu>' \
--header 'Content-Type: application/json' \
var request = require('request');
var options = {
  'method': 'POST',
  'url': 'https://api.preventor.id/v1/workflow/enroll/user',
  'headers': {
    "x-api-key": "<api-key>",
    'Authorization': 'Bearer <your-bearer-token>'
    "x-ip": "<client-ip>",
    "x-tenant": "<tenant-name>",
    "x-env": "<request-tenant-env>",
    "x-banknu": "<request-tenant-banknu>",
  }
};
request(options, function (error, response) {
  if (error) throw new Error(error);
  console.log(response.body);
});

Make sure to replace all <variables> with your information.

The above command returns JSON structured like this:

{
  "userId": "4fc897ce-7879-47e4-9e5c-5de91ded4dea",
  "create": "2020-09-29T16:02:48.109Z"
}

This endpoint retrieve a new bio user

HTTP Request

POST https://api.preventor.id/v1/workflow/enroll/user

Headers

Name Description
Authorization Basic username and password base64
x-api-key Api Key of the company
x-tenant Name of the tenant assigned by Preventor
x-env Schema name
x-banknu Entity Id

Upload Bio Files

To create bio user, use this code:

curl --location
--request POST 'https://api.preventor.id/v1/workflow/enroll/user/<user-id>/upload' \
--header 'x-api-key: <api-key>' \
--header 'Authorization: Bearer <your-bearer-token>' \
--header 'x-tenant: <tenant-name>' \
--header 'x-ip: <request-client-ip>' \
--header 'x-env: <request-tenant-env>' \
--header 'x-banknu: <request-tenant-banknu>' \
--header 'Content-Type: application/json' \
--data-raw '{
  "portraits": {
    "picture1": "<base-64-picture>",
    "picture2": "<base-64-picture>"
  },
  "documents": {
    "picture1": "<base-64-picture>",
    "picture2": "<base-64-picture>"
  }
}'
var request = require('request');
var options = {
  'method': 'POST',
  'url': 'https://api.preventor.id/v1/workflow/enroll/user/<user-id>/upload',
  'headers': {
    "x-api-key": "<api-key>",
    'Authorization': 'Bearer <your-bearer-token>'
    "x-ip": "<client-ip>",
    "x-tenant": "<tenant-name>",
    "x-env": "<request-tenant-env>",
    "x-banknu": "<request-tenant-banknu>",
  },
  'body': JSON.stringify({
    "portraits": {
      "picture1": "<base-64-picture>",
      "picture2": "<base-64-picture>"
    },
    "documents": {
        "picture1": "<base-64-picture>",
        "picture2": "<base-64-picture>"
    }
  })
};
request(options, function (error, response) {
  if (error) throw new Error(error);
  console.log(response.body);
});

Make sure to replace all <variables> with your information.

The above command returns JSON structured like this:

{
  "ticket": "bf47fb71-81ac-4625-887d-ef37e078038a"
}

This endpoint retrieve a ticket of userId to run the enroll or verify

HTTP Request

POST https://api.preventor.id/v1/workflow/enroll/user/<user-id>/upload

Headers

Name Description
Authorization Basic username and password base64
x-api-key Api Key of the company
x-tenant Name of the tenant assigned by Preventor
x-env Schema name
x-banknu Entity Id

Request Params

Name Description
documents Pictures of client document
portraits Selfies of client

Media File Formating

For better accuracy, please do not process or alter original files before sending them, and make sure the bitrate across channels is the same. Visit opus-codec.org for more information about bitrates.

Note: Very high quality video increases the processing time of API calls.

Photo

Photo file should have a base64 format with mime type. The following image formats are allowed.

Format Max file
JPG 1MB
JPEG 1MB

Voice

Audio files should have a fixed length of 5 seconds, with the user beginning to speak after 500 milliseconds. This is used to capture background noise from the beginning and end of the audio clip that is utilized for noise profiling. We recommend PCM or lossless codecs such as FLAC.

Do not trim the audio before sending. Our engines need at least 500 milliseconds of padding to work their magic.

Sending an audio file longer than 5 seconds will result in the response code SRNR.

Bio Enroll

curl --location
--request GET 'https://api.preventor.id/v1/workflow/enroll/user/:userId/ticket/:ticket' \
--header 'x-api-key: <api-key>' \
--header 'Authorization: Bearer <your-bearer-token>' \
--header 'x-tenant: <tenant-name>' \
--header 'x-ip: <request-client-ip>' \
--header 'x-env: <request-tenant-env>' \
--header 'x-banknu: <request-tenant-banknu>' \
--header 'Content-Type: application/json' \
--data-raw '{
  "userId": "<user-id>",
  "ticket": "<ticket-id>"
}'
var request = require("request");
var options = {
  method: "GET",
  url:
    "https://api.preventor.id/v1/workflow/enroll/user/:userId/ticket/:ticket",
  headers: {
    "x-api-key": "<api-key>",
    Authorization: "Bearer <your-bearer-token>",
    "x-ip": "<request-client-ip>",
    "x-tenant": "<tenant-name>",
    "x-env": "<request-tenant-env>",
    "x-banknu": "<request-tenant-banknu>",
    "Content-Type": "application/json",
  },
  body: JSON.stringify({ userId: "<user-id>", ticket: "<ticket-id>" }),
};
request(options, function (error, response) {
  if (error) throw new Error(error);
  console.log(response.body);
});

Make sure to replace all <variables> with your information.

The above command returns JSON structured like this:

{
  "photoVerify": true,
  "liveness": true,
  "enroll": true,
  "documentReader": {
    "generalInfo": {
      "documentName": "Peru - Id Card #3 Side B & Peru - Id Card #3",
      "countryName": "Peru",
      "hasMrz": true,
      "hasBarcode": true,
      "hasVisual": true,
      "hasMrzVisual": true,
      "hasMrzBarcode": true,
      "hasVisualBarcode": true
    },
    "fields": [
      {
        "fieldType": "Document class code",
        "fieldTypeCode": 0,
        "mrzValue": "I",
        "mrzBarcodeStatus": "disabled",
        "mrzVisualStatus": "disabled",
        "visualBarcodeStatus": "disabled",
        "lexicalValidity": "valid"
      },
      {
        "fieldType": "Issuing state code",
        "fieldTypeCode": 1,
        "mrzValue": "PER",
        "mrzBarcodeStatus": "disabled",
        "mrzVisualStatus": "disabled",
        "visualBarcodeStatus": "disabled",
        "lexicalValidity": "valid"
      },
      {
        "fieldType": "Document #",
        "fieldTypeCode": 2,
        "mrzValue": "70585549",
        "barcodeValue": "70585549",
        "visualValue": "705855493",
        "mrzBarcodeStatus": "compared",
        "mrzVisualStatus": "compared",
        "visualBarcodeStatus": "compared",
        "lexicalValidity": "valid"
      },
      {
        "fieldType": "Date of expiry",
        "fieldTypeCode": 3,
        "mrzValue": "2023-03-24",
        "mrzBarcodeStatus": "disabled",
        "mrzVisualStatus": "disabled",
        "visualBarcodeStatus": "disabled",
        "lexicalValidity": "valid"
      },
      {
        "fieldType": "Date of birth",
        "fieldTypeCode": 5,
        "mrzValue": "1993-03-27",
        "mrzBarcodeStatus": "disabled",
        "mrzVisualStatus": "disabled",
        "visualBarcodeStatus": "disabled",
        "lexicalValidity": "valid"
      },
      {
        "fieldType": "Surname (10250)",
        "fieldTypeCode": 8,
        "visualValue": "TEST",
        "mrzBarcodeStatus": "disabled",
        "mrzVisualStatus": "disabled",
        "visualBarcodeStatus": "disabled",
        "lexicalValidity": "disabled"
      },
      {
        "fieldType": "Surname",
        "fieldTypeCode": 8,
        "mrzValue": "TEST",
        "visualValue": "TEST",
        "mrzBarcodeStatus": "disabled",
        "mrzVisualStatus": "compared",
        "visualBarcodeStatus": "disabled",
        "lexicalValidity": "valid"
      },
      {
        "fieldType": "Given name (10250)",
        "fieldTypeCode": 9,
        "visualValue": "TEST",
        "mrzBarcodeStatus": "disabled",
        "mrzVisualStatus": "disabled",
        "visualBarcodeStatus": "disabled",
        "lexicalValidity": "disabled"
      },
      {
        "fieldType": "Given name",
        "fieldTypeCode": 9,
        "mrzValue": "TEST",
        "visualValue": "TEST",
        "mrzBarcodeStatus": "disabled",
        "mrzVisualStatus": "compared",
        "visualBarcodeStatus": "disabled",
        "lexicalValidity": "valid"
      },
      {
        "fieldType": "Nationality",
        "fieldTypeCode": 11,
        "mrzValue": "Peru",
        "mrzBarcodeStatus": "disabled",
        "mrzVisualStatus": "disabled",
        "visualBarcodeStatus": "disabled",
        "lexicalValidity": "valid"
      },
      {
        "fieldType": "Sex (10250)",
        "fieldTypeCode": 12,
        "visualValue": "MASCULINO",
        "mrzBarcodeStatus": "disabled",
        "mrzVisualStatus": "disabled",
        "visualBarcodeStatus": "disabled",
        "lexicalValidity": "disabled"
      },
      {
        "fieldType": "Sex",
        "fieldTypeCode": 12,
        "mrzValue": "M",
        "visualValue": "M",
        "mrzBarcodeStatus": "disabled",
        "mrzVisualStatus": "compared",
        "visualBarcodeStatus": "disabled",
        "lexicalValidity": "valid"
      },
      {
        "fieldType": "Address (10250)",
        "fieldTypeCode": 17,
        "visualValue": "J.A. RIBEYRO 184 DPTO. 503",
        "mrzBarcodeStatus": "disabled",
        "mrzVisualStatus": "disabled",
        "visualBarcodeStatus": "disabled",
        "lexicalValidity": "disabled"
      },
      {
        "fieldType": "Donor",
        "fieldTypeCode": 18,
        "visualValue": "SS",
        "mrzBarcodeStatus": "disabled",
        "mrzVisualStatus": "disabled",
        "visualBarcodeStatus": "disabled",
        "lexicalValidity": "disabled"
      },
      {
        "fieldType": "Surname and given names (10250)",
        "fieldTypeCode": 25,
        "visualValue": "TEST",
        "mrzBarcodeStatus": "disabled",
        "mrzVisualStatus": "disabled",
        "visualBarcodeStatus": "disabled",
        "lexicalValidity": "disabled"
      },
      {
        "fieldType": "Surname and given names",
        "fieldTypeCode": 25,
        "mrzValue": "TEST",
        "visualValue": "TEST",
        "mrzBarcodeStatus": "disabled",
        "mrzVisualStatus": "compared",
        "visualBarcodeStatus": "disabled",
        "lexicalValidity": "valid"
      },
      {
        "fieldType": "Nationality code",
        "fieldTypeCode": 26,
        "mrzValue": "PER",
        "mrzBarcodeStatus": "disabled",
        "mrzVisualStatus": "disabled",
        "visualBarcodeStatus": "disabled",
        "lexicalValidity": "valid"
      },
      {
        "fieldType": "MRZ Type",
        "fieldTypeCode": 35,
        "mrzValue": "ID-1",
        "mrzBarcodeStatus": "disabled",
        "mrzVisualStatus": "disabled",
        "visualBarcodeStatus": "disabled",
        "lexicalValidity": "disabled"
      },
      {
        "fieldType": "Issuing state",
        "fieldTypeCode": 38,
        "mrzValue": "Peru",
        "mrzBarcodeStatus": "disabled",
        "mrzVisualStatus": "disabled",
        "visualBarcodeStatus": "disabled",
        "lexicalValidity": "valid"
      },
      {
        "fieldType": "MRZ lines",
        "fieldTypeCode": 51,
        "mrzValue": "I<PER21585549<5<<<<<<<<<<<<<<<^9303276M2303244PER<<<<<<<<<<<4^TEST<<TEST<TEST<<<<<",
        "mrzBarcodeStatus": "disabled",
        "mrzVisualStatus": "disabled",
        "visualBarcodeStatus": "disabled",
        "lexicalValidity": "valid"
      },
      {
        "fieldType": "Area (10250)",
        "fieldTypeCode": 64,
        "visualValue": "LIMA",
        "mrzBarcodeStatus": "disabled",
        "mrzVisualStatus": "disabled",
        "visualBarcodeStatus": "disabled",
        "lexicalValidity": "disabled"
      },
      {
        "fieldType": "Street (10250)",
        "fieldTypeCode": 76,
        "visualValue": "J.A. RIBEYRO 184 DPTO. 503",
        "mrzBarcodeStatus": "disabled",
        "mrzVisualStatus": "disabled",
        "visualBarcodeStatus": "disabled",
        "lexicalValidity": "disabled"
      },
      {
        "fieldType": "Check digit for document number",
        "fieldTypeCode": 80,
        "mrzValue": "5",
        "mrzBarcodeStatus": "disabled",
        "mrzVisualStatus": "disabled",
        "visualBarcodeStatus": "disabled",
        "lexicalValidity": "valid"
      },
      {
        "fieldType": "Check digit for date of birth",
        "fieldTypeCode": 81,
        "mrzValue": "6",
        "mrzBarcodeStatus": "disabled",
        "mrzVisualStatus": "disabled",
        "visualBarcodeStatus": "disabled",
        "lexicalValidity": "valid"
      },
      {
        "fieldType": "Check digit for date of expiry",
        "fieldTypeCode": 82,
        "mrzValue": "4",
        "mrzBarcodeStatus": "disabled",
        "mrzVisualStatus": "disabled",
        "visualBarcodeStatus": "disabled",
        "lexicalValidity": "valid"
      },
      {
        "fieldType": "Final check digit",
        "fieldTypeCode": 84,
        "mrzValue": "4",
        "mrzBarcodeStatus": "disabled",
        "mrzVisualStatus": "disabled",
        "visualBarcodeStatus": "disabled",
        "lexicalValidity": "valid"
      },
      {
        "fieldType": "Second surname (10250)",
        "fieldTypeCode": 145,
        "visualValue": "TEST",
        "mrzBarcodeStatus": "disabled",
        "mrzVisualStatus": "disabled",
        "visualBarcodeStatus": "disabled",
        "lexicalValidity": "disabled"
      },
      {
        "fieldType": "Second surname",
        "fieldTypeCode": 145,
        "visualValue": "TEST",
        "mrzBarcodeStatus": "disabled",
        "mrzVisualStatus": "disabled",
        "visualBarcodeStatus": "disabled",
        "lexicalValidity": "disabled"
      },
      {
        "fieldType": "Age",
        "fieldTypeCode": 185,
        "mrzValue": "27",
        "mrzBarcodeStatus": "disabled",
        "mrzVisualStatus": "disabled",
        "visualBarcodeStatus": "disabled",
        "lexicalValidity": "valid"
      },
      {
        "fieldType": "Location (10250)",
        "fieldTypeCode": 189,
        "visualValue": "JESUS MARIA",
        "mrzBarcodeStatus": "disabled",
        "mrzVisualStatus": "disabled",
        "visualBarcodeStatus": "disabled",
        "lexicalValidity": "disabled"
      },
      {
        "fieldType": "Department (10250)",
        "fieldTypeCode": 277,
        "visualValue": "LIMA",
        "mrzBarcodeStatus": "disabled",
        "mrzVisualStatus": "disabled",
        "visualBarcodeStatus": "disabled",
        "lexicalValidity": "disabled"
      },
      {
        "fieldType": "Months to expire",
        "fieldTypeCode": 364,
        "mrzValue": "28",
        "mrzBarcodeStatus": "disabled",
        "mrzVisualStatus": "disabled",
        "visualBarcodeStatus": "disabled",
        "lexicalValidity": "valid"
      }
    ],
    "graphics": {
      "imageType": "Portrait",
      "image": "<data:image/jpeg;base64,>",
      "format": ".jpg"
    }
  }
}

This endpoint retrieve the results of enroll process.

HTTP Request

GET https://api.preventor.id/v1/workflow/enroll/user/:userId/ticket/:ticket

Headers

Name Description
Authorization Basic username and password base64
x-api-key Api Key of the company
x-tenant Name of the tenant assigned by Preventor
x-env Schema name
x-banknu Entity Id

Request Body

Parameter Type of Description
userId String User Id created
ticket String Ticket of upload process

Errors

The Preventor API uses the following error codes:

Error Code Meaning
400 Bad Request -- Your request is invalid.
401 Unauthorized -- Your API key is wrong or your token is expired.
403 Forbidden -- The request don't have correct headers.
404 Not Found -- The specified kitten could not be found.
405 Method Not Allowed -- You tried to access a kitten with an invalid method.
406 Not Acceptable -- You requested a format that isn't json.
429 Too Many Requests -- You're requesting too many kittens! Slow down!
500 Internal Server Error -- We had a problem with our server. Try again later.
503 Service Unavailable -- We're temporarily offline for maintenance. Please try again later.