# Pay Day Loan Aggregators

## Create a Company Profile

<mark style="color:green;">`POST`</mark> `https://sandbox-api1117v2.fint.ng/v1/payroll/createcompany`

The Endpoint allows you to create a Company Profile&#x20;

#### Headers

| Name          | Type   | Description                             |
| ------------- | ------ | --------------------------------------- |
| Client-Id     | string | Client id issued to the aggregators     |
| Client-Secret | string | Client Secret Issued to the aggregators |

#### Request Body

| Name             | Type   | Description                                        |
| ---------------- | ------ | -------------------------------------------------- |
| company\_name    | string | This is the name of the company                    |
| description      | string | A brief description of the company                 |
| country          | string | The country where the HQ of the company is located |
| state            | string | The state where the HQ of the company is located   |
| company\_address | string | The company Address                                |
| username         | string | A preferred username of the company                |
| password         | string | A preferred password of the company                |
| company\_phone   | string | The company's phone number                         |
| email            | string | The company's email Address                        |

{% tabs %}
{% tab title="200 The returned response contains a unique Key called "fint\_company\_code". This code will be used to grant access to a staff of the company when requesting a Loan." %}

```
{
    "status": true,
    "msg": "Company Profile Creation Successful",
    "data": {
        "name": "FINT Technology",
        "username": "fint",
        "email": "tech@fint.ng",
        "fint_company_code": "FINT2186"
    }
}
```

{% endtab %}
{% endtabs %}

## Create a Borrower Account

<mark style="color:green;">`POST`</mark> `https://sandbox-api1117v2.fint.ng/v1/payroll/createborrower`

This endpoint allows you to create a new borrower account

#### Headers

| Name          | Type   | Description                            |
| ------------- | ------ | -------------------------------------- |
| Client-Id     | string | Client Id issued to the aggregator     |
| Client-Secret | string | Client Secret issued to the aggregator |

#### Request Body

| Name                | Type   | Description                                                       |
| ------------------- | ------ | ----------------------------------------------------------------- |
| phone               | string | This is the Phone number of the borrower                          |
| address             | string | This is the home  address of the borrower                         |
| fint\_company\_code | string | This is a unique code assigned to a company upon profile creation |
| card\_number        | string | This is the card number of the borrower                           |
| bvn                 | string | This is the bvn of the borrower                                   |
| email               | string | This is the email address of the borrower                         |
| l\_name             | string | This is the Lastname of the borrower                              |
| f\_name             | string | This is the First name of the borrower                            |

{% tabs %}
{% tab title="200 Cake successfully retrieved." %}

```
{
    "status": true,
    "msg": "Registration Successful",
    "data": {
        "borrower_id": 156956,
        "f_name": "Alome",
        "l_name": "Daniel",
        "email": "alome@example.com",
        "bvn": "2929299399393",
        "fint_company_code": "FINT4328",
        "phone": "099299292928",
        "address": "10, Afolabi"
    }
}
```

{% endtab %}
{% endtabs %}

## Get Eligible Amount

<mark style="color:green;">`POST`</mark> `https://sandbox-api1117v2.fint.ng/v1/payroll/getloanableamount`

This endpoint is used to get how much a borrower is eligible to borrow&#x20;

#### Headers

| Name          | Type   | Description |
| ------------- | ------ | ----------- |
| Client-Id     | string |             |
| Client-Secret | string |             |

#### Request Body

| Name                | Type   | Description                                                                                              |
| ------------------- | ------ | -------------------------------------------------------------------------------------------------------- |
| salary\_history     | number | The is the number of months a borrower has collected a salary from the present company on your platform  |
| borrower\_id        | string | This is the ID of the Borrower                                                                           |
| salary\_date        | string | This is the expected salary date of the borrower in this format DD                                       |
| tenure              | number | This is the proposed loan duration                                                                       |
| salary              | number | This is the current salary of the borrower                                                               |
| fint\_company\_code | string | This is the FINT company code provided when creating the company profile this current borrower works for |

{% tabs %}
{% tab title="200 amountloanable is the eligible amount the borrower can loan at the moment" %}

```
{
    "status": true,
    "message": "Loanable Amount Computed Successfully",
    "data": {
        "borrower_id": 156955,
        "amountLoanable": 44642.85714285714,
        "email": "alome@fint.ng",
        "f_name": "Alome",
        "l_name": "Daniel"
    }
}
```

{% endtab %}
{% endtabs %}

## Request Loan

<mark style="color:green;">`POST`</mark> `https://sandbox-api1117v2.fint.ng/v1/payroll/requestloan`

#### Headers

| Name          | Type   | Description |
| ------------- | ------ | ----------- |
| Client-Id     | string |             |
| Client-Secret | string |             |

#### Request Body

| Name                | Type   | Description                                                                                              |
| ------------------- | ------ | -------------------------------------------------------------------------------------------------------- |
| borrower\_id        | string | This is the ID of the borrower                                                                           |
| salary\_date        | string | This is the expected salary date of the borrower in this format DD                                       |
| tenure              | number | This is the proposed loan duration                                                                       |
| salary              | string | This is the current salary of the borrower                                                               |
| fint\_company\_code | string | This is the FINT company code provided when creating the company profile this current borrower works for |
| amount              | string | This is the amount the borrower wants to loan                                                            |

{% tabs %}
{% tab title="200 " %}

```
{
    "status": true,
    "message": "Loan Requested Successfully",
    "data": {
        "borrower_id": 156955,
        "total_return": 52000,
        "amountLoanable": 44642.85714285714,
        "email": "alome@fint.ng",
        "f_name": "Alome",
        "l_name": "Daniel"
    }
}
```

{% endtab %}
{% endtabs %}

## Fetch Borrower Loan History

<mark style="color:green;">`POST`</mark> `https://sandbox-api1117v2.fint.ng/v1/payroll/fetchborrowerloans`

This Endpoint is used to fetch  a borrower loan history

#### Headers

| Name          | Type   | Description |
| ------------- | ------ | ----------- |
| Client-Id     | string |             |
| Client-Secret | string |             |

#### Request Body

| Name         | Type   | Description                    |
| ------------ | ------ | ------------------------------ |
| borrower\_id | string | This is the ID of the borrower |

{% tabs %}
{% tab title="200 " %}

```
{
    "status": true,
    "message": "Loans Fetched",
    "data": {
        "loans": [
            {
                "id": 144176,
                "borrower": 156955,
                "borrower_risk_score": null,
                "loan_grade": null,
                "purpose_tag": "Equipment Purchase",
                "interest_rate": "4",
                "term": 3,
                "term_format": "MONTHS",
                "time_elapsed": 0,
                "amount": 50000,
                "funded_amount": 50000,
                "funding_time_elapsed": 0,
                "number_of_investors": 1,
                "date_created": "2021-03-26 05:41:35",
                "write_up": null,
                "date_disbursed": "0000-00-00 00:00:00",
                "disbursed": 1,
                "payback_due": 52000,
                "payback_amount": 0,
                "active": 1,
                "bank_stat_verified": 0,
                "home_address_verified": 0,
                "work_address_verified": 0,
                "salary_verified": 0,
                "title": "Payroll Loan",
                "status": 1,
                "date_deleted": "0000-00-00 00:00:00",
                "insured": 0,
                "disb_clear": 1,
                "date_disb_clear": "0000-00-00 00:00:00",
                "product_id": 2,
                "in_default": 0,
                "declined": 0,
                "declined_msg": null,
                "repaid_loans_by_borrower_count": 1,
                "purpose_slug": "equipment_purchase"
            }
            
            
                   ]
    }
}
```

{% endtab %}
{% endtabs %}

## Upload Borrower Document

<mark style="color:green;">`POST`</mark> `https://sandbox-api1117v2.fint.ng/v1/payroll/uploadborrowerdoc`

This endpoint is used for uploading the borrower's Document like a ID card government-issued ID card (Not expired)

#### Headers

| Name          | Type   | Description |
| ------------- | ------ | ----------- |
| Client-Id     | string |             |
| Client-Secret | string |             |

#### Request Body

| Name         | Type   | Description                                            |
| ------------ | ------ | ------------------------------------------------------ |
| file         | object | This is the selected borrower document (Id card).      |
| borrower\_id | string | This is the borrower\_id                               |
| description  | string | This is a brief description of the file to be uploaded |

{% tabs %}
{% tab title="200 " %}

```
```

{% endtab %}
{% endtabs %}

| Allowed File Type    | Max Size |
| -------------------- | -------- |
| Images (.png, .jpeg) | 5MB      |
| PDFs                 | 5MB      |

## Fetch Terms and Services

<mark style="color:blue;">`GET`</mark> `https://sandbox-api1117v2.fint.ng/v1/payroll/common/fetchterm`

{% tabs %}
{% tab title="200 " %}

```
{
    "status": true,
    "msg": "Terms Fetched  Successfully",
    "data": {
        "title": "Terms",
        "description": "This is a sample terms and service"
    }
}
```

{% endtab %}
{% endtabs %}
