# Third Party Motor Policy

## Initiate Third Party Motor Policy

## This endpoint initiates the creation of a Third Party Motor insurance policy.

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

This endpoint is used to purchase the third party 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                                                                                                                                                                                                                                             |
| ------------------------------------------------------------- | ------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| first\_name<mark style="color:red;">\*</mark>                 | String             | First name of the principal customer - **Kolawole**                                                                                                                                                                                                     |
| last\_name<mark style="color:red;">\*</mark>                  | String             | Last name of the Principal customer - **Obi**                                                                                                                                                                                                           |
| phone number<mark style="color:red;">\*</mark>                | numeric\|digits:11 | Phone number of the Principal customer - **08176223567**                                                                                                                                                                                                |
| email<mark style="color:red;">\*</mark>                       | email              | Email address of the Principal customer - **<email@domain.com>**                                                                                                                                                                                        |
| gender<mark style="color:red;">\*</mark>                      | String             | Gender of the Principal customer - **female, male**                                                                                                                                                                                                     |
| product\_id<mark style="color:red;">\*</mark>                 | String             | The unique number that identifies third party motor insurance product you're purchasig - 5                                                                                                                                                              |
| vehicle\_type<mark style="color:red;">\*</mark>               | String             | Truck                                                                                                                                                                                                                                                   |
| registration\_no<mark style="color:red;">\*</mark>            | integer            | The vehicle registration number - 94422342424                                                                                                                                                                                                           |
| vehicle\_make<mark style="color:red;">\*</mark>               | String             | Toyota                                                                                                                                                                                                                                                  |
| vehicle\_model<mark style="color:red;">\*</mark>              | String             | Corona                                                                                                                                                                                                                                                  |
| year\_make<mark style="color:red;">\*</mark>                  | date\_format:Y     | The year the vehicle manufactured - 2022                                                                                                                                                                                                                |
| engine\_no<mark style="color:red;">\*</mark>                  | String             | 52WVC10338                                                                                                                                                                                                                                              |
| chasis\_no<mark style="color:red;">\*</mark>                  | String             | 002352AD                                                                                                                                                                                                                                                |
| certificate\_no<mark style="color:red;">\*</mark>             | String             | 908675689                                                                                                                                                                                                                                               |
| vehicle\_value<mark style="color:red;">\*</mark>              | numeric            | The worth of the vehicle - 200,000                                                                                                                                                                                                                      |
| vehicle\_front\_side\_image<mark style="color:red;">\*</mark> | string             | image url displaying the front side view of the vehicle - [https://images.pexels.com/photos/10840765/pexels-photo-10840765.jpeg](https://www.shutterstock.com/image-vector/realistic-speedometer-isolated-on-transparent-background-1384666046)         |
| vehicle\_back\_side\_image<mark style="color:red;">\*</mark>  | string             | imagimage url displaying the back side view of the vehicle - [https://images.pexels.com/photos/10840765/pexels-photo-10840765.jpeg](https://www.shutterstock.com/image-vector/realistic-speedometer-isolated-on-transparent-background-1384666046)e url |
| vehicle\_left\_side\_image<mark style="color:red;">\*</mark>  | string             | image url displaying the leftt side view of the vehicle - [https://images.pexels.com/photos/10840765/pexels-photo-10840765.jpeg](https://www.shutterstock.com/image-vector/realistic-speedometer-isolated-on-transparent-background-1384666046)         |
| vehicle\_right\_side\_image<mark style="color:red;">\*</mark> | string             | image url displaying the right side view of the vehicle - [https://images.pexels.com/photos/10840765/pexels-photo-10840765.jpeg](https://www.shutterstock.com/image-vector/realistic-speedometer-isolated-on-transparent-background-1384666046)         |

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

```javascript
{
   "success":true,
   "response_message":"Third Party Motor Policy verified successfully",
   "response_code":"",
   "data":{
      "product_id":4,
      "merchant_id":1,
      "frequency_type":"yearly",
      "vehicle_value":"35000",
      "vehicle_type":"truck",
      "start_date":"2022-03-16T00:00:00.000000Z",
      "end_date":"2023-03-16T00:00:00.000000Z",
      "registration_no":"4242342424",
      "vehicle_make":"toyota",
      "vehicle_model":"Camry",
      "year_make":"2002",
      "vehicle_color":"green",
      "chasis_no":"4424542242",
      "engine_no":"564647442424",
      "class_of_insurance":"",
      "certificate_no":"908675689",
      "vehicle_front_side_image":"image_url",
      "vehicle_back_side_image":"image_url",
      "vehicle_left_side_image":"image_url",
      "vehicle_right_side_image":"image_url",
      "policy_number":"UIC/HGJ/7685/GHF",
      "created_at":"2022-03-16T08:40:57.000000Z",
      "updated_at":"2022-03-16T15:50:54.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/third_party_motor_initiate_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": "Tervor",
    "last_name": "Belmont",
    "phone_number": "08045754345",
    "email": "salami@gmail.com",
    "gender": "male",
    "variant_type": "confaam",
    "amount_insured": 6000,
    "identity": "required|string",
    "product_id": "2",
    "vehicle_type": "lorry",
    "registration_no": "68656456AS",
    "vehicle_make": "toyota",
    "vehicle_model": "hilux",
    "year_make": "2007",
    "vehicle_color": "orange",
    "engine_no": "564535354786",
    "chasis_no": "8767574657",
    "engine_img": "https://image.jpg",
    "interior_img": "https://image.jpg",
    "class_of_insurance": "https://image.jpg",
    "certificate_no": "https://image.jpg",
    "vehicle_value": "80000",
    "vehicle_front_side_image": "https://image.jpg",
    "vehicle_back_side_image": "https://image.jpg",
    "vehicle_left_side_image": "https://image.jpg",
    "vehicle_right_side_image": "https://image.jpg"
}',
  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": "Tervor",
    "last_name": "Belmont",
    "phone_number": "08045754345",
    "email": "salami@gmail.com",
    "gender": "male",
    "variant_type": "confaam",
    "amount_insured": 6000,
    "identity": "required|string",
    "product_id": "2",
    "vehicle_type": "lorry",
    "registration_no": "68656456AS",
    "vehicle_make": "toyota",
    "vehicle_model": "hilux",
    "year_make": "2007",
    "vehicle_color": "orange",
    "engine_no": "564535354786",
    "chasis_no": "8767574657",
    "engine_img": "https://image.jpg",
    "interior_img": "https://image.jpg",
    "class_of_insurance": "https://image.jpg",
    "certificate_no": "https://image.jpg",
    "vehicle_value": "80000",
    "vehicle_front_side_image": "https://image.jpg",
    "vehicle_back_side_image": "https://image.jpg",
    "vehicle_left_side_image": "https://image.jpg",
    "vehicle_right_side_image": "https://image.jpg"
});

var config = {
  method: 'post',
  url: 'https://sandbox.insurpass.com/api/merchant/third_party_motor_initiate_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/third_party_motor_initiate_policy' \
--header 'Authorization: Bearer {{SECRETKEY}}' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data-raw '{
    "first_name": "Tervor",
    "last_name": "Belmont",
    "phone_number": "08045754345",
    "email": "salami@gmail.com",
    "gender": "male",
    "variant_type": "confaam",
    "amount_insured": 6000,
    "identity": "required|string",
    "product_id": "2",
    "vehicle_type": "lorry",
    "registration_no": "68656456AS",
    "vehicle_make": "toyota",
    "vehicle_model": "hilux",
    "year_make": "2007",
    "vehicle_color": "orange",
    "engine_no": "564535354786",
    "chasis_no": "8767574657",
    "engine_img": "https://image.jpg",
    "interior_img": "https://image.jpg",
    "class_of_insurance": "https://image.jpg",
    "certificate_no": "https://image.jpg",
    "vehicle_value": "80000",
    "vehicle_front_side_image": "https://image.jpg",
    "vehicle_back_side_image": "https://image.jpg",
    "vehicle_left_side_image": "https://image.jpg",
    "vehicle_right_side_image": "https://image.jpg"
}'
```

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

## Verify Third Party Motor Policy

## This endpoints sends a token that verifies the creation of a Verify Third Party Motor insurance policy.

<mark style="color:green;">`POST`</mark> `https://sandbox.insurpass.com/api/merchant/third_party_motor_verify_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 | **TPMI163438169412711526**  Note that after 15 minutes, the token expires and you will need to reinitiate |

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

```javascript
{
    "success": true,
    "response_message": "Third Party Motor Policy verified successfully",
    "response_code": "",
    "data": {
        "product_id": 2,
        "merchant_id": 1,
        "frequency_type": "yearly",
        "vehicle_value": "80000",
        "insurance_cover": null,
        "duration": null,
        "vehicle_type": "lorry",
        "start_date": "2022-10-20T00:00:00.000000Z",
        "end_date": "2023-10-19T00:00:00.000000Z",
        "registration_no": "toyota",
        "vehicle_make": "https://image.jpg",
        "vehicle_model": "hilux",
        "year_make": "2007",
        "vehicle_color": "orange",
        "chasis_no": "8767574657",
        "engine_no": "564535354786",
        "policy_number": "UIC/RE/INP/MTP/20102022/50173",
        "class_of_insurance": "https://image.jpg",
        "certificate_no": "https://image.jpg",
        "engine_img": "https://image.jpg",
        "interior_img": "https://image.jpg",
        "vehicle_front_side_image": "https://image.jpg",
        "vehicle_back_side_image": "https://image.jpg",
        "vehicle_left_side_image": "https://image.jpg",
        "vehicle_right_side_image": "https://image.jpg",
        "status": true,
        "product_code": "TPP",
        "created_at": "2022-10-20T22:31:25.000000Z",
        "updated_at": "2022-10-20T22:32:32.000000Z"
    }
}jso
```

{% 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_okada_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": "TPMI1666305085377207224"
}',
  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": "TPMI1666305085377207224"
});

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

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

## List All Third Party Motor Policies

## This endpoint returns a list of all the Third Party Motor insurance products

<mark style="color:blue;">`GET`</mark> `https://sandbox.insurpass.com/api/merchant/third_party_motor_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":"Third Party Policies retrieved successfully",
   "response_code":"",
   "data":[
      {
         "frequency_type":"yearly",
         "vehicle_type":"required|string",
         "start_date":"2022-03-16T00:00:00.000000Z",
         "end_date":"2023-03-16T00:00:00.000000Z",
         "vehicle_value":"35000",
         "policy_number":"UIC/RE/INP/MTP/16032022/32398"
      }
   ]
}
```

{% 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/third_party_motor_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/third_party_motor_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 GET https://sandbox.insurpass.com/api/merchant/third_party_motor_policies' \
--header 'Authorization: Bearer {{SECRETKEY}}' \
--header 'Accept: application/json' \
--data-raw ''
```

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

## Third Party Motor Policy Details

## This endpoint returns an object containing a single Third Party Motor Policy&#x20;

<mark style="color:green;">`POST`</mark> `https://sandbox.insurpass.com/api/merchant/third_party_get_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": "Third Party policy details successfully",
    "response_code": "",
    "data": {
        "id": 10,
        "user_id": 377,
        "product_id": 2,
        "merchant_id": 1,
        "frequency_type": "yearly",
        "vehicle_value": "80000",
        "insurance_cover": null,
        "duration": null,
        "vehicle_type": "lorry",
        "start_date": "2022-10-20T00:00:00.000000Z",
        "end_date": "2023-10-19T00:00:00.000000Z",
        "registration_no": "toyota",
        "vehicle_make": "https://image.jpg",
        "vehicle_model": "hilux",
        "year_make": "2007",
        "vehicle_color": "orange",
        "chasis_no": "8767574657",
        "engine_no": "564535354786",
        "policy_number": "UIC/RE/INP/MTP/20102022/50173",
        "class_of_insurance": "https://image.jpg",
        "certificate_no": "https://image.jpg",
        "engine_img": "https://image.jpg",
        "interior_img": "https://image.jpg",
        "vehicle_front_side_image": "https://image.jpg",
        "vehicle_back_side_image": "https://image.jpg",
        "vehicle_left_side_image": "https://image.jpg",
        "vehicle_right_side_image": "https://image.jpg",
        "status": true,
        "product_code": "TPP",
        "created_at": "2022-10-20T22:31:25.000000Z",
        "updated_at": "2022-10-20T22:32:32.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,
            "service": {
                "id": 1,
                "name": "Micro Health ",
                "description": "Micro Health",
                "status": "inactive",
                "created_at": "2022-04-06T14:01:52.000000Z",
                "updated_at": null,
                "code": "micro-health",
                "provider_id": 1,
                "logo_path": "logo.png",
                "short_description": "School Fees Protection Plan"
            }
        },
        "transactions": [
            {
                "id": 971,
                "user_id": 377,
                "amount": "600.00",
                "product_id": 2,
                "status": "successful",
                "type": "credit",
                "subscriptions_id": 10,
                "merchant_user_id": 1,
                "created_at": "2022-10-20T22:31:25.000000Z",
                "updated_at": "2022-10-20T22:32:31.000000Z",
                "merchant_commission": "12.00",
                "total_commission": "0.00",
                "message": "Payment for third party subscriptions | required|string required|string",
                "platform": "Bimacred",
                "channel": "API",
                "currency": null,
                "subscription_type": "App\\Models\\ThirdPartyMotor",
                "transaction_ref": "TPMI1666305085377207224",
                "transaction_date": null,
                "admin_id": 1,
                "provider_id": 1,
                "insurpass_commission": 0,
                "provider_amount": 588,
                "settlement_status": null
            }
        ],
        "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,
            "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-09-14T10:48:24.000000Z",
            "updated_at": "2022-09-14T10:48:24.000000Z",
            "principal_policy_no": null,
            "nin_number": "2424253642",
            "id_url": "https://gmail.com",
            "profile_url": null,
            "company_id": null,
            "verify_phone": 0,
            "verify_email": 0,
            "town": null,
            "state_of_residence": null,
            "transaction_pin": null,
            "occupation": null,
            "id_type": null
        }
    }
}
```

{% 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/third_party_get_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" %}

<pre class="language-javascript" data-overflow="wrap" data-line-numbers><code class="lang-javascript">var axios = require('axios');
var data = JSON.stringify({"policy_number":"UIC/RE/INP/SI/30092022/79187"});

var config = {
<strong>  method: 'post',
</strong>  url: 'https://sandbox.insurpass.com/api/merchant/third_party_get_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);
});
</code></pre>

{% endtab %}

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

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

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

## Third Party Motor Policy **Quote**

## &#x20;The endpoint return a quote for a Third Party Motor Policy.

<mark style="color:green;">`POST`</mark> `https://sandbox.insurpass.com/api/merchant/third_party_get_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 | The unique number that identifies credit life insurance product you're purchasig - **3** |
| vehicleValue<mark style="color:red;">\*</mark> | numeric | The worth of the vehicle - 200,000                                                       |

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

```javascript
{
   "success":true,
   "data":{
      "premium":3500
   },
   "response_message":"Third party motor 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/third_party_get_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 =>'{
  "vehicleValue":"89000",
  "product_id":"2"
}',
  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({
  "vehicleValue":"89000",
  "product_id":"2"
});

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

{% 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/motor-insurance/third-party-motor-insurance/third-party-motor-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.
