> For the complete documentation index, see [llms.txt](https://docs.facephi.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.facephi.com/docs.facephi-en/rest-api/identity-api/identity-api-reference/onboarding/civil-validation/nigeria.md).

# Nigeria

Civil validation service for Nigeria. Performs Identity Verification against the civil registry data of Nigeria.

### Endpoint

```
POST /services/civilValidation
```

### Headers

| Name          | Type   | Required | Description                                                |
| ------------- | ------ | -------- | ---------------------------------------------------------- |
| **x-api-key** | string | **Yes**  | Access authorization API key.                              |
| **family**    | string | No       | Value: **Onboarding**. Required with the tracking service. |

{% hint style="info" %}
All calls to the Endpoints for Tracking with **Identity Platform** must contain the header `family`.
{% endhint %}

## Full Validation Mobile

Performs data validation and facial matching against the Civil Registry of Nigeria using the mobile platform.

### Request body

**Content-Type:** `application/json`

#### Parameters

| Parameter              | Type    | Required | Description                                                                                                                                                                     |
| ---------------------- | ------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `operation`            | string  | **Yes**  | Validation operation to perform. Value: `"FULL"`.                                                                                                                               |
| `platform`             | string  | **Yes**  | Platform from which the request is made. Value: `"MOBILE"`.                                                                                                                     |
| `tokenOcr`             | string  | **Yes**  | Token generated by the native or hybrid SelphID Widget, encrypted in AES256 and Tokenized, sent in Base64 format. It contains the OCR result of the captured Identity document. |
| `templateRaw`          | string  | **Yes**  | Biometric Template generated by the Selphi Widget. Required for FACIAL or FULL operations.                                                                                      |
| `documentNumber`       | string  | No       | User's document number.                                                                                                                                                         |
| `countryCode`          | string  | **Yes**  | Country code in ISO 3166-1 alpha-3 format. Value: `"NGA"`.                                                                                                                      |
| `returnPII`            | boolean | No       | Indicates whether the personal data generated by the OCR service and the response from the Civil Registry should be returned.                                                   |
| `documentValidation`   | boolean | No       | Indicates whether document validation should be started, returning `scanReference` and `type`.                                                                                  |
| `tracking`             | object  | No       | Object that represents the necessary tracking information.                                                                                                                      |
| `tracking.extraData`   | string  | No       | Token generated by the Mobile/Web SDK. Contains tokenized tracking information with the Platform.                                                                               |
| `tracking.operationId` | string  | No       | Operation identifier generated by the Mobile/Web SDK.                                                                                                                           |

#### Request example

```json
{
  "operation": "FULL",
  "platform": "MOBILE",
  "tokenOcr": "base64TokenOcrString",
  "templateRaw": "base64TemplateRawString",
  "documentNumber": "A00000001",
  "countryCode": "NGA",
  "returnPII": true,
  "tracking": {
    "extraData": "BQABAQG2gBNjuHN...",
    "operationId": "xxxxx-xxxxx-xxxxx-xxxxx-xxxxx"
  }
}
```

### Responses

#### `200` Success

#### Response parameters

| Parameter                           | Type    | Description                                                                                                                                  |
| ----------------------------------- | ------- | -------------------------------------------------------------------------------------------------------------------------------------------- |
| `serviceResultCode`                 | integer | Code that indicates the overall result of the service execution. See [Service Result Code](#service-result-code).                            |
| `serviceTime`                       | string  | Total processing time (milliseconds).                                                                                                        |
| `serviceResultLog`                  | string  | Descriptive field for the result of the service execution. Includes details when there is an error or exception.                             |
| `serviceTransactionId`              | string  | Transaction identifier associated with the request processed by the API.                                                                     |
| `civilDataValidation`               | array   | Array that represents OCR validations against the data obtained from the Civil Registry. Its presence depends on the Civil Registry queried. |
| `civilDataValidation[].field`       | string  | Name of the validated field (e.g., `firstName`, `lastName`, `dateOfBirth`).                                                                  |
| `civilDataValidation[].code`        | string  | Validation result code. `"0"`: Validated correctly. `"-99"`: Possibly adulterated.                                                           |
| `civilDataValidation[].message`     | string  | Descriptive message of the validation result.                                                                                                |
| `serviceFacialAuthenticationResult` | integer | Code that indicates the result of facial matching. See [Service Facial Authentication Result](#service-facial-authentication-result).        |
| `serviceFacialSimilarityResult`     | number  | Value that indicates the facial similarity between the face in the document photo and the user's selfie. **1.0 = 100%**.                     |
| `serviceFacialAuthenticationHash`   | string  | Integrity hash of the biometric template used in a positive or uncertain facial authentication.                                              |
| `serviceDocument`                   | string  | JSON string that represents the captured document. Its properties are all the fields extracted by the OCR process.                           |
| `civilServiceData`                  | string  | JSON string with the personal data obtained from the Civil Registry (only returned if `returnPII` was sent as `true` in the request).        |

#### Response example

```json
{
  "serviceResultCode": 0,
  "serviceTime": "2200",
  "serviceResultLog": "Positive | Service executed ok",
  "serviceTransactionId": "12345678-1234-1234-1234-123456789012",
  "civilDataValidation": [
    {
      "field": "firstName",
      "code": "0",
      "message": "Validated ok"
    },
    {
      "field": "lastName",
      "code": "0",
      "message": "Validated ok"
    },
    {
      "field": "dateOfBirth",
      "code": "0",
      "message": "Validated ok"
    }
  ],
  "serviceFacialAuthenticationResult": 3,
  "serviceFacialSimilarityResult": 0.97,
  "serviceFacialAuthenticationHash": "ABC123DEF456GHI789JKL012MNO345PQR678STU901VWX234YZ567",
  "serviceDocument": "{\"DocumentNumber\":\"A00000001\",\"FirstName\":\"ADEBAYO\",\"LastName\":\"OLADIPO\",\"DateOfBirth\":\"12/05/1988\",\"Gender\":\"M\",\"Nationality\":\"NIGERIAN\"}",
  "civilServiceData": "{\"surname\":\"OLADIPO\",\"firstName\":\"ADEBAYO\",\"dateOfBirth\":\"12/05/1988\",\"gender\":\"MALE\",\"nationality\":\"NIGERIAN\",\"maritalStatus\":\"SINGLE\"}"
}
```

## Full Validation Web

Performs data validation and facial matching against the Civil Registry of Nigeria using the web platform.

### Request body

**Content-Type:** `application/json`

#### Parameters

| Parameter              | Type    | Required | Description                                                                                                                   |
| ---------------------- | ------- | -------- | ----------------------------------------------------------------------------------------------------------------------------- |
| `operation`            | string  | **Yes**  | Validation operation to perform. Value: `"FULL"`.                                                                             |
| `platform`             | string  | **Yes**  | Platform from which the request is made. Value: `"WEB"`.                                                                      |
| `imageFrontDocument`   | string  | **Yes**  | Front capture of the document, image in Base64 without the MIME type header. Required for the WEB platform.                   |
| `imageBackDocument`    | string  | **Yes**  | Back capture of the document, image in Base64 without the MIME type header. Required for the WEB platform.                    |
| `templateRaw`          | string  | **Yes**  | Biometric Template generated by the Selphi Widget. Required for FACIAL or FULL operations.                                    |
| `documentNumber`       | string  | No       | User's document number.                                                                                                       |
| `countryCode`          | string  | **Yes**  | Country code in ISO 3166-1 alpha-3 format. Value: `"NGA"`.                                                                    |
| `returnPII`            | boolean | No       | Indicates whether the personal data generated by the OCR service and the response from the Civil Registry should be returned. |
| `documentValidation`   | boolean | No       | Indicates whether document validation should be started, returning `scanReference` and `type`.                                |
| `tracking`             | object  | No       | Object that represents the necessary tracking information.                                                                    |
| `tracking.extraData`   | string  | No       | Token generated by the Mobile/Web SDK. Contains tokenized tracking information with the Platform.                             |
| `tracking.operationId` | string  | No       | Operation identifier generated by the Mobile/Web SDK.                                                                         |

#### Request example

```json
{
  "operation": "FULL",
  "platform": "WEB",
  "imageFrontDocument": "base64ImageFrontString",
  "imageBackDocument": "base64ImageBackString",
  "templateRaw": "base64TemplateRawString",
  "documentNumber": "A00000002",
  "countryCode": "NGA",
  "returnPII": true,
  "tracking": {
    "extraData": "BQABAQG2gBNjuHN...",
    "operationId": "xxxxx-xxxxx-xxxxx-xxxxx-xxxxx"
  }
}
```

### Responses

#### `200` Success

#### Response parameters

| Parameter                           | Type    | Description                                                                                                                                  |
| ----------------------------------- | ------- | -------------------------------------------------------------------------------------------------------------------------------------------- |
| `serviceResultCode`                 | integer | Code that indicates the overall result of the service execution. See [Service Result Code](#service-result-code).                            |
| `serviceTime`                       | string  | Total processing time (milliseconds).                                                                                                        |
| `serviceResultLog`                  | string  | Descriptive field for the result of the service execution. Includes details when there is an error or exception.                             |
| `serviceTransactionId`              | string  | Transaction identifier associated with the request processed by the API.                                                                     |
| `civilDataValidation`               | array   | Array that represents OCR validations against the data obtained from the Civil Registry. Its presence depends on the Civil Registry queried. |
| `civilDataValidation[].field`       | string  | Name of the validated field (e.g., `firstName`, `lastName`, `dateOfBirth`).                                                                  |
| `civilDataValidation[].code`        | string  | Validation result code. `"0"`: Validated correctly. `"-99"`: Possibly adulterated.                                                           |
| `civilDataValidation[].message`     | string  | Descriptive message of the validation result.                                                                                                |
| `serviceFacialAuthenticationResult` | integer | Code that indicates the result of facial matching. See [Service Facial Authentication Result](#service-facial-authentication-result).        |
| `serviceFacialSimilarityResult`     | number  | Value that indicates the facial similarity between the face in the document photo and the user's selfie. **1.0 = 100%**.                     |
| `serviceFacialAuthenticationHash`   | string  | Integrity hash of the biometric template used in a positive or uncertain facial authentication.                                              |
| `serviceDocument`                   | string  | JSON string that represents the captured document. Its properties are all the fields extracted by the OCR process.                           |
| `civilServiceData`                  | string  | JSON string with the personal data obtained from the Civil Registry (only returned if `returnPII` was sent as `true` in the request).        |

#### Response example

```json
{
  "serviceResultCode": 0,
  "serviceTime": "3500",
  "serviceResultLog": "Negative | Service executed ok",
  "serviceTransactionId": "98765432-9876-5432-1098-987654321098",
  "civilDataValidation": [],
  "serviceFacialAuthenticationResult": 1,
  "serviceFacialSimilarityResult": 0.12,
  "serviceFacialAuthenticationHash": "ZYX987WVU654TSR321QPO098NML765KJI432HGF109EDC876BAZ543",
  "serviceDocument": "{\"DocumentNumber\":\"A00000002\",\"FirstName\":\"CHINONSO EMEKA\",\"LastName\":\"OKONKWO\",\"DateOfBirth\":\"08/11/1993\",\"Gender\":\"M\",\"Nationality\":\"NIGERIAN\"}",
  "civilServiceData": "{\"surname\":\"OKONKWO\",\"firstName\":\"CHINONSO EMEKA\",\"dateOfBirth\":\"08/11/1993\",\"gender\":\"MALE\",\"nationality\":\"NIGERIAN\",\"maritalStatus\":\"MARRIED\"}"
}
```

## Data Validation Mobile

Performs data validation against the Civil Registry of Nigeria using the mobile platform. Does not include facial matching.

### Request body

**Content-Type:** `application/json`

#### Parameters

| Parameter              | Type    | Required | Description                                                                                                                                                                     |
| ---------------------- | ------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `operation`            | string  | **Yes**  | Validation operation to perform. Value: `"DATA"`.                                                                                                                               |
| `platform`             | string  | **Yes**  | Platform from which the request is made. Value: `"MOBILE"`.                                                                                                                     |
| `tokenOcr`             | string  | **Yes**  | Token generated by the native or hybrid SelphID Widget, encrypted in AES256 and Tokenized, sent in Base64 format. It contains the OCR result of the captured Identity document. |
| `documentNumber`       | string  | No       | User's document number.                                                                                                                                                         |
| `countryCode`          | string  | **Yes**  | Country code in ISO 3166-1 alpha-3 format. Value: `"NGA"`.                                                                                                                      |
| `returnPII`            | boolean | No       | Indicates whether the personal data generated by the OCR service and the response from the Civil Registry should be returned.                                                   |
| `documentValidation`   | boolean | No       | Indicates whether document validation should be started, returning `scanReference` and `type`.                                                                                  |
| `tracking`             | object  | No       | Object that represents the necessary tracking information.                                                                                                                      |
| `tracking.extraData`   | string  | No       | Token generated by the Mobile/Web SDK. Contains tokenized tracking information with the Platform.                                                                               |
| `tracking.operationId` | string  | No       | Operation identifier generated by the Mobile/Web SDK.                                                                                                                           |

#### Request example

```json
{
  "operation": "DATA",
  "platform": "MOBILE",
  "tokenOcr": "base64TokenOcrString",
  "documentNumber": "B12345678",
  "countryCode": "NGA",
  "returnPII": true,
  "tracking": {
    "extraData": "BQABAQG2gBNjuHN...",
    "operationId": "xxxxx-xxxxx-xxxxx-xxxxx-xxxxx"
  }
}
```

### Responses

#### `200` Success

#### Response parameters

| Parameter                       | Type    | Description                                                                                                                                  |
| ------------------------------- | ------- | -------------------------------------------------------------------------------------------------------------------------------------------- |
| `serviceResultCode`             | integer | Code that indicates the overall result of the service execution. See [Service Result Code](#service-result-code).                            |
| `serviceTime`                   | string  | Total processing time (milliseconds).                                                                                                        |
| `serviceResultLog`              | string  | Descriptive field for the result of the service execution. Includes details when there is an error or exception.                             |
| `serviceTransactionId`          | string  | Transaction identifier associated with the request processed by the API.                                                                     |
| `civilDataValidation`           | array   | Array that represents OCR validations against the data obtained from the Civil Registry. Its presence depends on the Civil Registry queried. |
| `civilDataValidation[].field`   | string  | Name of the validated field (e.g., `firstName`, `lastName`, `dateOfBirth`).                                                                  |
| `civilDataValidation[].code`    | string  | Validation result code. `"0"`: Validated correctly. `"-99"`: Possibly adulterated.                                                           |
| `civilDataValidation[].message` | string  | Descriptive message of the validation result.                                                                                                |
| `serviceDocument`               | string  | JSON string that represents the captured document. Its properties are all the fields extracted by the OCR process.                           |
| `civilServiceData`              | string  | JSON string with the personal data obtained from the Civil Registry (only returned if `returnPII` was sent as `true` in the request).        |

#### Response example

```json
{
  "serviceResultCode": 0,
  "serviceTime": "1600",
  "serviceResultLog": "Service executed ok",
  "serviceTransactionId": "55443322-5544-3322-1100-554433221100",
  "civilDataValidation": [
    {
      "field": "firstName",
      "code": "0",
      "message": "Validated ok"
    },
    {
      "field": "lastName",
      "code": "0",
      "message": "Validated ok"
    },
    {
      "field": "dateOfBirth",
      "code": "0",
      "message": "Validated ok"
    }
  ],
  "serviceDocument": "{\"DocumentNumber\":\"B12345678\",\"FirstName\":\"OLUWASEUN TUNDE\",\"LastName\":\"AFOLABI\",\"DateOfBirth\":\"23/01/1985\",\"Gender\":\"M\",\"Nationality\":\"NIGERIAN\"}",
  "civilServiceData": "{\"surname\":\"AFOLABI\",\"firstName\":\"OLUWASEUN TUNDE\",\"dateOfBirth\":\"23/01/1985\",\"gender\":\"MALE\",\"nationality\":\"NIGERIAN\",\"maritalStatus\":\"MARRIED\"}"
}
```

## Data Validation Web

Performs data validation against the Civil Registry of Nigeria using the web platform. Does not include facial matching.

### Request body

**Content-Type:** `application/json`

#### Parameters

| Parameter              | Type    | Required | Description                                                                                                                   |
| ---------------------- | ------- | -------- | ----------------------------------------------------------------------------------------------------------------------------- |
| `operation`            | string  | **Yes**  | Validation operation to perform. Value: `"DATA"`.                                                                             |
| `platform`             | string  | **Yes**  | Platform from which the request is made. Value: `"WEB"`.                                                                      |
| `imageFrontDocument`   | string  | **Yes**  | Front capture of the document, image in Base64 without the MIME type header. Required for the WEB platform.                   |
| `imageBackDocument`    | string  | **Yes**  | Back capture of the document, image in Base64 without the MIME type header. Required for the WEB platform.                    |
| `countryCode`          | string  | **Yes**  | Country code in ISO 3166-1 alpha-3 format. Value: `"NGA"`.                                                                    |
| `returnPII`            | boolean | No       | Indicates whether the personal data generated by the OCR service and the response from the Civil Registry should be returned. |
| `documentValidation`   | boolean | No       | Indicates whether document validation should be started, returning `scanReference` and `type`.                                |
| `tracking`             | object  | No       | Object that represents the necessary tracking information.                                                                    |
| `tracking.extraData`   | string  | No       | Token generated by the Mobile/Web SDK. Contains tokenized tracking information with the Platform.                             |
| `tracking.operationId` | string  | No       | Operation identifier generated by the Mobile/Web SDK.                                                                         |

#### Request example

```json
{
  "operation": "DATA",
  "platform": "WEB",
  "imageFrontDocument": "base64ImageFrontString",
  "imageBackDocument": "base64ImageBackString",
  "countryCode": "NGA",
  "returnPII": true,
  "tracking": {
    "extraData": "BQABAQG2gBNjuHN...",
    "operationId": "xxxxx-xxxxx-xxxxx-xxxxx-xxxxx"
  }
}
```

### Responses

#### `200` Success

#### Response parameters

| Parameter                       | Type    | Description                                                                                                                                  |
| ------------------------------- | ------- | -------------------------------------------------------------------------------------------------------------------------------------------- |
| `serviceResultCode`             | integer | Code that indicates the overall result of the service execution. See [Service Result Code](#service-result-code).                            |
| `serviceTime`                   | string  | Total processing time (milliseconds).                                                                                                        |
| `serviceResultLog`              | string  | Descriptive field for the result of the service execution. Includes details when there is an error or exception.                             |
| `serviceTransactionId`          | string  | Transaction identifier associated with the request processed by the API.                                                                     |
| `civilDataValidation`           | array   | Array that represents OCR validations against the data obtained from the Civil Registry. Its presence depends on the Civil Registry queried. |
| `civilDataValidation[].field`   | string  | Name of the validated field (e.g., `firstName`, `lastName`, `dateOfBirth`).                                                                  |
| `civilDataValidation[].code`    | string  | Validation result code. `"0"`: Validated correctly. `"-99"`: Possibly adulterated.                                                           |
| `civilDataValidation[].message` | string  | Descriptive message of the validation result.                                                                                                |
| `serviceDocument`               | string  | JSON string that represents the captured document. Its properties are all the fields extracted by the OCR process.                           |
| `civilServiceData`              | string  | JSON string with the personal data obtained from the Civil Registry (only returned if `returnPII` was sent as `true` in the request).        |

#### Response example

```json
{
  "serviceResultCode": 0,
  "serviceTime": "2300",
  "serviceResultLog": "Service executed ok",
  "serviceTransactionId": "66778899-6677-8899-0011-667788990011",
  "civilDataValidation": [
    {
      "field": "firstName",
      "code": "0",
      "message": "Validated ok"
    },
    {
      "field": "lastName",
      "code": "-99",
      "message": "Possibly adulterated"
    },
    {
      "field": "dateOfBirth",
      "code": "0",
      "message": "Validated ok"
    }
  ],
  "serviceDocument": "{\"DocumentNumber\":\"C44556677\",\"FirstName\":\"NGOZI AMARA\",\"LastName\":\"EZE\",\"DateOfBirth\":\"17/09/1991\",\"Gender\":\"F\",\"Nationality\":\"NIGERIAN\"}",
  "civilServiceData": "{\"surname\":\"EZE\",\"firstName\":\"NGOZI AMARA\",\"dateOfBirth\":\"17/09/1991\",\"gender\":\"FEMALE\",\"nationality\":\"NIGERIAN\",\"maritalStatus\":\"SINGLE\"}"
}
```

## Facial Validation Mobile

Performs facial matching against the official images of the Civil Registry of Nigeria using the mobile platform. Does not include data validation.

### Request body

**Content-Type:** `application/json`

#### Parameters

| Parameter              | Type   | Required | Description                                                                                       |
| ---------------------- | ------ | -------- | ------------------------------------------------------------------------------------------------- |
| `operation`            | string | **Yes**  | Validation operation to perform. Value: `"FACIAL"`.                                               |
| `platform`             | string | **Yes**  | Platform from which the request is made. Value: `"MOBILE"`.                                       |
| `templateRaw`          | string | **Yes**  | Biometric Template generated by the Selphi Widget. Required for FACIAL or FULL operations.        |
| `documentNumber`       | string | **Yes**  | User's document number. Required for FACIAL operations.                                           |
| `countryCode`          | string | **Yes**  | Country code in ISO 3166-1 alpha-3 format. Value: `"NGA"`.                                        |
| `tracking`             | object | No       | Object that represents the necessary tracking information.                                        |
| `tracking.extraData`   | string | No       | Token generated by the Mobile/Web SDK. Contains tokenized tracking information with the Platform. |
| `tracking.operationId` | string | No       | Operation identifier generated by the Mobile/Web SDK.                                             |

#### Request example

```json
{
  "operation": "FACIAL",
  "platform": "MOBILE",
  "templateRaw": "base64TemplateRawString",
  "documentNumber": "C98765432",
  "countryCode": "NGA",
  "tracking": {
    "extraData": "BQABAQG2gBNjuHN...",
    "operationId": "xxxxx-xxxxx-xxxxx-xxxxx-xxxxx"
  }
}
```

### Responses

#### `200` Success

#### Response parameters

| Parameter                           | Type    | Description                                                                                                                                  |
| ----------------------------------- | ------- | -------------------------------------------------------------------------------------------------------------------------------------------- |
| `serviceResultCode`                 | integer | Code that indicates the overall result of the service execution. See [Service Result Code](#service-result-code).                            |
| `serviceTime`                       | string  | Total processing time (milliseconds).                                                                                                        |
| `serviceResultLog`                  | string  | Descriptive field for the result of the service execution. Includes details when there is an error or exception.                             |
| `serviceTransactionId`              | string  | Transaction identifier associated with the request processed by the API.                                                                     |
| `civilDataValidation`               | array   | Array that represents OCR validations against the data obtained from the Civil Registry. Its presence depends on the Civil Registry queried. |
| `civilDataValidation[].field`       | string  | Name of the validated field (e.g., `firstName`, `lastName`, `dateOfBirth`).                                                                  |
| `civilDataValidation[].code`        | string  | Validation result code. `"0"`: Validated correctly. `"-99"`: Possibly adulterated.                                                           |
| `civilDataValidation[].message`     | string  | Descriptive message of the validation result.                                                                                                |
| `serviceFacialAuthenticationResult` | integer | Code that indicates the result of facial matching. See [Service Facial Authentication Result](#service-facial-authentication-result).        |
| `serviceFacialSimilarityResult`     | number  | Value that indicates the facial similarity between the face in the document photo and the user's selfie. **1.0 = 100%**.                     |
| `serviceFacialAuthenticationHash`   | string  | Integrity hash of the biometric template used in a positive or uncertain facial authentication.                                              |
| `serviceDocument`                   | string  | JSON string that represents the captured document. Its properties are all the fields extracted by the OCR process.                           |
| `civilServiceData`                  | string  | JSON string with the personal data obtained from the Civil Registry (only returned if `returnPII` was sent as `true` in the request).        |

#### Response example

```json
{
  "serviceResultCode": 0,
  "serviceTime": "2600",
  "serviceResultLog": "Positive | Service executed ok",
  "serviceTransactionId": "24681357-2468-1357-9024-246813579024",
  "serviceFacialAuthenticationResult": 3,
  "serviceFacialSimilarityResult": 0.95,
  "serviceFacialAuthenticationHash": "DEF789GHI012JKL345MNO678PQR901STU234VWX567YZA890BCD123",
  "serviceDocument": "{\"DocumentNumber\":\"C98765432\",\"FirstName\":\"IFEANYI CHUKWUEMEKA\",\"LastName\":\"NWOSU\",\"DateOfBirth\":\"05/12/1986\",\"Gender\":\"M\",\"Nationality\":\"NIGERIAN\"}",
  "civilServiceData": "{\"surname\":\"NWOSU\",\"firstName\":\"IFEANYI CHUKWUEMEKA\",\"dateOfBirth\":\"05/12/1986\",\"gender\":\"MALE\",\"nationality\":\"NIGERIAN\",\"maritalStatus\":\"MARRIED\"}"
}
```

## Facial Validation Web

Performs facial matching against the official images of the Civil Registry of Nigeria using the web platform. Does not include data validation.

### Request body

**Content-Type:** `application/json`

#### Parameters

| Parameter              | Type    | Required | Description                                                                                       |
| ---------------------- | ------- | -------- | ------------------------------------------------------------------------------------------------- |
| `operation`            | string  | **Yes**  | Validation operation to perform. Value: `"FACIAL"`.                                               |
| `platform`             | string  | **Yes**  | Platform from which the request is made. Value: `"WEB"`.                                          |
| `templateRaw`          | string  | **Yes**  | Biometric Template generated by the Selphi Widget. Required for FACIAL or FULL operations.        |
| `documentNumber`       | string  | **Yes**  | User's document number. Required for FACIAL operations.                                           |
| `countryCode`          | string  | **Yes**  | Country code in ISO 3166-1 alpha-3 format. Value: `"NGA"`.                                        |
| `returnPII`            | boolean | No       | Indicates whether the personal data generated by the Civil Registry response should be received.  |
| `tracking`             | object  | No       | Object that represents the necessary tracking information.                                        |
| `tracking.extraData`   | string  | No       | Token generated by the Mobile/Web SDK. Contains tokenized tracking information with the Platform. |
| `tracking.operationId` | string  | No       | Operation identifier generated by the Mobile/Web SDK.                                             |

#### Request example

```json
{
  "operation": "FACIAL",
  "platform": "WEB",
  "templateRaw": "base64TemplateRawString",
  "documentNumber": "D55667788",
  "countryCode": "NGA",
  "returnPII": true,
  "tracking": {
    "extraData": "BQABAQG2gBNjuHN...",
    "operationId": "xxxxx-xxxxx-xxxxx-xxxxx-xxxxx"
  }
}
```

### Responses

#### `200` Success

#### Response parameters

| Parameter                           | Type    | Description                                                                                                                                  |
| ----------------------------------- | ------- | -------------------------------------------------------------------------------------------------------------------------------------------- |
| `serviceResultCode`                 | integer | Code that indicates the overall result of the service execution. See [Service Result Code](#service-result-code).                            |
| `serviceTime`                       | string  | Total processing time (milliseconds).                                                                                                        |
| `serviceResultLog`                  | string  | Descriptive field for the result of the service execution. Includes details when there is an error or exception.                             |
| `serviceTransactionId`              | string  | Transaction identifier associated with the request processed by the API.                                                                     |
| `civilDataValidation`               | array   | Array that represents OCR validations against the data obtained from the Civil Registry. Its presence depends on the Civil Registry queried. |
| `civilDataValidation[].field`       | string  | Name of the validated field (e.g., `firstName`, `lastName`, `dateOfBirth`).                                                                  |
| `civilDataValidation[].code`        | string  | Validation result code. `"0"`: Validated correctly. `"-99"`: Possibly adulterated.                                                           |
| `civilDataValidation[].message`     | string  | Descriptive message of the validation result.                                                                                                |
| `serviceFacialAuthenticationResult` | integer | Code that indicates the result of facial matching. See [Service Facial Authentication Result](#service-facial-authentication-result).        |
| `serviceFacialSimilarityResult`     | number  | Value that indicates the facial similarity between the face in the document photo and the user's selfie. **1.0 = 100%**.                     |
| `serviceFacialAuthenticationHash`   | string  | Integrity hash of the biometric template used in a positive or uncertain facial authentication.                                              |
| `serviceDocument`                   | string  | JSON string that represents the captured document. Its properties are all the fields extracted by the OCR process.                           |
| `civilServiceData`                  | string  | JSON string with the personal data obtained from the Civil Registry (only returned if `returnPII` was sent as `true` in the request).        |

#### Response example

```json
{
  "serviceResultCode": 0,
  "serviceTime": "2000",
  "serviceResultLog": "NoneBecausePoseExceed",
  "serviceTransactionId": "13579024-1357-9024-6802-135790246802",
  "serviceFacialAuthenticationResult": 4,
  "serviceFacialSimilarityResult": 0.0,
  "serviceFacialAuthenticationHash": "GHI456JKL789MNO012PQR345STU678VWX901YZA234BCD567EFG890",
  "serviceDocument": "{\"DocumentNumber\":\"D55667788\",\"FirstName\":\"AISHA FATIMA\",\"LastName\":\"BELLO\",\"DateOfBirth\":\"30/07/1994\",\"Gender\":\"F\",\"Nationality\":\"NIGERIAN\"}",
  "civilServiceData": "{\"surname\":\"BELLO\",\"firstName\":\"AISHA FATIMA\",\"dateOfBirth\":\"30/07/1994\",\"gender\":\"FEMALE\",\"nationality\":\"NIGERIAN\",\"maritalStatus\":\"SINGLE\"}"
}
```

## Reference tables

#### Service Result Code

The `serviceResultCode` indicates the overall result of the service execution:

| serviceResultCode | Description                                                                       | HTTP code |
| ----------------- | --------------------------------------------------------------------------------- | --------- |
| 0                 | The service execution was successful, the module processed the request correctly. | 200       |

#### Service Facial Authentication Result

The `serviceFacialAuthenticationResult` indicates the result of facial matching operations (only for FULL and FACIAL operations):

| Code | Result                           | Description                                                                                                                                                                                         |
| ---- | -------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| 0    | NONE                             | Facial verification could not be performed.                                                                                                                                                         |
| 1    | NEGATIVE                         | The process was executed correctly. The facial pattern comparison of the faces does not match.                                                                                                      |
| 3    | POSITIVE                         | The process was executed correctly. The facial pattern comparison of the faces is positive. The value of `serviceFacialSimilarityResult` indicates the % of similarity between the compared images. |
| 4    | NONE BECAUSE POSE EXCEED         | Facial verification could not be performed due to the position of the face.                                                                                                                         |
| 5    | NONE BECAUSE INVALID EXTRACTIONS | Facial verification could not be performed due to problems extracting the facial pattern.                                                                                                           |

## Common errors

#### `400` Bad Request

```json
{
  "status": 400,
  "title": "Bad Request",
  "detail": "Invalid request.",
  "type": "https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/400",
  "errors": []
}
```

#### `401` Unauthorized

```json
{
  "message": "Unauthorized"
}
```

#### `403` Forbidden

```json
{
  "Message": "User is not authorized to access this resource with an explicit deny"
}
```

#### `502` Bad Gateway

```json
{
  "status": 502,
  "title": "Bad Gateway",
  "detail": "Server got an invalid response.",
  "type": "https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/502"
}
```

#### `504` Gateway Timeout

```json
{
  "message": "Endpoint request timed out"
}
```
