# Shop Insurance Policy

## Initiate Shop Insurance Policy

## This method initiates the creation of a Shop Insurance Policy.

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

#### Request Body

| Name                                                            | Type               | Description                                                                                      |
| --------------------------------------------------------------- | ------------------ | ------------------------------------------------------------------------------------------------ |
| number\_of\_staff<mark style="color:red;">\*</mark>             | numeric            | Number of workers in the shop - 10                                                               |
| product\_id<mark style="color:red;">\*</mark>                   | String             | The unique number that identifies comprehensive motor insurance product you're purchasig - **3** |
| email<mark style="color:red;">\*</mark>                         | email              | Principal Customer's email address -- **<email@domain.com>**                                     |
| first\_name<mark style="color:red;">\*</mark>                   | string             | Principal Customer's first name - **Favour**                                                     |
| avg\_value\_shop                                                | string             | Value of the shop - 500,000                                                                      |
| phone\_number<mark style="color:red;">\*</mark>                 | numeric\|digits:11 | Principal Customer's phone number - 08102223475                                                  |
| occupation<mark style="color:red;">\*</mark>                    | String             | Principal Customer's occupation - Product Manager                                                |
| gender<mark style="color:red;">\*</mark>                        | String             | Principal Customer's gender - female, male                                                       |
| type\_of\_goods\_sold<mark style="color:red;">\*</mark>         | String             | Type of goods sold in the shop - Jewelry                                                         |
| shop\_address<mark style="color:red;">\*</mark>                 | string             | Address where the shop is located. - 7 Oshola street, Agege, Lagos                               |
| wall\_construction\_material<mark style="color:red;">\*</mark>  | string             | The material used to build the wall of the shop - Ceramic                                        |
| last\_name<mark style="color:red;">\*</mark>                    | string             | Principal Customer's surname - Ezedibia                                                          |
| shop\_duration<mark style="color:red;">\*</mark>                | numeric            | How long the shop has been in existence - 5                                                      |
| roof\_construction\_materiall<mark style="color:red;">\*</mark> | string             | The material used to build the roof of the shop - Zinc                                           |

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

```javascript
{
   "success":true,
   "data":{
      "token":"SHIP1666260336382297565"
   },
   "response_message":"Shop Insure 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_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 => 'POST',
  CURLOPT_POSTFIELDS =>'{
   "first_name":"JK",
   "last_name":"Rollins",
   "email":"jkrollins@gmail.com",
   "gender":"Female",
   "occupation":"Medcine",
   "product_id":3,
   "type_of_goods_sold":"Big",
   "shop_duration":"4",
   "number_of_staff":5,
   "wall_construction_material":"Brick",
   "roof_construction_material":"Sheet",
   "shop_address":"12 Jk Rollins street",
   "phone_number":"08088464988"
}',
  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": "JK",
  "last_name": "Rollins",
  "email": "jkrollins@gmail.com",
  "gender": "Female",
  "occupation": "Medcine",
  "product_id": 3,
  "type_of_goods_sold": "Big",
  "shop_duration": "4",
  "number_of_staff": 5,
  "wall_construction_material": "Brick",
  "roof_construction_material": "Sheet",
  "shop_address": "12 Jk Rollins street",
  "phone_number": "08088464988"
});

var config = {
  method: 'post',
  url: 'https://sandbox.insurpass.com/api/merchant/initiate_shop_insure_policies',
  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_shop_insure_policies' \
--header 'Authorization: Bearer {{SECRETKEY}}' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data-raw '{
  "first_name": "JK",
  "last_name": "Rollins",
  "email": "jkrollins@gmail.com",
  "gender": "Female",
  "occupation": "Medicine",
  "product_id": 3,
  "type_of_goods_sold": "Big",
  "shop_duration": "4",
  "number_of_staff": 5,
  "wall_construction_material": "Brick",
  "roof_construction_material": "Sheet",
  "shop_address": "12 Jk Rollins street",
  "phone_number": "08088464988"
}'
```

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

## Verify Shop Insurance Policy

## This endpoints sends a token that verifies the creation of a Shop policy.

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

#### 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":"Shop Insure Policy verifed successfully",
   "response_code":"",
   "data":{
      "product_id":3,
      "policy_number":"UIC/RE/INP/SI/20102022/53687",
      "type_of_goods_sold":null,
      "shop_duration":3,
      "number_of_staff":4,
      "wall_construction_material":"BLOCK",
      "roof_construction_material":"zINC",
      "avg_value_shop":null,
      "shop_address":"oJO",
      "status":true,
      "start_date":"2022-03-31T00:00:00.000000Z",
      "end_date":"2022-03-31T00:00:00.000000Z",
      "deleted_at":null,
      "created_at":"2022-03-31T12:10:02.000000Z",
      "updated_at":"2022-03-31T12:10:05.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/verify_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 => 'POST',
  CURLOPT_POSTFIELDS =>'{"token":"SHIP1664573060382449756"}',
  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": "SHIP1664573060382449756"
});

var config = {
  method: 'post',
  url: 'https://sandbox.insurpass.com/api/merchant/verify_shop_insure_policies',
  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_shop_insure_policies' \
--header 'Authorization: Bearer {{SECRETKEY}}' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data-raw '{
  "token": "SHIP163438169412711526"
}'
```

{% endcode %}
{% 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 %}

## List All Shop Insurance Policies

## This endpoint returns a list of all the shop insurance products

<mark style="color:blue;">`GET`</mark> `https://sandbox.insurpass.com/api/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,
   "response_message":"Shop Insure Policy get successful",
   "response_code":[
      
   ],
   "data":[
      {
         "id":1,
         "user_id":26,
         "product_id":3,
         "merchant_id":1,
         "policy_number":"AJDHKH/DJAADAD",
         "type_of_goods_sold":null,
         "shop_duration":3,
         "number_of_staff":4,
         "wall_construction_material":"BLOCK",
         "roof_construction_material":"zINC",
         "avg_value_shop":null,
         "shop_address":"oJO",
         "status":true,
         "start_date":"2022-03-31T00:00:00.000000Z",
         "end_date":"2022-03-31T00:00:00.000000Z",
         "deleted_at":null,
         "created_at":"2022-03-31T12:10:02.000000Z",
         "updated_at":"2022-03-31T12:10:05.000000Z",
         "user":{
            "first_name":"Sakani",
            "middle_name":null,
            "surname":"Oluwakemi",
            "phone_no":"09076567875",
            "email":"email@gmail.com",
            "address":null,
            "gender":"male",
            "date_of_birth":null
         },
         "transactions":[
            {
               "id":30,
               "user_id":26,
               "amount":"5000.00",
               "product_id":3,
               "status":"pending",
               "type":"credit",
               "subscriptions_id":8,
               "merchant_user_id":null,
               "coverdor_commission":"0.00",
               "merchant_commission":"0.00",
               "transaction_ref":"SCH16475985146319137",
               "total_commission":"0.00",
               "message":null,
               "platform":null,
               "channel":"API",
               "currency":null,
               "subscription_type":"App\\Models\\SchoolFeePolicy",
               "transaction_date":null,
               "created_at":"2022-03-18T10:15:14.000000Z",
               "updated_at":"2022-03-18T10:15:14.000000Z"
            },
            {
               "id":31,
               "user_id":26,
               "amount":"5000.00",
               "product_id":3,
               "status":"pending",
               "type":"credit",
               "subscriptions_id":9,
               "merchant_user_id":null,
               "coverdor_commission":"0.00",
               "merchant_commission":"0.00",
               "transaction_ref":"SCH16476121439711639",
               "total_commission":"0.00",
               "message":null,
               "platform":null,
               "channel":"API",
               "currency":null,
               "subscription_type":"App\\Models\\SchoolFeePolicy",
               "transaction_date":null,
               "created_at":"2022-03-18T14:02:23.000000Z",
               "updated_at":"2022-03-18T14:02:23.000000Z"
            },
            {
               "id":32,
               "user_id":26,
               "amount":"5000.00",
               "product_id":3,
               "status":"pending",
               "type":"credit",
               "subscriptions_id":10,
               "merchant_user_id":null,
               "coverdor_commission":"0.00",
               "merchant_commission":"0.00",
               "transaction_ref":"SCH16476122069317166",
               "total_commission":"0.00",
               "message":null,
               "platform":null,
               "channel":"API",
               "currency":null,
               "subscription_type":"App\\Models\\SchoolFeePolicy",
               "transaction_date":null,
               "created_at":"2022-03-18T14:03:26.000000Z",
               "updated_at":"2022-03-18T14:03:26.000000Z"
            }
         ],
         "product":{
            "id":3,
            "name":"School fee bronze",
            "details":"sgsfgsfgsf",
            "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":1
         }
      }
   ]
}
```

{% 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('axio');
var data = '';

var config = {
  method: 'get',
  url: 'https://sandbox.insurpass.com/api/merchant/get_merchant_shop_insure_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/get_merchant_shop_insure_policies' \
--header 'Authorization: Bearer {{SECRETKEY}}' \
--header 'Accept: application/json' \
--data-raw ''
```

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

## Shop Insurance Policy Details

## This endpoint  returns an object containing a single Shop Insurance Policy&#x20;

<mark style="color:green;">`POST`</mark> `https://sandbox.insurpass.com/api/merchant/get_shop_insure_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":1,
      "user_id":26,
      "product_id":3,
      "merchant_id":1,
      "policy_number":"AJDHKH/DJAADAD",
      "type_of_goods_sold":null,
      "shop_duration":3,
      "number_of_staff":4,
      "wall_construction_material":"BLOCK",
      "roof_construction_material":"zINC",
      "avg_value_shop":null,
      "shop_address":"oJO",
      "status":true,
      "start_date":"2022-03-31T00:00:00.000000Z",
      "end_date":"2022-03-31T00:00:00.000000Z",
      "deleted_at":null,        
      "created_at":"2022-03-31T12:10:02.000000Z",
      "updated_at":"2022-03-31T12:10:05.000000Z",
      "user":{
         "first_name":"Sakani",
         "middle_name":null,
         "surname":"Oluwakemi",
         "phone_no":"09076567875",
         "email":"email@gmail.com",
         "address":null,
         "gender":"male",
         "date_of_birth":null,
         "password":null,
         "policy_no":null,
         "have_beneficiaries":false,
         "enable":true,
         "next_of_kin_full_name":null,
         "merchant_user_id":null,
         "user_type":"user",
         "created_at":"2022-02-24T11:35:24.000000Z",
         "updated_at":"2022-02-24T11:35:24.000000Z",
         "principal_policy_no":null,
         "nin_number":null,
         "id_url":null,
         "id_type":null,
         "profile_url":null,
         "company_id":null,
         "verify_phone":0,
         "verify_email":0,
         "town":null,
         "state_of_residence":null,
         "transaction_pin":null,
         "occupation":null
      },
      "product":{
         "id":3,
         "name":"School fee bronze",
         "details":"sgsfgsfgsf",
         "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":1
      }
   }
}
```

{% 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_shop_insure_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/get_shop_insure_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/get_shop_insure_policy_details' \
--header 'Authorization: Bearer {{SECRETKEY}}' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data-raw '{
  "policy_number": "UIC/RE/INP/SI/20102022/53687"
}'
```

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

## Retrieve Shop Insurance Report

## This endpoint returns an object containing a merchant's number of policies and claims

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

This endpoint returns an object containing a merchant's number of policies and claims for the shop insurance product.

#### 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,
   "response_message":"Shop Insure policy report get successful",
   "response_code":"",
   "data":{
      "no_of_policy":34,
      "no_of_claim":0
   }
}
```

{% 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/shop_insure_policy_report',
  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('axio');
var data = '';

var config = {
  method: 'get',
  url: 'https://sandbox.insurpass.com/api/merchant/shop_insure_policy_report',
  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/shop_insure_policy_report' \
--header 'Authorization: Bearer {{SECRETKEY}}' \
--header 'Accept: application/json' \
--data-raw ''
```

{% endcode %}
{% 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/shop-insurance/shop-insurance-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.
