# KYC Service Overview and Integration

### Login Service

##### POST [https://api-fintecheart.ado-tech.com/api/v1/auth/login](https://api-fintecheart.ado-tech.com/api/v1/auth/login)

##### Parameters

**Headers**

- `x-accountid`: Account id

**Body structure**

```
{
    "username": "username",
    "password": "password"
}
```

<span style="color: rgb(34, 34, 34); font-family: var(--font-heading, var(--font-body)); font-size: 1.4em; font-weight: 400;">Response structure</span>

```
{
    "success": true,
    "message": "Sign in successfully",
    "StatusCode": 200,
    "code": "Sign in successfully",
    "data": {
        "access_token": "eyJhbGciOiJSUzI1NiIsInR5cCIgOiAiS",
        "expires_in": 18000,
        "refresh_expires_in": 1800,
        "refresh_token": "eyJhbGciOiJIUzI1NiIsInR5cCIgOiAiSldU",
        "token_type": "Bearer",
        "not-before-policy": 0,
        "session_state": "131967cb-6a34-4b63-bcd6-df52dff84cd1",
        "scope": "email openid profile"
    }
}
```


### Create transaction url

##### POST [https://api-fintecheart.ado-tech.com/api/v1/flowmanager/flowrequest/create](https://api-fintecheart.ado-tech.com/api/v1/flowmanager/flowrequest/create)

This step will require the bearer token got in the login request as authorization parameter

##### Parameters

**headers**

`x-accountid`: Account id

**body structure**

```
{
    "documentType": "1",
    "documentNumber": "1234097206",
    "flowType": "1", // flowtype for KYC is 1
    "riskAmount": 123,
    "callBackUrl": "https://www.google.com"
}
```

##### Possible documentType values

<div id="bkmrk-1%C2%A0-citizenship-id-2-"><div>**1** Citizenship ID</div><div>**2** PEP only with Passport</div><div>**3** Ecuadorian Citizenship ID</div><div>**4** Foreigner ID</div><div>**5** Identity Card</div><div>**6** Israel ID Card</div><div>**7** Panamanian Citizenship ID</div><div>**8** Peruvian Citizenship ID</div><div>**9** Paraguayan Citizenship ID</div><div>**10** INE Mexico</div><div>**11** Chilean Identity ID</div><div>**12** Puerto Rico Identification</div><div>**13** Costa Rican Identity ID</div><div>**14** Personal Identification Document Guatemala</div><div>**15** Uruguayan ID</div><div>**16** Bolivian Citizenship ID</div><div>**17** PPT</div><div>**18** National Identity Document Spain</div><div>**19** National Identity Document Argentina</div><div>**20** Passport</div></div>### WebHook for data transfering

There must be a `login` service for authentication and a `push` service to transfer the data.

#### Login

##### Parameters

The data must be received as a x-www-form-urlencoded

- `client_id`
- `client_secret`
- `grant_type:` authentication type

##### Response structure

```
{
    "access_token": "eyJhbGciOiJSUzI1NiIIiA6ICJ6eFB3...",
    "expires_in": 300,
    "refresh_expires_in": 0,
    "token_type": "Bearer",
    "not-before-policy": 0,
    "scope": "email profile"
}
```

#### Push

##### Parameters

This is the JSON structure with the transaction data sent by the platform

```
{
    "Uid": "hba7gasd-785c-410e-80a4-27cb82215956",
    "key": "jdfys9d8y7fs87dyfs8dhjd",
    "StartingDate": "2023-09-07T10:55:26.603",
    "CreationDate": "2023-09-07T10:55:47.99",
    "CreationIP": "156.09.97.2",
    "DocumentType": 1,
    "IdNumber": "1238657888",
    "FirstName": "Nombre",
    "SecondName": "Nombre",
    "FirstSurname": "Apellido",
    "SecondSurname": "Apellido",
    "Gender": "G" // M or F
    "BirthDate": "2002-08-30T00:00:00",
    "PlaceBirth": place of birth,
    "ExpeditionCity": null,
    "ExpeditionDepartment": null,
    "BirthCity": null,
    "BirthDepartment": null,
    "TransactionType": 1,
    "TransactionTypeName": "Enroll",
    "IssueDate": "2020-09-03T00:00:00",
    "TransactionId": "125",
    "ProductId": "1",
    "ComparationFacesSuccesful": false,
    "FaceFound": false,
    "FaceDocumentFrontFound": false,
    "BarcodeFound": false,
    "ResultComparationFaces": 0.0,
    "ComparationFacesAproved": false,
    "Extras": {
        "IdState": "4",
        "StateName": "State description"
    },
    "NumberPhone": null,
    "CodFingerprint": null,
    "ResultQRCode": null,
    "DactilarCode": null,
    "ReponseControlList": null,
    "Images": [],
    "SignedDocuments": [],
    "Scores": [
        {
            "Id": 4,
            "UserName": null,
            "StateName": "State description",
            "StartingDate": "0001-01-01T00:00:00",
            "Observation": null
        }
    ],
    "Response_ANI": null,
    "Parameters": null
}
```