Skip to main content

Risk API v2 (2.0.0)

Download OpenAPI specification:Download

API Support: it@nemuru.com

Introduction

The Risk API is used for creating and reading risk assessments for either natural persons (customers) or juridical persons (businesses).

These are the typical steps for setting up your account and creating a risk assessments:

  • You are granted with a set of credentials that allow you to authenticate your user when sending requests to Nemuru's Risk API (handled internally by Nemuru).
  • One or more policies are linked to your user (handled internally by Nemuru).
  • A policiy is composed of a set of rules and can be versioned.
  • Each policy rule is linked to a data resource. There are different data resources:
    • Data provided by you when creating the assessment
    • External data sources integrated by Nemuru: credit bureaus, ML models, etc.
  • When creating an assessment, you need to specify a policy to analyze the customer or business with.
  • Depending on the type of policy, specific information will be required when creating the assessment.
  • Once the assessment is computed, the response will return the result.
  • Assessment results can be consulted on demand.

1. Creating a Risk Assessment

There are two endpoints to create Risk Assessments:

2. Retrieving Risk Assessments

There are two endpoints to get Risk Assessments:

Errors

Nemuru's APIs use HTTP status codes together with error objects to handle errors. When an API call fails, the response will include a 4xx or 5xx status code together with a response body.

The error object MUST contain an exception and an error property. ONLY in case of 400 Bad Request error, the schema_errors property will also be present:

  • The exception is a path referring to the unique and enumerable error that occurred in Nemuru. The intent of this property is that it is machine readable and so that you can act properly on its value.
  • The error is the message that accompanies Nemuru's exception. It's value is a human readable message to aid in debugging.
  • The schema_errors returns an object indicating invalid fields in the request. This property is ONLY available when an API call returns a status 400 Bad Request —the request data do not comply with the scheme validation.

Status codes

Code Label Description
200 OK The target resource was successfully found.
201 Created The target resource was successfully created.
204 No content The target resource was successfully modified.
400 Bad Request Some input property does not meet the expected validation.
401 Unauthorized The access token used has expired or is invalid.
403 Forbidden The user’s credentials are not authorized to consume the target service.
404 Not Found The target resource was not found.
409 Conflict There was a conflict with the current state of the target resource.
410 Gone The target resource is no longer available.
500 Internal Error The server encountered an unexpected condition that prevented it from fulfilling the request.
502 Bad Gateway Error The service received an invalid response from the upstream server.
504 Gateway Timeout The service did not get a response in time from the upstream server that it needed in order to complete the request.

Authentication

Login

Retrieve an access token with your username and password, which will be needed in following requests.

Request Body schema: application/json

Login

username
required
string
Example: "username@email.com"

Username

password
required
string
Example: "12345"

Password

Responses

Request samples

Content type
application/json
{
  • "username": "username@email.com",
  • "password": "12345"
}

Response samples

Content type
application/json
{
  • "token_type": "Bearer",
  • "access_token": "1857fdb2-c746-44f9-88a8-507a855fe920",
  • "refresh_token": "f9131f93-5e64-461e-8493-0fb8cb76f31d",
  • "expires_in": 2678400
}

Natural person risk

The following endpoints will allow you to create and retrieve natural person risk assessments.

  • Assess a Natural Person generates a natural person risk assessment with a specific policy. This endpoint requires you to pass the policy ID and all the data that the policy needs as query params.
  • Get Assessments by Document Number returns all natural person risk assessments filtered by the natural person's document number (e.g. DNI or NIE).

A natural person can be assessed stand-alone or within a company structure (juridical person). For the latter, it will be necessary to reference the parent corporate Id number (e.g. CIF) of the parent company so that it is possible to nest the natural person below the juridical person when retrieving the whole company assessments.

Assess a Natural person

Assess a Natural Person using a specific policy (policyId). Depending on the policy, the necessary input data for assessing the natural person must be passed as query params in the request.

query Parameters
policyId
required
string
Example: policyId=b17f0301-e0dc-451f-93d1-16e9599bcd56

The Policy Id

firstName
required
string
Example: firstName=Oscar

The first name of the Natural person to be assessed

lastName
required
string
Example: lastName=Poole

The last name of the Natural person to be assessed

documentNumber
required
string
Example: documentNumber=44361854Y

The Document number (e.g. DNI or NIE number) of the Natural person to be assessed

birthDate
required
string
Example: birthDate=1982-12-13T00:00:00-00:00

The birth date of the Natural person to be assessed (format datetime ATOM)

formattedAddress
required
string
Example: formattedAddress=Carrer Marina, 170

The main residence address (street name and number) of the Natural person to be assessed

postalCode
required
string
Example: postalCode=08037

The main residence postal code of the Natural person to be assessed

city
required
string
Example: city=Barcelona

The main residence city of the Natural person to be assessed

parentCorporateIdNumber
string
Example: parentCorporateIdNumber=B67183574

A natural person can be assessed within a company structure (juridical person). It will be necessary to reference the parentCorporateIdNumber (e.g. CIF) of the parent company so that it is possible to nest this natural person below the juridical person when retrieving the whole company assessments.

header Parameters
Authorization
required
string

The Authorization header must include Bearer <access_token>. See the authentication section.

Content-Type
string
Default: application/json

Content-Type

Responses

Response samples

Content type
application/json
{
  • "status": "ok",
  • "payload": {
    },
  • "identifier": "urn:nemuru:risk:natural-person-risk:44361854Y"
}

Get Assessments by Document Number

Get all Natural Person Risk Assessments by Document Number.

query Parameters
documentNumber
required
string
Example: documentNumber=44361854Y

The Document number (e.g. DNI or NIE number)

header Parameters
Authorization
required
string

The Authorization header must include Bearer <access_token>. See the authentication section.

Content-Type
string
Default: application/json

Content-Type

Responses

Response samples

Content type
application/json
{
  • "status": "ok",
  • "data": [
    ]
}

Juridical person risk

The following endpoints will allow you to create and retrieve juridical person risk assessments.

  • Assess a Juridical Person generates a juridical person risk assessment with a specific policy. This endpoint requires you to pass the policy ID and all the data that the policy needs as query params.
  • Get Assessments by Corporate Id Number returns all juridical person risk assessments filtered by the juridical person's corporate Id number (e.g. CIF).

A juridical person can be assessed stand-alone or within a company structure (juridical person). For the latter, it will be necessary to reference the parent corporate Id number (e.g. CIF) of the parent company so that it is possible to nest the natural person below the juridical person when retrieving the whole company assessments.

Assess a Juridical person

Assess a Juridical Person using a specific policy (policyId). Depending on the policy, the necessary input data for assessing the juridical person must be passed as query params in the request.

query Parameters
policyId
required
string
Example: policyId=4d6330b9-707f-468f-af3c-ecc802f15eb5

The Policy Id

businessName
required
string
Example: businessName=Acme Corporation

The business name of the Juridical person to be assessed

corporateIdNumber
required
string
Example: corporateIdNumber=B67183574

The Corporate Id number (e.g. CIF) of the Juridical person to be assessed

parentCorporateIdNumber
string
Example: parentCorporateIdNumber=B24208471

A juridical person can be assessed within a company structure (juridical person). It will be necessary to reference the parentCorporateIdNumber (e.g. CIF) of the parent company so that it is possible to nest this juridical person below the juridical person when retrieving the whole company assessments.

header Parameters
Authorization
required
string

The Authorization header must include Bearer <access_token>. See the authentication section.

Content-Type
string
Default: application/json

Content-Type

Responses

Response samples

Content type
application/json
{
  • "status": "ok",
  • "payload": {
    },
  • "identifier": "urn:nemuru:risk:natural-person-risk:44361854Y"
}

Get Assessments by Corporate Id Number

Get all Juridical Person Risk Assessments by Corporate Id Number.

query Parameters
corporateIdNumber
required
string
Example: corporateIdNumber=B67183574

The Corporate Id Number

header Parameters
Authorization
required
string

The Authorization header must include Bearer <access_token>. See the authentication section.

Content-Type
string
Default: application/json

Content-Type

Responses

Response samples

Content type
application/json
{
  • "status": "ok",
  • "data": [
    ]
}