> 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/school-fees-insurance/school-fees-policy.md).

# School Fees Policy

## Initiate School Fees Policy

## This method initiates the creation of a School Fees Insurance Policy.

<mark style="color:green;">`POST`</mark> `https://sandbox.insurpass.com/api/merchant/initiate_school_fee_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                                                                        |
| -------------------------------------------------------- | ------------------ | ---------------------------------------------------------------------------------- |
| id<mark style="color:red;">\*</mark>                     | String             | id from the product, this should be gotten from the product lists                  |
| last\_name<mark style="color:red;">\*</mark>             | String             | Principal Customer's surname - Ezedibia                                            |
| phone\_number<mark style="color:red;">\*</mark>          | numeric\|digits:11 | Principal Customer's phone number - 08102223475 (**digits:11)**                    |
| 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                                         |
| trustee\_first\_name<mark style="color:red;">\*</mark>   | String             | First name of the trustee - Favour                                                 |
| trustee\_last\_name<mark style="color:red;">\*</mark>    | String             | Last name of the Trustee - Valentia                                                |
| trustee\_phone\_number<mark style="color:red;">\*</mark> | numeric\|digits:11 | Phone number of the truste - 09800098756                                           |
| trustee\_email<mark style="color:red;">\*</mark>         | email              | Trustee's email address -**<email@domain.com>**                                    |
| frequency<mark style="color:red;">\*</mark>              | String             |                                                                                    |
| frequency\_type<mark style="color:red;">\*</mark>        | String             |                                                                                    |
| product\_id<mark style="color:red;">\*</mark>            | String             |                                                                                    |
| beneficiary\_lastname                                    | String             | The lastname of the Beneficiary - **Hugh**                                         |
| beneficiary\_firstname                                   | String             | The firstname of the Beneficiary - **Jackman**                                     |
| beneficiary\_address                                     | String             | The address of the Beneficiary-  **No 1, 19th Avenue.**                            |
| beneficiary\_gender                                      | String             | The gender of the Beneficiary-  **Male/Female.**                                   |
| beneficiary\_dob                                         | String             | The Date of Birth of the Beneficiary **1999-01-01**                                |
| bbeneficiary\_phone\_number                              | Number             | The phone number of the Beneficiary - **08102223475** (**digits:11)**              |
| beneficiary\_email                                       | email              | The email of the Beneficiary -  **<email@domain.com>**                             |
| beneficiary\_institution\_name                           | String             | The Educational Institution of the Beneficiary - **Lagos State University**        |
| beneficiary\_institution\_address                        | String             | The Educational Institution's address of the Beneficiary  - **No 1, 19th Avenue.** |
| id\_url                                                  | String             | The Educational Institution's url of the Beneficiary  - **<http://lagos.edu.ng>**  |
| id\_type                                                 | String             | The ID type of the Beneficiary  - **voters\_card**                                 |
| id\_number                                               | String             | The ID number of the Beneficiary  - **t353363534**                                 |

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

```javascript
{
   "success":true,
   "data":{
      "token":"IDP163446435012295714"
   },
   "response_message":"School fee 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_school_fee_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": "milly-Bobby",
            "last_name": "Brown",
            "phone_number": "09076567875",
            "email": "email@gmail.com",
            "gender": "male",
            "product_id": 2,
            "trustee_first_name": "fsfs",
            "trustee_last_name": "Sala",
            "trustee_phone_number" : "08031543234",
            "trustee_email" : "salamikolawole@gmail.com",
            "frequency_type": "monthly",
            "frequency" : 30,
            "beneficiary_firstname":"Salami",
            "beneficiary_lastname":"Kolawole",
            "beneficiary_address":"12 Akinsanmi street Obanikoro",
            "beneficiary_gender":"male",
            "beneficiary_dob":"1995-04-12",
            "beneficiary_phone_number":"08034763234",
            "beneficiary_email":"salamikolawole@gmail.com",
            "beneficiary_institution_name":"Lagos State University",
            "beneficiary_institution_address":"Lagos Ojo",
            "id_number":"t353363534",
            "id_url":"http://lagos.edu.ng",
            "id_type":"voters_card"
}',
  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({
  "first_name": "milly-Bobby",
  "last_name": "Brown",
  "phone_number": "09076567875",
  "email": "email@gmail.com",
  "gender": "male",
  "product_id": 2,
  "trustee_first_name": "fsfs",
  "trustee_last_name": "Sala",
  "trustee_phone_number": "08031543234",
  "trustee_email": "salamikolawole@gmail.com",
  "frequency_type": "monthly",
  "frequency": 30,
  "beneficiary_firstname": "Salami",
  "beneficiary_lastname": "Kolawole",
  "beneficiary_address": "12 Akinsanmi street Obanikoro",
  "beneficiary_gender": "male",
  "beneficiary_dob": "1995-04-12",
  "beneficiary_phone_number": "08034763234",
  "beneficiary_email": "salamikolawole@gmail.com",
  "beneficiary_institution_name": "Lagos State University",
  "beneficiary_institution_address": "Lagos Ojo",
  "id_number": "t353363534",
  "id_url": "http://lagos.edu.ng",
  "id_type": "voters_card"
});

var config = {
  method: 'post',
  url: 'https://sandbox.insurpass.com/api/merchant/initiate_school_fee_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_school_fee_policy' \
--header 'Authorization: Bearer {{SECRETKEY}}' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data-raw '{
  "first_name": "milly-Bobby",
  "last_name": "Brown",
  "phone_number": "09076567875",
  "email": "email@gmail.com",
  "gender": "male",
  "product_id": 2,
  "trustee_first_name": "fsfs",
  "trustee_last_name": "Sala",
  "trustee_phone_number": "08031543234",
  "trustee_email": "salamikolawole@gmail.com",
  "frequency_type": "monthly",
  "frequency": 30,
  "beneficiary_firstname": "Salami",
  "beneficiary_lastname": "Kolawole",
  "beneficiary_address": "12 Akinsanmi street Obanikoro",
  "beneficiary_gender": "male",
  "beneficiary_dob": "1995-04-12",
  "beneficiary_phone_number": "08034763234",
  "beneficiary_email": "salamikolawole@gmail.com",
  "beneficiary_institution_name": "Lagos State University",
  "beneficiary_institution_address": "Lagos Ojo",
  "id_number": "t353363534",
  "id_url": "http://lagos.edu.ng",
  "id_type": "voters_card"
}'
```

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

## Verify School Fees Policy

## This endpoints sends a token that verifies the creation of a School Fee Insurance policy.

<mark style="color:green;">`POST`</mark> `https://sandbox.insurpass.comapi/merchant/verify_school_fee_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": "School fee policy was created successfully",
    "response_code": "",
    "data": {
        "policy_number": "UIC/RE/INP/SFP/20102022/81671",
        "trustee_fullname": " fsfs  Sala ",
        "trustee_phone_number": "08031543234",
        "trustee_email": "salamikolawole@gmail.com",
        "frequency_type": "monthly",
        "frequency": 30,
        "status": true,
        "product_code": "SFP",
        "deleted_at": null,
        "created_at": "2022-10-20T11:25:19.000000Z",
        "updated_at": "2022-10-20T11:25:40.000000Z",
        "start_date": "2022-10-20T11:25:39.997124Z",
        "end_date": "2023-10-19T11:25:39.997143Z"
    }
}
```

{% 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_school_fee_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_school_fee_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.comapi/merchant/verify_school_fee_policy' \
--header 'Authorization: Bearer {{SECRETKEY}}' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data-raw '{
  "token": "IDP163438169412711526"
}'
```

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

## List All School Fees Policies

## This endpoint returns a list of all the school fees insurance policies

<mark style="color:blue;">`GET`</mark> `https://sandbox.insurpass.comapi/merchant/get_merchant_shop_insure_policies`

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

```javascript
{
   "success":true,
   "data":[
      {
         "id":"15",
         "trustee_first_name":"Salami",
         "trustee_last_name":"Oluwole",
         "trustee_phone_number":"08034543543",
         "trustee_email":"salamikolawole989@gmail.com",
         "frequency":12,
         "frequency_type":"yearly",
         "status":"activated",
         "policy_number":"TG52622977"
      }
   ],
   "response_message":"School fee policies 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/get_merchant_shop_insure_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-school-fee-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.comapi/merchant/get_merchant_shop_insure_policies' \
--header 'Authorization: Bearer {{SECRETKEY}}' \
--header 'Accept: application/json' \
--data-raw ''
```

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

## **School Fees Policy Details**

## This endpoint returns an object containing a single School Fees Policy&#x20;

<mark style="color:green;">`POST`</mark> `https://sandbox.insurpass.com/api/merchant/school_fee_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,
   "data":{
      "trustee_first_name":"Salami",
      "trustee_last_name":"Oluwole",
      "trustee_phone_number":"08034543543",
      "trustee_email":"salamikolawole989@gmail.com",
      "frequency":12,
      "frequency_type":"yearly",
      "status":"activated",
      "policy_number":"TG52622977",
      "start_date":"2021-10-16"
   },
   "response_message":"Device Policy 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/school_fee_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/school-fee-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/school_fee_policy_details' \
--header 'Authorization: Bearer {{SECRETKEY}}' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data-raw '{"policy_number":"UIC/RE/INP/SI/30092022/79187"}'
```

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