🇵🇪 Overview
In this section, you will find information on the input data required for the profile of a person in Peru, the reports available, the report settings and how to perform queries to create a person, get a person’s status and its reports details.
Profile
Section titled “Profile”Input field | Description | Example |
---|---|---|
document_id | The Document ID Number for Peru (check document_id_type field below). | 123456789 |
document_id_type | Accepted values are national_id for the Documento Nacional de Identidad (DNI) or Tarjeta de Identidad and foreigner_card for Carne de Extranjería, Carne de Solicitante or Permiso Temporal de Permanencia. The option found is returned in the details as document_id_type_name . Defaults to national_id . | national_id |
city_locode | The UN LOCODE of the city where the person is located (or another city according to your needs to direct the BGC process). Always required. | PE LIM |
dob | ISO 8601 representation of the date the person was born. | 1990-05-03 |
full_name | Full Name of the person to be checked. Required for most_wanted , police_arrest , boletin_judicial and sanctions reports. | JUAN MIGUEL DOE |
labor_certificate_id | Number of the Labor Certificate (Número del Certificado Único Laboral). Required only for labor_certificate report. | 0123456789123 |
labor_certificate_type | Type of Labor Certificate. Accepted values are certiadulto and certijoven . Required only for labor_certificate report. | certiadulto |
ruc | The RUC (Registro Único de Contribuyentes) for the company requesting the Labor Certificate information. Required only for labor_certificate report. | 9999999999 |
ptp | For the foreigner_card_status report, it indicates if the input value is a Pemiso Temporal de Permanencia . Either True or False . Required only for foreigner_card_status report. | False |
request_code | The request code for a Criminal Records Certificate (Código de Consulta del Certificado de Antecedentes Penales). Required only for justice_certificate report. | VOED83219812K |
Available reports
Section titled “Available reports”Report name | Description | Source/database |
---|---|---|
dni_status | Validates a DNI (Documento Nacional de Identidad) and retrieves personal data associated to it. | Registro Nacional de Identificación y Estado Civil (RENIEC) |
foreigner_card_status | Validates a foreigner_card (Carne de Extranjería or Permiso Temporal de Permanencia) and retrieves personal data associated to it. | Superintendencia Nacional de Migraciones del Perú |
license_status | Checks a Driver’s License status and retrieves the data associated to it. | Ministerio de Transporte y Comunicaciones |
drunk_driving | Checks a person’s driving history for drunk driving occurrences. | Ministerio de Transporte y Comunicaciones |
dangerous_driver | Checks a person’s driving history for dangerous driving occurrences. | Ministerio de Transporte y Comunicaciones |
labor_certificate | Given a DNI and a certificate number only, it retrieves all the data from the certificate (address, criminal records, labor and education history, etc) and builds decision making over the data found. | Ministerio de Trabajo y Promoción del Empleo |
justice_certificate | Given a request_code from a certificate previously issued, it retrieves the data from the certificate. | Poder Judicial del Perú |
most_wanted | Checks for occurences in the most wanted database of the Peruvian government. | Programa de Recompensas - Ministerio del Interior del Perú |
police_arrest | Checks database with police reports of arrests for matches to the person’s data. | Police Arrests Database (internal) |
boletin_judicial | Checks court journals (Boletin Judicial) from Peru Justice System (Poder Judicial del Perú). | Poder Judicial del Perú |
sanctions | Checks sanctions reports from UN, OFAC, EEAS and World Bank. | UN, OFAC, EEAS, and World Bank. |
Example requests
Section titled “Example requests”Create a Person
Section titled “Create a Person”To create a person, copy and paste the following command or code, replacing the dummy data with the person’s data you want to use and the YOUR_API_KEY string with your API Key, respectively:
curl --request POST \ --url https://api.emptor.io/v3/pe/persons/ \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --header 'X-Api-Key: YOUR_API_KEY' \ --data '{"reports":{"dni_status":"enabled","license_status":"enabled","drunk_driving":"enabled","dangerous_driver":"enabled","labor_certificate":"enabled","justice_certificate":"enabled","most_wanted":"enabled","police_arrest":"enabled","boletin_judicial":"enabled","sanctions":"enabled"},"city_locode":"PE LIM","document_id":"123456789","document_id_type":"national_id","dob":"1990-05-03","full_name":"JUAN MIGUEL DOE","labor_certificate_id":"0123456789123","labor_certificate_type":"certiadulto","request_code":"VOED83219812K","ruc":"9999999999"}'
const fetch = require('node-fetch');
let url = 'https://api.emptor.io/v3/pe/persons/';
let options = { method: 'POST', headers: { Accept: 'application/json', 'Content-Type': 'application/json', 'X-Api-Key': 'YOUR_API_KEY' }, body: JSON.stringify({ reports: { dni_status: 'enabled', license_status: 'enabled', drunk_driving: 'enabled', dangerous_driver: 'enabled', labor_certificate: 'enabled', justice_certificate: 'enabled', most_wanted: 'enabled', police_arrest: 'enabled', boletin_judicial: 'enabled', sanctions: 'enabled' }, city_locode: 'PE LIM', document_id: '123456789', document_id_type: 'national_id', dob: '1990-05-03', full_name: 'JUAN MIGUEL DOE', labor_certificate_id: '0123456789123', labor_certificate_type: 'certiadulto', request_code: 'VOED83219812K', ruc: '9999999999' })};
fetch(url, options) .then(res => res.json()) .then(json => console.log(json)) .catch(err => console.error('error:' + err));
require 'uri'require 'net/http'require 'openssl'
url = URI("https://api.emptor.io/v3/pe/persons/")
http = Net::HTTP.new(url.host, url.port)http.use_ssl = truehttp.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Post.new(url)request["Accept"] = 'application/json'request["Content-Type"] = 'application/json'request["X-Api-Key"] = 'YOUR_API_KEY'request.body = "{\"reports\":{\"dni_status\":\"enabled\",\"license_status\":\"enabled\",\"drunk_driving\":\"enabled\",\"dangerous_driver\":\"enabled\",\"labor_certificate\":\"enabled\",\"justice_certificate\":\"enabled\",\"most_wanted\":\"enabled\",\"police_arrest\":\"enabled\",\"boletin_judicial\":\"enabled\",\"sanctions\":\"enabled\"},\"city_locode\":\"PE LIM\",\"document_id\":\"123456789\",\"document_id_type\":\"national_id\",\"dob\":\"1990-05-03\",\"full_name\":\"JUAN MIGUEL DOE\",\"labor_certificate_id\":\"0123456789123\",\"labor_certificate_type\":\"certiadulto\",\"request_code\":\"VOED83219812K\",\"ruc\":\"9999999999\"}"
response = http.request(request)puts response.read_body
import requests
url = "https://api.emptor.io/v3/pe/persons/"
payload = { "reports": { "dni_status": "enabled", "license_status": "enabled", "drunk_driving": "enabled", "dangerous_driver": "enabled", "labor_certificate": "enabled", "justice_certificate": "enabled", "most_wanted": "enabled", "police_arrest": "enabled", "boletin_judicial": "enabled", "sanctions": "enabled" }, "city_locode": "PE LIM", "document_id": "123456789", "document_id_type": "national_id", "dob": "1990-05-03", "full_name": "JUAN MIGUEL DOE", "labor_certificate_id": "0123456789123", "labor_certificate_type": "certiadulto", "request_code": "VOED83219812K", "ruc": "9999999999"}headers = { "Accept": "application/json", "Content-Type": "application/json", "X-Api-Key": "YOUR_API_KEY"}
response = requests.request("POST", url, json=payload, headers=headers)
print(response.text)
Get person’s status
Section titled “Get person’s status”To get a person’s status, you will need the person_id
returned by our API in the Create a Person step. Use that with your API Key inside the following command or code (in the example below, the person_id
is 0597f9f8-2ea5-4557-b3a1-5a590ed96ef4
):
curl --request GET \ --url https://api.emptor.io/v3/pe/persons/0597f9f8-2ea5-4557-b3a1-5a590ed96ef4/status \ --header 'Accept: application/json' \ --header 'X-Api-Key: YOUR_API_KEY'
const fetch = require('node-fetch');
let url = 'https://api.emptor.io/v3/pe/persons/0597f9f8-2ea5-4557-b3a1-5a590ed96ef4/status';
let options = { method: 'GET', headers: {Accept: 'application/json', 'X-Api-Key': 'YOUR_API_KEY'}};
fetch(url, options) .then(res => res.json()) .then(json => console.log(json)) .catch(err => console.error('error:' + err));
require 'uri'require 'net/http'require 'openssl'
url = URI("https://api.emptor.io/v3/pe/persons/0597f9f8-2ea5-4557-b3a1-5a590ed96ef4/status")
http = Net::HTTP.new(url.host, url.port)http.use_ssl = truehttp.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Get.new(url)request["Accept"] = 'application/json'request["X-Api-Key"] = 'YOUR_API_KEY'
response = http.request(request)puts response.read_body
import requests
url = "https://api.emptor.io/v3/pe/persons/0597f9f8-2ea5-4557-b3a1-5a590ed96ef4/status"
headers = { "Accept": "application/json", "X-Api-Key": "YOUR_API_KEY"}
response = requests.request("GET", url, headers=headers)
print(response.text)
Get reports details
Section titled “Get reports details”To get the details for the person’s reports, you will need the person_id
returned in the Create a Person step. Use that with your API Key inside the following command or code (in the example below, the person_id
is 0597f9f8-2ea5-4557-b3a1-5a590ed96ef4
):
curl --request GET \ --url https://api.emptor.io/v3/pe/details/0597f9f8-2ea5-4557-b3a1-5a590ed96ef4 \ --header 'Accept: application/json' \ --header 'X-Api-Key: YOUR_API_KEY'
const fetch = require('node-fetch');
let url = 'https://api.emptor.io/v3/pe/details/0597f9f8-2ea5-4557-b3a1-5a590ed96ef4';
let options = { method: 'GET', headers: {Accept: 'application/json', 'X-Api-Key': 'YOUR_API_KEY'}};
fetch(url, options) .then(res => res.json()) .then(json => console.log(json)) .catch(err => console.error('error:' + err));
require 'uri'require 'net/http'require 'openssl'
url = URI("https://api.emptor.io/v3/pe/details/0597f9f8-2ea5-4557-b3a1-5a590ed96ef4")
http = Net::HTTP.new(url.host, url.port)http.use_ssl = truehttp.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Get.new(url)request["Accept"] = 'application/json'request["X-Api-Key"] = 'YOUR_API_KEY'
response = http.request(request)puts response.read_body
import requests
url = "https://api.emptor.io/v3/pe/details/0597f9f8-2ea5-4557-b3a1-5a590ed96ef4"
headers = { "Accept": "application/json", "X-Api-Key": "YOUR_API_KEY"}
response = requests.request("GET", url, headers=headers)
print(response.text)