# Credit Life Policy

## Create Credit Life Policy

## CREATE CREDIT LIFE POLICY

<mark style="color:green;">`POST`</mark> `https://sandbox.insurpass.com/api/merchant/credit_life_policies`

This endpoint allows a merchant to subscribe their customers to the Credit Life Insurance Plan.

#### Headers

| Name                                            | Type   | Description                     |
| ----------------------------------------------- | ------ | ------------------------------- |
| Authorization<mark style="color:red;">\*</mark> | String | Bearer {$secret-key}/{$api-key} |
| Content-Type<mark style="color:red;">\*</mark>  | String | application/json                |

#### Request Body

| Name                                                        | Type             | Description                                                                                                                |
| ----------------------------------------------------------- | ---------------- | -------------------------------------------------------------------------------------------------------------------------- |
| borrower\_email<mark style="color:red;">\*</mark>           | string           | Principal Customer's email address -**<email@domain.com>**                                                                 |
| borrower\_first\_name<mark style="color:red;">\*</mark>     | string           | Principal Customer's first name - **Favour**                                                                               |
| borrower\_last\_name<mark style="color:red;">\*</mark>      | string           | Principal Customer's surname - Ezedibia                                                                                    |
| borrower\_bvn<mark style="color:red;">\*</mark>             | string  11-digit | Principal Customer's bvn - 22222222222                                                                                     |
| borrower\_id\_url<mark style="color:red;">\*</mark>         | string           | image url for the prinipal customer's means of ID - <https://images.pexels.com/photos/10840765/pexels-photo-10840765.jpeg> |
| borrower\_date\_of\_birth<mark style="color:red;">\*</mark> | string           | yy-mm-dd - 2022-09-12                                                                                                      |
| borrower\_phone\_number<mark style="color:red;">\*</mark>   | string           | digits - 11 - 0811234567                                                                                                   |
| borrower\_gender                                            |                  | Principal Customer's gender - Male, Female                                                                                 |
| loan\_amount<mark style="color:red;">\*</mark>              | INTEGER          | The amount Principal customer borrowed - 200,000                                                                           |
| loan\_tenor<mark style="color:red;">\*</mark>               | string           | The length of time that will be taken by the borrower to repay the loan along with the interest - **3 Months**             |
| loan\_start\_date<mark style="color:red;">\*</mark>         |                  | The first date of the loan tenor - **2022-09-12 -** Date FORMAT YYYY-MM-DD                                                 |
| loan\_interest\_rate<mark style="color:red;">\*</mark>      |                  | The interest rate of the loan - **5%**                                                                                     |
| quotation\_date<mark style="color:red;">\*</mark>           |                  | Date FORMAT YYYY-MM-DD                                                                                                     |
| loan\_end\_date<mark style="color:red;">\*</mark>           |                  | The last date of the loan tenor - **2022-09-12**                                                                           |

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

```javascript
{
    "success": true,
    "data": {
        "borrower_email": "tobi@testing.com",
        "borrower_first_name": "tobi",
        "borrower_last_name": "loba",
        "borrower_bvn": "88888888888",
        "borrower_id_url": "https://t4b-dev-api.azurewebsites.net/image_url.png",
        "borrower_date_of_birth": "1990-12-23T00:00:00.000000Z",
        "borrower_phone_number": "09098787878",
        "borrower_gender": "Male",
        "loan_amount": "200.00",
        "loan_tenor": "2 month",
        "loan_start_date": "2021-02-20T00:00:00.000000Z",
        "loan_interest_rate": 5,
        "quotation_date": "2021-12-22T00:00:00.000000Z",
        "loan_end_date": "2021-12-22T00:00:00.000000Z",
        "lender_name": "buybills",
        "merchant_id": 1,
        "updated_at": "2021-07-08T14:21:40.000000Z",
        "created_at": "2021-07-08T14:21:37.000000Z",
        "id": 1,
        "credit_life_id": "e8369d64-7db7-4555-9304-29ec27bc4f28",
        "policy_created_at": "2021-07-08 00:00:00",
        "policy_number": "TG43434941",
        "premium_amount": 2,
        "status": "Active"
    },
    "response_message": "Credit Life Policy saved successfully",
    "response_code": ""
}
```

{% endtab %}
{% endtabs %}

## Retrieve all Credit Life Policies subscribed to

## ALL CREDIT LIFE POLICIES

<mark style="color:blue;">`GET`</mark> `https://sandbox.insurpass.com/api/merchant/credit_life_policies`&#x20;

This endpoint allows a merchant to retrieve the details of every credit life insurance policy subscribed to on their platform.

#### Headers

| Name                                            | Type   | Description                     |
| ----------------------------------------------- | ------ | ------------------------------- |
| Authorization<mark style="color:red;">\*</mark> | String | Bearer {$secret-key}/{$api-key} |
| Content-Type<mark style="color:red;">\*</mark>  | String | application/json                |

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

```javascript
{
    "success": true,
    "data": {
        "current_page": 1,
        "data": [
            {
                "id": 4,
                "borrower_email": "tobi@testing.com",
                "borrower_first_name": "tobi",
                "borrower_last_name": "loba",
                "borrower_bvn": "88888888888",
                "borrower_id_url": "https://t4b-dev-api.azurewebsites.net/image_url.png",
                "borrower_date_of_birth": "1990-12-23T00:00:00.000000Z",
                "borrower_phone_number": "09098787878",
                "borrower_gender": "Male",
                "loan_amount": "200.00",
                "loan_tenor": "2 month",
                "loan_start_date": "2021-02-20T00:00:00.000000Z",
                "loan_end_date": "2021-12-22T00:00:00.000000Z",
                "loan_interest_rate": 5,
                "lender_name": "buybills",
                "merchant_id": 1,
                "quotation_date": "2021-12-22T00:00:00.000000Z",
                "policy_number": "TG27690466",
                "policy_created_at": "2021-07-08 00:00:00",
                "credit_life_id": "a802d327-871f-4ba7-94cb-85e8c174df45",
                "status": "Active",
                "premium_amount": "2.00",
                "created_at": "2021-07-08T15:00:36.000000Z",
                "updated_at": "2021-07-08T15:00:38.000000Z",
                "claims": [
                    {
                        "id": 1,
                        "claim_id": "5cf3c24e-4c63-4b7d-8689-7250618befcd",
                        "claim_number": "TGC7582803",
                        "loan_balance": "100.00",
                        "claim_created_at": "2021-07-08T15:01:02.000000Z",
                        "status": "Pending",
                        "policy_id": 4,
                        "merchant_id": 1,
                        "created_at": "2021-07-08T15:00:57.000000Z",
                        "updated_at": "2021-07-08T15:00:57.000000Z",
                        "company_id": "1a9b1e43-8946-4bb7-80d5-bbeef80ecc8e"
                    }
                ]
            },
            {
                "id": 3,
                "borrower_email": "tobi@testing.com",
                "borrower_first_name": "tobi",
                "borrower_last_name": "loba",
                "borrower_bvn": "88888888888",
                "borrower_id_url": "https://t4b-dev-api.azurewebsites.net/image_url.png",
                "borrower_date_of_birth": "1990-12-23T00:00:00.000000Z",
                "borrower_phone_number": "09098787878",
                "borrower_gender": "Male",
                "loan_amount": "200.00",
                "loan_tenor": "2 month",
                "loan_start_date": "2021-02-20T00:00:00.000000Z",
                "loan_end_date": "2021-12-22T00:00:00.000000Z",
                "loan_interest_rate": 5,
                "lender_name": "buybills",
                "merchant_id": 1,
                "quotation_date": "2021-12-22T00:00:00.000000Z",
                "policy_number": "TG38809049",
                "policy_created_at": "2021-07-08 00:00:00",
                "credit_life_id": "0d5e6a68-8d4a-4db4-b282-0b22450cdfdc",
                "status": "Active",
                "premium_amount": "2.00",
                "created_at": "2021-07-08T14:59:04.000000Z",
                "updated_at": "2021-07-08T14:59:07.000000Z",
                "claims": []
            }
        ],
        "first_page_url": "http://sandbox.insurpass.com/merchant/credit_life_policies?page=1",
        "from": 1,
        "last_page": 1,
        "last_page_url": "http://sandbox.insurpass.com/merchant/credit_life_policies?page=1",
        "next_page_url": null,
        "path": "http://sandbox.insurpass.com/merchant/credit_life_policies",
        "per_page": 15,
        "prev_page_url": null,
        "to": 4,
        "total": 4
    },
    "response_message": "Credit Life Policies retrieved successfully",
    "response_code": ""
}
```

{% endtab %}
{% endtabs %}

## Retrieve Credit Life Policy Details

## CREDIT LIFE POLICY DETAIL

<mark style="color:green;">`POST`</mark> `https://sandbox.insurpass.com/api/merchant/credit_life_policies`

This endpoint is used to get a particular customer's credit life policy detail.

#### Headers

| Name                                            | Type   | Description                     |
| ----------------------------------------------- | ------ | ------------------------------- |
| Authorization<mark style="color:red;">\*</mark> | String | Bearer {$secret-key}/{$api-key} |
| Content-Type<mark style="color:red;">\*</mark>  | String | application/json                |

#### Request Body

| Name                                             | Type   | Description                                                                        |
| ------------------------------------------------ | ------ | ---------------------------------------------------------------------------------- |
| policy\_number<mark style="color:red;">\*</mark> | String | The unique number that identifies the purchased  insurance policy - **IN98570819** |

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

```javascript
{
    "success": true,
    "data": {
        "id": 4,
        "borrower_email": "tobi@testing.com",
        "borrower_first_name": "tobi",
        "borrower_last_name": "loba",
        "borrower_bvn": "88888888888",
        "borrower_id_url": "https://t4b-dev-api.azurewebsites.net/image_url.png",
        "borrower_date_of_birth": "1990-12-23T00:00:00.000000Z",
        "borrower_phone_number": "09098787878",
        "borrower_gender": "Male",
        "loan_amount": "200.00",
        "loan_tenor": "2 month",
        "loan_start_date": "2021-02-20T00:00:00.000000Z",
        "loan_end_date": "2021-12-22T00:00:00.000000Z",
        "loan_interest_rate": 5,
        "lender_name": "buybills",
        "merchant_id": 1,
        "quotation_date": "2021-12-22T00:00:00.000000Z",
        "policy_number": "TG27690466",
        "policy_created_at": "2021-07-08 00:00:00",
        "credit_life_id": "a802d327-871f-4ba7-94cb-85e8c174df45",
        "status": "Active",
        "premium_amount": "2.00",
        "created_at": "2021-07-08T15:00:36.000000Z",
        "updated_at": "2021-07-08T15:00:38.000000Z",
        "claims": [
            {
                "id": 1,
                "claim_id": "5cf3c24e-4c63-4b7d-8689-7250618befcd",
                "claim_number": "TGC7582803",
                "loan_balance": "100.00",
                "claim_created_at": "2021-07-08T15:01:02.000000Z",
                "status": "Pending",
                "policy_id": 4,
                "merchant_id": 1,
                "created_at": "2021-07-08T15:00:57.000000Z",
                "updated_at": "2021-07-08T15:00:57.000000Z",
                "company_id": "1a9b1e43-8946-4bb7-80d5-bbeef80ecc8e"
            }
        ]
    },
    "response_message": "Credit Life Policy retrieved successfully",
    "response_code": ""
}
```

{% endtab %}
{% endtabs %}

## Terminate Credit Life Policy

## TERMINATE CREDIT LIFE POLICY

<mark style="color:orange;">`PUT`</mark> `https://sandbox.insurpass.com/api/merchant/credit_life_policies/{id}/terrminate`

This endpoint is used to terminate a customer's credit life policy.

#### Headers

| Name                                            | Type   | Description                     |
| ----------------------------------------------- | ------ | ------------------------------- |
| Authorization<mark style="color:red;">\*</mark> | String | Bearer {$secret-key}/{$api-key} |
| Content-Type<mark style="color:red;">\*</mark>  | String | application/json                |

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

```javascript
{
    "success": true,
    "data": {
        "borrower_email": "tobi@testing.com",
        "borrower_first_name": "tobi",
        "borrower_last_name": "loba",
        "borrower_bvn": "88888888888",
        "borrower_id_url": "https://t4b-dev-api.azurewebsites.net/image_url.png",
        "borrower_date_of_birth": "1990-12-23T00:00:00.000000Z",
        "borrower_phone_number": "09098787878",
        "borrower_gender": "Male",
        "loan_amount": "200.00",
        "loan_tenor": "2 month",
        "loan_start_date": "2021-02-20T00:00:00.000000Z",
        "loan_interest_rate": 5,
        "quotation_date": "2021-12-22T00:00:00.000000Z",
        "loan_end_date": "2021-12-22T00:00:00.000000Z",
        "lender_name": "buybills",
        "merchant_id": 1,
        "updated_at": "2021-07-08T14:21:40.000000Z",
        "created_at": "2021-07-08T14:21:37.000000Z",
        "id": 1,
        "credit_life_id": "e8369d64-7db7-4555-9304-29ec27bc4f28",
        "policy_created_at": "2021-07-08 00:00:00",
        "policy_number": "TG43434941",
        "premium_amount": 2,
        "status": "Terminated"
    },
    "response_message": "Credit Life Policy saved successfully",
    "response_code": ""
}
```

{% endtab %}
{% endtabs %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://milonics.gitbook.io/api-documentation/insurpass-api-reference/micro-health-insurance/credit-life-policy.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
