> 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/products/landing/resultados-y-callbacks/datos-de-respuesta.md).

# Response data

## Callback structure

Below is a detailed description of the data structure used in our system and the specific details of each data field, including its type, purpose, and constraints.

**Morphology**:

```javascript
{
  "transactionId": "TRANSACTION_ID",
  "dni": "DOCUMENT_NUMBER",
  "clientData": "CLIENT_DATA",
  "deviceInfo": "DEVICE_INFO",
  "lastStep": {
    "stepId": "STEP_ID",
    "stepType": "STEP_TYPE",
    "timestamp": "UNIX_TIMESTAMP",
    "widget": "WIDGET_NAME"
  },
  "resultJSON": {
    "DocumentData": {
      "serviceTransactionId": "TRANSACTION_ID",
      "serviceDocument": {
        "DOC_MODEL": "DOCUMENT_MODEL",
        "BACKSIDE": "DOCUMENT_BACKSIDE",
        "FRONTSIDE": "DOCUMENT_FRONTSIDE",
        "DECOMPOSED": "DOCUMENT_DECOMPOSE",
        "CHECKS": "DOCUMENT_CHECKS",
        "SCORING": "DOCUMENT_SCORING",
      }
    },
    "DocumentValidation": "DOCUMENT_VALIDATION",
    "imageFront": "FRONT_BASE64_IMAGE",
    "imageBack": "BACK_BASE64_IMAGE",
    "FacialAuthentication": "AUTHENTICATION_DATA",
    "PassiveLiveness": "PASSIVE_LIVENESS_DATA",
    "imageSelfie": "SELFIE_BASE64_IMAGE",
    "imageFrontRaw": "/9j/4AAQSkZJRgAB...",
    "imageBackRaw": "/9j/4AAQSkZJRgAB...",
    "rawTemplateSelfie": "BAEBAQJi/8ZtRtF/UV+p4Ued+Z...",
    "rawTemplateFacialCapture": "BAEBAQJQ/8ZtRtF/UV+p4Ued+Z..."
  }
}
```

**Example**:

```javascript
{
  "transactionId": "00000000-0000-0000-0000-000000000000",
  "dni": "00000000A",
  "clientData": { ... },
  "deviceInfo": { ... },
  "lastStep": {
    "stepId": "00000000-0000-0000-0000-000000000000",
    "stepType": "FINISH",
    "timestamp": 1743350400000,
    "widget": "SELPHI"
  },
  "resultJSON": {
    "DocumentData": {
      "serviceTransactionId": "00000000-0000-0000-0000-000000000000",
      "serviceDocument": {
        "DOC_MODEL": "CHILE - ID CARD (2013)",
        "BACKSIDE": { ... },
        "FRONTSIDE": { ... },
        "DECOMPOSED": { ... },
        "CHECKS": { ... },
        "SCORING": { ... },
      }
    },
    "DocumentValidation": { ... },
    "FacialAuthentication": { ... },
    "PassiveLiveness": { ... },
    "imageFront": "/9j/4AAQSkZJRgAB...",
    "imageBack": "/9j/4AAQSkZJRgAB...",
    "imageSelfie": "/9j/4AAQSkZJRgAB...",
    "imageFrontRaw": "/9j/4AAQSkZJRgAB...",
    "imageBackRaw": "/9j/4AAQSkZJRgAB...",
    "rawTemplateSelfie": "BAEBAQJi/8ZtRtF/UV+p4Ued+Z...",
    "rawTemplateFacialCapture": "BAEBAQJQ/8ZtRtF/UV+p4Ued+Z..."
  }
}
```

***

## Parameter list

This is a collection of examples of the data that is sent:

### TRANSACTION\_ID

Unique transaction ID.

**Details**:

* Can it be empty?: No.

**Example**:

```javascript
"00000000-0000-0000-0000-000000000000"
```

***

### DOCUMENT\_NUMBER

Stores the document number associated with a client.

**Details**:

* Can it be empty?: Yes.
* Reason: There is no document number; this may be because the service could not extract the document number or there was an issue during the data extraction process.

**Example**:

```javascript
"00000000A"
```

```javascript
"0000000"
```

```javascript
undefined
```

***

### CLIENT\_DATA

Stores the information of a client who has completed the onboarding process.

**Details**:

* Can it be empty?: Yes.
* Reason: There is no client data; this may be because no session has been started or there was an issue during the session process.

**Morphology**:

```javascript
{
  "customerId": "CUSTOMER_ID"
}
```

**Example**:

```javascript
{
  "customerId": "0d8d7059"
}
```

```javascript
{}
```

Field reference:

**CUSTOMER\_ID**

This identifier is used to distinguish each user in the system. This identifier may be provided by the contracting company or generated internally.

**Example**:

```javascript
"0d8d7059"
```

```javascript
"0034666666666"
```

```javascript
"00000000-0000-0000-0000-000000000000"
```

***

### DEVICE\_INFO

Stores information about the device used by the client during the onboarding process.

**Details**:

* Can it be empty?: Yes.
* Reason: There is no device information; this may be because the device information was not sent or there was an issue during the event process.

**Morphology**:

```javascript
{
  "osName": "OS_NAME",
  "osVersion": "OS_VERSION",
  "model": "DEVICE_MODEL",
  "brand": "DEVICE_BRAND",
  "browser": "DEVICE_BROWSER"
}
```

**Example**:

```javascript
{
  "osVersion": "114.0.0.0",
  "model": "114.0.0.0",
  "brand": "Chrome",
  "browser": "Chrome",
  "osName": "Mac OS"
}
```

```javascript
{}
```

#### Field references:

**OS\_NAME**

Stores information about the operating system name.

**Example**:

```javascript
"114.0.0.0"
```

**OS\_VERSION**

Stores information about the operating system version.

**Example**:

```javascript
"114.0.0.0"
```

**DEVICE\_MODEL**

Stores information about the device model.

**Example**:

```javascript
"Chrome"
```

**DEVICE\_BRAND**

Stores information about the device brand.

**Example**:

```javascript
"Chrome"
```

**DEVICE\_BROWSER**

Stores information about the device browser.

**Example**:

```javascript
"Mac OS"
```

***

## LAST\_STEP

Stores information about the last step/stage completed by the client during the onboarding process.

**Details:**

* Can it be empty?: Yes.
* Reason: There is no information about the completed step; this may be because the client has not yet started the flow or there was an issue during event capture.

**Morphology:**

```json
{
  "stepId": "STEP_ID",
  "stepType": "STEP_TYPE",
  "timestamp": "UNIX_TIMESTAMP",
  "widget": "WIDGET_NAME"
}
```

**Fields:**

* `stepId` (string): Unique identifier of the completed step.
* `stepType` (string): Type or category of the step (e.g.: "VERIFICATION", "CAPTURE", "CONFIRMATION").
* `timestamp` (number): Unix timestamp of the moment the step was completed.
* `widget` (string): Name of the component or widget that executed the step (e.g.: "BiometricCapture", "TermsAcceptance").

**Example:**

```json
{
    "stepId": "00000000-0000-0000-0000-000000000000",
    "stepType": "FINISH",
    "timestamp": 1743350400000,
    "widget": "SELPHI"
},
```

***

### DOCUMENT\_MODEL

Stores the document model or type.

**Details**:

* Can it be empty?: Yes.
* Reason: No document model was detected; this may be because the service could not detect the document model or there was an issue during the data extraction process.

**Example**:

```javascript
"CHILE - ID CARD (2013)"
```

```javascript
undefined
```

***

### DOCUMENT\_BACKSIDE

Stores the information and specific details related to the back side or back of a document.

**Details**:

* Can it be empty?: Yes.
* Reason: There is no image of the back side of the document; this may be because it is a Passport, the ID does not require an image of the document, the image was not sent, or there was an issue during the data extraction process.

**Example**:

```javascript
{
  "FIELD_DATA": { ... },
  "MRZ_DATA": { ... }
}
```

```javascript
undefined
```

***

### DOCUMENT\_FRONTSIDE

Stores the information and specific details related to the front side of a document.

**Details**:

* Can it be empty?: Yes.
* Reason: There is no image of the front side of the document; this may be because the ID does not require an image of the document, the image was not sent, or there was an issue during the data extraction process.

**Example**:

```javascript
{
  "FIELD_DATA": { ... },
  "MRZ_DATA": { ... }
}
```

```javascript
undefined
```

***

### DOCUMENT\_DECOMPOSE

Stores fragments or crops of the document images.

**Details**:

* Can it be empty?: Yes.
* Reason: There is no device information; this may be because the device information was not sent or there was an issue during the event process.

**Morphology**:

```javascript
{
  "FACE": "DOCUMENT_PORTRAIT_BASE64_IMAGE"
}
```

**Example**:

```javascript
{
  "FACE": "/9j/4AAQSkZJRgAB..."
}
```

```javascript
undefined
```

#### Field references:

**DOCUMENT\_PORTRAIT\_BASE64\_IMAGE**

Stores the crop or fragment of the document photo that shows exclusively the user's face.

**Example**:

```javascript
"/9j/4AAQSkZJRgAB..."
```

***

### DOCUMENT\_CHECKS

Stores a collection of fields from the steps that have been verified or checked during the data extraction process.

**Details**:

* Can it be empty?: Yes.
* Reason: There are no data checks; this may be because the service does not generate data checks or there was an issue during the data extraction process.

**Example**:

```javascript
{
  "PERSONAL_NUMBER_SIDE_MATCH": false,
  "NATIONALITY_SIDE_MATCH": true
}
```

```javascript
undefined
```

***

### DOCUMENT\_SCORING

Stores a collection of scores that evaluate the reliability of the data extracted from a document.

**Details**:

* Can it be empty?: Yes.
* Reason: There is no scoring data; this may be because the service does not generate scoring data or there was an issue during the data extraction process.

**Example**:

```javascript
 {
  "FIELDS_RETURNED": 20,
  "FIELDS_TOTAL": 20,
  "OVERALL_RATING": 100,
  "BACK_SHA256": "SHA_CODE",
  "FRONT_SHA256": "SHA_CODE"
}
```

```javascript
undefined
```

***

### DOCUMENT\_VALIDATION

Stores information related to document validation.

**Details**:

* Can it be empty?: Yes.
* Reason: There is no document validation data; this may be because the service is not enabled or there was an issue during the document validation process.

**Morphology**:

```javascript
{
  "scanReference": "DOCUMENT_VALIDATION_REFERENCE",
  "type": "DOCUMENT_VALIDATION_TYPE",
  "timestamp": "DOCUMENT_VALIDATION_TIME",
}
```

**Example**:

```javascript
{
  "scanReference": "00000000-0000-0000-0000-000000000000",
  "type": "3",
  "timestamp": "1970-01-01T00:00:00.000Z",
}
```

```javascript
{}
```

#### Field references:

**DOCUMENT\_VALIDATION\_REFERENCE**

Stores information related to the document validation reference.

**Example**:

```javascript
"00000000-0000-0000-0000-000000000000"
```

**DOCUMENT\_VALIDATION\_TYPE**

Stores information related to the document validation status.

**Example**:

```javascript
"3"
```

**DOCUMENT\_VALIDATION\_TIME**

Stores information related to the document validation date.

**Example**:

```javascript
"1970-01-01T00:00:00.000Z"
```

***

### FRONT\_BASE64\_IMAGE

Stores the front image of a document.

**Details**:

* Can it be empty?: Yes.
* Reason: There is no image of the front side of the document; this may be because the image was not sent or there was an issue during saving.

**Example**:

```javascript
"/9j/4AAQSkZJRgAB..."
```

```javascript
undefined
```

***

### BACK\_BASE64\_IMAGE

Stores the back image of a document.

**Details**:

* Can it be empty?: Yes.
* Reason: There is no image of the back side of the document; this may be because the image was not sent or there was an issue during saving.

**Example**:

```javascript
"/9j/4AAQSkZJRgAB..."
```

```javascript
undefined
```

***

### AUTHENTICATION\_DATA

Stores information related to the person's authentication.

**Details**:

* Can it be empty?: Yes.
* Reason: There is no facial authentication data; this may be because there was an issue during the facial authentication process.

**Morphology**:

```javascript
{
  "serviceResultLog": "AUTHENTICATION_STATUS",
  "serviceFacialSimilarityResult": "AUTHENTICATION_SIMILARITY"
}
```

**Example**:

```javascript
{
  "serviceResultLog": "POSITIVE",
  "serviceFacialSimilarityResult": 0.9923387765884399
}
```

```javascript
{}
```

### Field references:

**AUTHENTICATION\_STATUS**

Stores the authentication status.

**Example**:

```javascript
"POSITIVE"
```

**AUTHENTICATION\_SIMILARITY**

Stores the similarity measure or match level obtained during the person's authentication process.

**Example**:

```javascript
0.9923387765884399
```

```javascript
0.6823991719034381
```

***

### PASSIVE\_LIVENESS\_DATA

Stores information related to the person's passive liveness check.

**Details**:

* Can it be empty?: Yes.
* Reason: There is no passive liveness check data; this may be because there was an issue during the passive liveness check process.

**Morphology**:

```javascript
{
  "serviceResultLog": "PASSIVE_LIVENESS_RESULT"
}
```

**Example**:

```javascript
{
  "serviceResultLog": "NO_LIVE"
}
```

```javascript
{}
```

#### Field references:

**PASSIVE\_LIVENESS\_RESULT**

Stores the result of the passive liveness check.

**Example**:

```javascript
"NO_LIVE"
```

***

### SELFIE\_BASE64\_IMAGE

Stores the person's selfie image.

**Details**:

* Can it be empty?: Yes.
* Reason: There is no selfie image; this may be because the image was not sent or there was an issue during saving.

**Example**:

```javascript
"/9j/4AAQSkZJRgAB..."
```

```javascript
undefined
```

***

### FRONT\_RAW\_BASE64\_IMAGE

Stores the full front frame of the document in base64 format.

**Details**:

* Can it be empty?: Yes.
* Reason: The front image of the document may not have been sent, or there was an issue during extraction.

**Example**:

```javascript
"/9j/4AAQSkZJRgABAQAAAQABAAD/4gHYSUNDX1..."
```

```javascript
undefined
```

***

### BACK\_RAW\_BASE64\_IMAGE

Stores the full back frame of the document in base64 format.

**Details**:

* Can it be empty?: Yes.
* Reason: The back image of the document may not have been sent, or there was an issue during extraction.

**Example**:

```javascript
"/9j/4AAQSkZJRgABAQAAAQABAAD/4gHYSUNDX1..."
```

```javascript
undefined
```

***

### RAW\_TEMPLATE\_SELFIE (templateRaw)

Stores the raw Biometric Template of the selfie (`templateRaw`) in base64 format.

**Details**:

* Can it be empty?: Yes.
* Reason: The selfie template may not have been sent, or there was an issue during the biometric extraction process.

**Example**:

```javascript
"BAEBAQJi/8ZtRtF/UV+p4Ued+Z..."
```

```javascript
undefined
```

***

### RAW\_TEMPLATE\_FACIAL\_CAPTURE

Stores the raw template of the document's Face Capture (`rawTemplateFacialCapture`) in base64 format.

**Details**:

* Can it be empty?: Yes.
* Reason: The Face Capture template may not have been sent, or there was an issue during the biometric extraction process.

**Example**:

```j
"BAEBAQJQ/8ZtRtF/UV+p4Ued+Z..."
```

```javascript
undefined
```

***

## Callback example

### Successful Callback Response

This use case describes the scenario in which a client successfully completes the onboarding process on a platform or service.

```json
{
  "transactionId": "213d0fd9-57fb-4a87-8237-2778015c94d5",
  "dni": "00000000",
  "clientData": {
    "customerId": "0d8d7059"
  },
  "resultJSON": {
    "DocumentData": {
      "serviceTransactionId": "3442d94c-9610-41ea-b228-5c4823020153",
      "serviceResultCode": 0,
      "serviceResultLog": "Service request successfully processed",
      "serviceDocument": {
        "CHECKS": {
          "BIRTH_DATE_SIDE_MATCH": true,
          "RUN_SIDE_MATCH": true,
          "IDENTITY_NUMBER_SIDE_MATCH": true,
          "SURNAME_SIDE_MATCH": true,
          "EXPIRATION_DATE_SIDE_MATCH": true,
          "NAME_SIDE_MATCH": true,
          "NATIONALITY_SIDE_MATCH": false
        },
        "BACKSIDE": {
          "FIELD_DATA": {},
          "MRZ_DATA": {
            "NATIONALITY": "XXX",
            "SERIAL_NUMBER": "000000000",
            "SURNAME": "DOE",
            "EXPIRATION_DATE": "01/01/1970",
            "SEX": "F",
            "BIRTH_DATE": "01/01/1970",
            "ISSUING_COUNTRY": "XXX",
            "IDENTITY_NUMBER": "000000000",
            "PERSONAL_NUMBER": "000",
            "RUN": "00000000-0",
            "NAME": "SUSAN"
          }
        },
        "FRONTSIDE": {
          "FIELD_DATA": {
            "NATIONALITY": "UNKNOWN",
            "SURNAME": [
              "DOE"
            ],
            "EXPIRATION_DATE": "01/01/1970",
            "BIRTH_DATE": "01/01/1970",
            "IDENTITY_NUMBER": "000.000.000",
            "RUN": "00.000.000-0",
            "EXPEDITION_DATE": "01/01/1970",
            "NAME": "SUSAN"
          }
        },
        "DECOMPOSED": {
          "SIGNATURE": "{Base64}",
          "FACE": "{Base64}"
        },
        "SCORING": {
          "FIELDS_TOTAL": 27,
          "FIELDS_RETURNED": 27,
          "OVERALL_RATING": 100
        },
        "DOC_MODEL": "NEW"
      },
      "serviceTime": "250"
    },
    "DocumentValidation": {
      "scanReference": "572c05a2-faf7-42c2-a583-c0e85a73a263",
      "type": "3",
      "timestamp": "1970-01-01T00:00:00.000Z"
    },
    "FacialAuthentication": {
      "serviceTransactionId": "eb61872d-381f-4759-8cfd-799071c759ae",
      "serviceResultCode": 0,
      "serviceFacialAuthenticationResult": 3,
      "serviceResultLog": "Positive",
      "serviceFacialAuthenticationHash": "{SHA}",
      "serviceFacialSimilarityResult": 0.9917689,
      "serviceTime": "250"
    },
    "PassiveLiveness": {
      "serviceResultCode": 0,
      "serviceResultLog": "Spoof",
      "serviceTime": "250",
      "serviceTransactionId": "752fa584-dfce-498c-a6c3-4ec79394e722",
      "serviceLivenessResult": 1
    },
    "imageFront": "{Base64}",
    "imageBack": "{Base64}",
    "imageSelfie": "{Base64}",
    "imageFrontRaw": "{Base64}",
    "imageBackRaw": "{Base64}",
    "rawTemplateSelfie": "{Base64}",
    "rawTemplateFacialCapture": "{Base64}"
  },
  "deviceInfo": {
    "osVersion": "16.3",
    "model": "16.3",
    "brand": "Mobile Safari",
    "browser": "Mobile Safari",
    "osName": "iOS"
  },
}
```

### Empty Callback Response

This use case addresses the scenario in which all possible options or alternatives have no content or are empty:

```json
{
  "transactionId": "213d0fd9-57fb-4a87-8237-2778015c94d5",
  "clientData": {},
  "deviceInfo": {},
  "resultJSON": {
    "DocumentData": {
      "serviceTransactionId": "3442d94c-9610-41ea-b228-5c4823020153",
      "serviceDocument": {},
    "DocumentValidation": {},
    "FacialAuthentication": {},
    "PassiveLiveness": {},}
  },
}
```
