> For the complete documentation index, see [llms.txt](https://milonics.gitbook.io/api-documentation/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://milonics.gitbook.io/api-documentation/insurpass-api-reference/keke-insurance/keke-policy.md).

# Keke Policy

## Initiate Keke Policy

## This endpoint initiates the creation of a keke insurance policy.

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

This method initiates the creation of a keke insurance policy, it returns a token which must then be verified before the policy can be created successfully.

#### Headers

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

#### Request Body

| Name                                                  | Type               | Description                                           |
| ----------------------------------------------------- | ------------------ | ----------------------------------------------------- |
| first\_name<mark style="color:red;">\*</mark>         | String             | Principal customer's first name                       |
| last\_name<mark style="color:red;">\*</mark>          | String             | Principal customer's surname                          |
| phone\_number<mark style="color:red;">\*</mark>       | numeric\|digits:11 | Principal customer's phone number. 09812348459        |
| email<mark style="color:red;">\*</mark>               | email              | Principal customer's email address <email@domain.com> |
| gender<mark style="color:red;">\*</mark>              | String             | Principal customer's gender. female, male             |
| address<mark style="color:red;">\*</mark>             | String             | Principal customer's house address                    |
| relationship<mark style="color:red;">\*</mark>        | String             |                                                       |
| variant\_type<mark style="color:red;">\*</mark>       | options            | **confaam,no-shaking,carry-go,jeje**                  |
| amount\_insured<mark style="color:red;">\*</mark>     | numeric            | amont of money insured. 500,000                       |
| identity<mark style="color:red;">\*</mark>            | String             |                                                       |
| nok\_surname<mark style="color:red;">\*</mark>        | String             | Next of kin surname                                   |
| nok\_othernames<mark style="color:red;">\*</mark>     | String             | Next of kin other names                               |
| nok\_relationship<mark style="color:red;">\*</mark>   | String             | Relationship with next of kin                         |
| nok\_gender<mark style="color:red;">\*</mark>         | String             | nxt of kin gender - female, male                      |
| nok\_phone\_no<mark style="color:red;">\*</mark>      | numeric\|digits:11 | next of kin phone number. 0812345678                  |
| nok\_email\_address<mark style="color:red;">\*</mark> | email              | next of kin email address - <email@domain.com>        |
| product\_id<mark style="color:red;">\*</mark>         | numeric            | unique number used to identify keke policy. - 3       |
| id\_url<mark style="color:red;">\*</mark>             | String             | image url of id - <https://picsum.photos/>            |
| id\_type<mark style="color:red;">\*</mark>            | options            | **nin,voters\_card,drivers\_license,intl\_passport**  |
| id\_number<mark style="color:red;">\*</mark>          | numeric            | id number.                                            |

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

```javascript
{
   "success":true,
   "data":{
      "token":"IDP163446435012295714"
   },
   "response_message":"Keke policy initiated successfully",
   "response_code":""
}
```

{% endtab %}
{% endtabs %}

{% tabs %}
{% tab title="PHP" %}
{% code overflow="wrap" lineNumbers="true" %}

```php
<?php
$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://sandbox.insurpass.com/api/merchant/initiate_keke_pass_policy',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'POST',
  CURLOPT_POSTFIELDS =>'{
  "first_name": "James",
  "last_name": "Robert",
  "phone_number": "08045754345",
  "email": "idukpaye@mailinator.com",
  "gender": "male",
  "address": "main street",
  "relationship": "brother",
  "amount_insured": 6000,
  "identity": "str",
  "nok_surname": "John",
  "nok_othernames": "Doe",
  "nok_relationship": "Brother",
  "nok_gender": "Male",
  "nok_phone_no": "09034543643",
  "nok_email_address": "jdoe@insurpass.com",
  "product_id":2,
  "id_url":"https://gmail.com",
  "id_number":"2424253642",
  "id_type":"nin"
}
',
  CURLOPT_HTTPHEADER => array(
    'Authorization: Bearer {{SECRETKEY}}',
    'Content-Type: application/json'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;initiate_keke_pass_policy
```

{% endcode %}
{% endtab %}

{% tab title="NODE JS" %}
{% code overflow="wrap" lineNumbers="true" %}

```javascript
var axios = require('axios');
var data = JSON.stringify({
  "first_name": "James",
  "last_name": "Robert",
  "phone_number": "08045754345",
  "email": "idukpaye@mailinator.com",
  "gender": "male",
  "address": "main street",
  "relationship": "brother",
  "amount_insured": 6000,
  "identity": "str",
  "nok_surname": "John",
  "nok_othernames": "Doe",
  "nok_relationship": "Brother",
  "nok_gender": "Male",
  "nok_phone_no": "09034543643",
  "nok_email_address": "jdoe@insurpass.com",
  "product_id":2,
  "id_url":"https://gmail.com",
  "id_number":"2424253642",
  "id_type":"nin"
}
);

var config = {
  method: 'post',
  url: 'https://sandbox.insurpass.com/api/merchant/initiate_keke_pass_policy',
  headers: { 
    'Authorization': 'Bearer {{SECRETKEY}}', 
    'Content-Type': 'application/json'
  },
  data: data
};

axios(config)
.then(function (response) {
  console.log(JSON.stringify(response.data));
})
.catch(function (error) {
  console.log(error);
});
```

{% endcode %}
{% endtab %}

{% tab title="CURL" %}
{% code overflow="wrap" %}

```clike
curl --location --request POST https://sandbox.insurpass.com/api/merchant/initiate_keke_pass_policy' \
--header 'Authorization: Bearer {{SECRETKEY}}' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data-raw '{
  "first_name": "James",
  "last_name": "Robert",
  "phone_number": "08045754345",
  "email": "idukpaye@mailinator.com",
  "gender": "male",
  "address": "main street",
  "relationship": "brother",
  "amount_insured": 6000,
  "identity": "str",
  "nok_surname": "John",
  "nok_othernames": "Doe",
  "nok_relationship": "Brother",
  "nok_gender": "Male",
  "nok_phone_no": "09034543643",
  "nok_email_address": "jdoe@insurpass.com",
  "product_id":2,
  "id_url":"https://gmail.com",
  "id_number":"2424253642",
  "id_type":"nin"
}'
```

{% endcode %}
{% endtab %}
{% endtabs %}

## **Verify  Keke Policy**

## This endpoint sends a token that verifies the creation of a keke insurance policy.

<mark style="color:green;">`POST`</mark> `https://sandbox.insurpass.com/api/merchant/verify_keke_pass_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                |

#### Request Body

| Name                                    | Type   | Description                                                                   |
| --------------------------------------- | ------ | ----------------------------------------------------------------------------- |
| token<mark style="color:red;">\*</mark> | String | Note that after 15 minutes, the token expires and you will need to reinitiate |

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

```javascript
{
    "success": true,
    "response_message": "Keke pass policy was created successfully",
    "response_code": "",
    "data": {
        "id": 58,
        "variant_type": "Malaria Care Plan Plus",
        "product_id": 2,
        "amount_insured": 600,
        "policy_number": "UIC/RE/INP/KPASS/20102022/94731",
        "nok_surname": "John",
        "nok_othernames": "Doe",
        "nok_relationship": "Brother",
        "nok_gender": "Male",
        "nok_phone_no": "09034543643",
        "nok_email": "jdoe@insurpass.com",
        "start_date": "2022-10-20T12:42:40.735549Z",
        "end_date": "2023-10-19T12:42:40.735567Z",
        "status": 1,
        "product_code": "KPASS",
        "created_at": "2022-10-20T12:42:28.000000Z",
        "updated_at": "2022-10-20T12:42:40.000000Z",
        "product": {
            "id": 2,
            "name": "Malaria Care Plan Plus",
            "details": "<p><strong>Malaria Care Plus Plan</strong></p><p>The Malaria Care Plus Plan provides customers with malaria test and treatment at over 1700 partner pharmacies nationwide, hospital expense reimbursement to treat any illness, and a life insurance benefit.</p><p><strong><br></strong></p><p><strong>Benefits&nbsp;</strong></p><p></p><ul><li>Quality malaria test and drugs.</li><li>The customer gets one treatment per month.</li><li>Zero waiting time at partner pharmacies.</li><li>4 days waiting period after payment.</li><li>Upon the demise of a customer, the Malaria Care Plus Plan pays the customer's beneficiary a life insurance benefit of #100,000.</li><li>If the customer falls ill and is admitted to a hospital for two or more nights, this plan pays the customer a hospital expense reimbursement of #20,000&nbsp;</li></ul><p></p><p><strong>Futuristic Benefits</strong>&nbsp;</p><p></p><ul><li>Regular blood pressure checks&nbsp;</li><li>Diabetics screening&nbsp;</li><li>Chat with a health professional on your phone</li></ul><p></p><p><strong>Price&nbsp;</strong></p><p><span style=\"font-weight: var(--bs-body-font-weight); text-align: var(--bs-body-text-align);\">The Malaria Care Plus plan costs #600 per month per customer</span><br></p>",
            "beneficiaries": true,
            "max_beneficiaries": 3,
            "provider_id": 1,
            "logo_url": "logo.png",
            "enable": true,
            "created_at": "2022-04-06T14:01:52.000000Z",
            "updated_at": "2022-04-09T09:25:57.000000Z",
            "service_id": 1,
            "product_class_id": 0
        }
    }
}
```

{% endtab %}
{% endtabs %}

{% hint style="info" %}
The Initiate token expires in 15 minutes, and if a user does not verify his/her subscription after 15 minutes of initiation, the details of the subscription will be deleted.
{% endhint %}

{% tabs %}
{% tab title="PHP" %}
{% code overflow="wrap" lineNumbers="true" %}

```php
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://sandbox.insurpass.com/api/merchant/verify_keke_pass_policy',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'POST',
  CURLOPT_POSTFIELDS =>'{
    "token": "IDP1664732927341151853"
}',
  CURLOPT_HTTPHEADER => array(
    'Authorization: Bearer {{SECRETKEY}}',
    'Content-Type: application/json'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
```

{% endcode %}
{% endtab %}

{% tab title="NODE JS" %}
{% code overflow="wrap" lineNumbers="true" %}

```javascript
var axios = require('axios');
var data = JSON.stringify({
    "token": "IDP1664732927341151853"
});

var config = {
  method: 'post',
  url: 'https://sandbox.insurpass.com/api/merchant/verify_keke_pass_policy',
  headers: { 
    'Authorization': 'Bearer {{SECRETKEY}}', 
    'Content-Type': 'application/json'
  },
  data: data
};

axios(config)
.then(function (response) {
  console.log(JSON.stringify(response.data));
})
.catch(function (error) {
  console.log(error);
});
```

{% endcode %}
{% endtab %}

{% tab title="CURL" %}
{% code overflow="wrap" %}

```clike
curl --location --request POST https://sandbox.insurpass.com/api/merchant/verify_keke_pass_policy' \
--header 'Authorization: Bearer {{SECRETKEY}}' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data-raw '{
  "token": "IDP163446435012295714"
}'
```

{% endcode %}
{% endtab %}
{% endtabs %}

## List All Keke Policies

## This endpoint returns a list of all the keke insurance polices.

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

#### Headers

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

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

```javascript
{
   "success":true,
   "response_message":"Policies retrieved successfully",
   "response_code":"",
   "data":[
      {
         "email":"salami@gmail.com",
         "first_name":"required|string",
         "surname":"required|string",
         "id":17,
         "amount_insured":6000,
         "variant_type":"confaam",
         "policy_number":"INS1646729784609"
      }
   ]
}
```

{% endtab %}
{% endtabs %}

{% tabs %}
{% tab title="PHP" %}
{% code overflow="wrap" lineNumbers="true" %}

```php
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://sandbox.insurpass.com/api/merchant/merchant_keke_pass_policies',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'GET',
  CURLOPT_HTTPHEADER => array(
    'Authorization: Bearer {{SECRETKEY}}'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
```

{% endcode %}
{% endtab %}

{% tab title="NODE JS" %}
{% code overflow="wrap" lineNumbers="true" %}

```javascript
var axios = require('axios');
var data = '';

var config = {
  method: 'get',
  url: 'https://sandbox.insurpass.com/api/merchant/merchant_keke_pass_policies',
  headers: { 
    'Authorization': 'Bearer {{SECRETKEY}}'
  },
  data: data
};
axios(config)
.then(function (response) {
  console.log(JSON.stringify(response.data));
})
.catch(function (error) {
  console.log(error);
});
```

{% endcode %}
{% endtab %}

{% tab title="CURL" %}
{% code overflow="wrap" %}

```clike
curl --location --request GET https://sandbox.insurpass.com/api/merchant/merchant_keke_pass_policies' \
--header 'Authorization: Bearer {{SECRETKEY}}' \
--header 'Accept: application/json' \
--data-raw ''
```

{% endcode %}
{% endtab %}
{% endtabs %}

## Keke Policy **Details**

## This endpoint  returns an object containing a single keke policy&#x20;

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

#### 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: OK " %}

```javascript
{
   "success":true,
   "response_message":"Policy details retrieved successfully",
   "response_code":"",
   "data":{
      "id":17,
      "variant_type":"confaam",
      "product_id":2,
      "amount_insured":6000,
      "policy_number":"INS1646729784609",
      "nok_surname":"required|string",
      "nok_othernames":"required|string",
      "nok_relationship":"required|string",
      "nok_gender":"required|string",
      "nok_phone_no":"09034543643",
      "nok_email":"sala@gmi.com",
      "status":"activated",
      "created_at":null,
      "updated_at":null,
      "product":{
         "id":2,
         "name":"confaam",
         "details":"This is a depe",
         "beneficiaries":false,
         "max_beneficiaries":5,
         "provider_id":1,
         "logo_url":null,
         "enable":true,
         "created_at":"2022-02-24T10:01:42.000000Z",
         "updated_at":"2022-02-24T09:14:21.000000Z",
         "service_id":3
      },
      "user":{
         "first_name":"required|string",
         "middle_name":null,
         "surname":"required|string",
         "phone_no":"08045754345",
         "email":"salami@gmail.com",
         "address":null,
         "gender":"male",
         "date_of_birth":null,
         "created_at":"2022-03-08T08:29:42.000000Z",
         "updated_at":"2022-03-08T08:29:42.000000Z"
      }
   }
}
```

{% endtab %}
{% endtabs %}

{% tabs %}
{% tab title="PHP" %}
{% code overflow="wrap" lineNumbers="true" %}

```php
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://sandbox.insurpass.com/api/merchant/keke_policy_details',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'POST',
  CURLOPT_POSTFIELDS =>'{"policy_number":"UIC/RE/INP/SI/30092022/79187"}',
  CURLOPT_HTTPHEADER => array(
    'Authorization: Bearer {{SECRETKEY}}',
    'Content-Type: application/json'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
```

{% endcode %}
{% endtab %}

{% tab title="NODE JS" %}
{% code overflow="wrap" lineNumbers="true" %}

```javascript
var axios = require('axios');
var data = JSON.stringify({"policy_number":"UIC/RE/INP/SI/30092022/79187"});

var config = {
  method: 'post',
  url: 'https://sandbox.insurpass.com/api/merchant/keke_policy_details',
  headers: { 
    'Authorization': 'Bearer {{SECRETKEY}}', 
    'Content-Type': 'application/json'
  },
  data: data
};

axios(config)
.then(function (response) {
  console.log(JSON.stringify(response.data));
})
.catch(function (error) {
  console.log(error);
});
```

{% endcode %}
{% endtab %}

{% tab title="CURL" %}
{% code overflow="wrap" %}

```clike
curl --location --request POST https://sandbox.insurpass.com/api/merchant/keke_policy_details' \
--header 'Authorization: Bearer {{SECRETKEY}}' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data-raw '{
  "policy_number": "UIC/RE/INP/KPASS/20102022/94731"
}'
```

{% endcode %}
{% endtab %}
{% endtabs %}

## Keke Policy Quote

## &#x20;The endpoint return a quote for a keke policy.

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

#### 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 |
| --------------------------------------------- | ------- | ----------- |
| product\_id<mark style="color:red;">\*</mark> | numeric |             |

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

```javascript
{
   "success":true,
   "data":{
      "premium":3500
   },
   "response_message":"Quote retrieved successfully",
   "response_code":""
}
```

{% endtab %}
{% endtabs %}

{% tabs %}
{% tab title="PHP" %}
{% code overflow="wrap" lineNumbers="true" %}

```php
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://sandbox.insurpass.com/api/merchant/keke_get_policy_quote',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'POST',
  CURLOPT_POSTFIELDS =>'{"product_id":"26"}',
  CURLOPT_HTTPHEADER => array(
    'Authorization: Bearer {{SECRETKEY}}',
    'Content-Type: application/json'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
```

{% endcode %}
{% endtab %}

{% tab title="NODE JS" %}
{% code overflow="wrap" lineNumbers="true" %}

```javascript
var axios = require('axios');
var data = JSON.stringify({"product_id":"26"});

var config = {
  method: 'post',
  url: 'https://sandbox.insurpass.com/api/merchant/keke_get_policy_quote',
  headers: { 
    'Authorization': 'Bearer {{SECRETKEY}}', 
    'Content-Type': 'application/json'
  },
  data: data
};

axios(config)
.then(function (response) {
  console.log(JSON.stringify(response.data));
})
.catch(function (error) {
  console.log(error);
});
```

{% endcode %}
{% endtab %}

{% tab title="CURL" %}
{% code overflow="wrap" %}

```clike
curl --location --request POST https://sandbox.insurpass.com/api/merchant/keke_get_policy_quote' \
--header 'Authorization: Bearer {{SECRETKEY}}' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data-raw '{
  "policy_number": "UIC/RE/INP/KPASS/20102022/94731"
}'
```

{% endcode %}
{% endtab %}
{% endtabs %}
