Policy

Insurpass' Subscription endpoints will allow a merchant (3rd party app) to sign up its customers for any of the micro-insurance plans by requesting such components via Insurpass API calls.

NOTE: If a principal customer has one beneficiary that means the number of users is two (2) and you are going to use''price_config'' for the number of users (2) respectively.

Retrieve Quoted Price

Get a quoted price

POST https://sandbox.insurpass.comapi/merchant/micro_health/get_quote

This endpoint allows a merchant to get and display the price of the micro-health insurance plan about to be subscribed to by the customer.

Headers

NameTypeDescription

Authorization*

String

Bearer {$secret-key}/{$api-key}

Content-Type*

String

application/json

Request Body

NameTypeDescription

subscription_type*

String

What type of micro-healthy insurance subscription the principal customer is purchasing - ['monthly', 'yearly', 'quarterly'].

no_of_users*

integer

Number of beneficiaries - 4

product_id*

string

The unique number that identifies which insurance product you're purchasing - 3

{
    "success": true,
    "response_message": "Quote price get successful",
    "response_code": "QOT101",
    "data": {
        "quote_price": 700
    }
}
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://sandbox.insurpass.com/api/merchant/micro_health/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 =>'{
  "no_of_users": 2,
  "subscription_type": "monthly",
  "product_id": "1"
}',
  CURLOPT_HTTPHEADER => array(
    'Authorization: Bearer {{SECRETKEY}}',
    'Content-Type: application/json'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;

Initiate Micro-Health Policy

This method initiates the creation of a Micro-Health Policy.

POST https://sandbox.insurpass.com/api/merchant/micro_health/initiate

This endpoint allows you to subscribe your customers to the Malaria care plan for the first time.

Headers

NameTypeDescription

Authorization*

string

Bearer {$secret-key}/{$api-key}

Content-Type*

String

application

Request Body

NameTypeDescription

first_name*

string

Principal Customer's first name - Favour

surname*

string

Principal Customer's surname (Last name) - Ezedibia

email*

Email

Principal Customer's email address -- email@domain.com

phone_no*

numeric|digits:11

Principal Customer's phone number - 08102223475

date_of_birth*

string

Principal Customer's date of birth - FORMAT: YYY-MM-DD

product_id*

string

The unique number that identifies micro-health insurance product you're purchasig - 3

subscription_type*

string

Accepted: ['monthly', 'quarterly' and 'yearly']

amount*

numeric

The price of the insurance policy - 200,000

nin_number*

integer

The Principal Customer's NIN - 22222222222

first_beneficiary_full_name*

string

The name of the first beneficiary added by the Principal customer

second_beneficiary_full_name*

string

The name of the second beneficiary added by the Principal Customer.

third_beneficiary_full_name*

string

The name of the third beneficiary added by the Principal Customer

id_url*

string

The URL of the Principal Customer's ID uploaded to their profile - https://images.pexels.com/photos/10840765/pexels-photo-10840765.jpeg

profile_url*

string

The URL of the Principal Customer's profile - https://images.pexels.com/photos/10840765/pexels-photo-10840765.jpeg

{
    "success": true,
    "data": {
        "token": "21c6a88014a906b6dee712c804bcd51970d321d4"
    },
    "response_message": "Insurance Policy subscription initiate Successfully",
    "response_code": "FRT008"
}
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://sandbox.insurpass.com/api/merchant/micro_health/initiate',
  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" : "bob",
    "surname" : "Bobbison",
    "email" :"email@gmail.com",
    "phone_no": "08102223475" ,
    "date_of_birth": "1999-09-09",
    "product_id" : 3,
    "subscription_type":"monthly",
    "amount" : 700,
    "nin_number" : 22222222222,
    "first_beneficiary_full_name" :"Bob Bobbison",
    "second_beneficiary_full_name" : "Bob1 Bobbison1",
    "third_beneficiary_full_name" : " Bob2 Bobbison2",
    "id_url": "https://images.pexels.com/photos/10840765/pexels-photo-10840765.jpeg",
    "profile_url" :"profile_url"
}',
  CURLOPT_HTTPHEADER => array(
    'Authorization: Bearer {{SECRETKEY}}',
    'Content-Type: application/json'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;

Verify Micro-Health Policy

This endpoints sends a token that verifies the creation of a Micro-Health Policy.

POST https://sandbox.insurpass.com/api/merchant/micro_health/verify

This endpoint allows you to verify that a customer has successfully subscribed to the Malaria care plan.

Headers

NameTypeDescription

Authorization*

String

Bearer {$secret-key}/{$api-key}

Content-Type*

String

application/json

Request Body

NameTypeDescription

token*

string

Note that after 15 minutes, the token expires and you will need to reinitiate - IDP163438169412711526

{
    "success": true,
    "data": {
        "id": 25,
        "user_id": 32,
        "product_id": 1,
        "recurring": true,
        "subscriptions_type": "monthly",
        "subscriptions_no": 1,
        "start_date": "2021-04-14T00:00:00.000000Z",
        "end_date": "2021-05-14T00:00:00.000000Z",
        "enable": 1,
        "policy_no": "2104205800051",
        "merchant_user_id": 1,
        "created_at": "2021-04-14T16:38:17.000000Z",
        "updated_at": "2021-04-14T16:38:24.000000Z",
        "active_date": "2021-04-18 00:00:00",
        "product": {
            "id": 1,
            "name": "malaria care 1",
            "details": "<p>my product details</p>",
            "beneficiaries": true,
            "max_beneficiaries": 3,
            "provider_id": 1,
            "logo_url": null,
            "enable": true,
            "created_at": "2021-03-26T22:57:33.000000Z",
            "updated_at": "2021-03-26T22:57:34.000000Z"
        }
    },
    "message": "Subscription get successful"
}

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.

<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://sandbox.insurpass.com/api/merchant/micro_health/verify',
  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":"IDP163438169412711526"
}',
  CURLOPT_HTTPHEADER => array(
    'Authorization: Bearer {{SECRETKEY}}',
    'Content-Type: application/json'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;

Renew Subscription

This endpoints renews a Micro-Health Policy.

POST https://sandbox.insurpass.com/api/merchant/micro_health/top_up

This endpoint allows you renew your customers malaria care plan subscription_

Headers

NameTypeDescription

Authorization*

String

Bearer {$secret-key}/{$api-key}

Content-Type*

String

application/json

Request Body

NameTypeDescription

amount*

numeric

Amount the micro-health insurance plan cost to purchase - 200,000

subscription_type*

string

What type of micro-healthy insurance subscription the principal customer is purchasing - ['monthly', 'yearly', 'quarterly'].

policy_no*

string

Principal customer's insurance policy number for the micro health plan. - "UIC/HGJ/7685/GHF

{
    "success": true,
    "data": {
        "id": 25,
        "user_id": 32,
        "product_id": 1,
        "recurring": true,
        "subscriptions_type": "monthly",
        "subscriptions_no": 1,
        "start_date": "2021-04-14T00:00:00.000000Z",
        "end_date": "2021-05-14T00:00:00.000000Z",
        "enable": 1,
        "policy_no": "2104205800051",
        "merchant_user_id": 1,
        "created_at": "2021-04-14T16:38:17.000000Z",
        "updated_at": "2021-04-14T16:38:24.000000Z",
        "active_date": "2021-04-18 00:00:00",
        "product": {
            "id": 1,
            "name": "malaria care 1",
            "details": "<p>my product details</p>",
            "beneficiaries": true,
            "max_beneficiaries": 3,
            "provider_id": 1,
            "logo_url": null,
            "enable": true,
            "created_at": "2021-03-26T22:57:33.000000Z",
            "updated_at": "2021-03-26T22:57:34.000000Z"
        }
    },
    "message": "Subscription renew successful"
}

The renewal of an insurance plan is dependent on the payment frequency selected by the principal customer at the point of subscription. The payment frequency could either be monthly, quarterly or annually.

<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://sandbox.insurpass.com/api/merchant/micro_health/top_up',
  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 =>'{
    "subscription_type":"monthly",
    "amount" : 200000 ,
    "policy_no":"UIC/HGJ/7685/GHF"
}',
  CURLOPT_HTTPHEADER => array(
    'Authorization: Bearer {{SECRETKEY}}',
    'Content-Type: application/json'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;

List of Micro-health Policy subscriptions

This endpoint returns a list of all the Micro-health Policy subscriptions

GET https://sandbox.insurpass.com/api/merchant/micro_health/all_subscriptions

This endpoint allows a merchant to request for the list of all subscriptions made on their platform

Headers

NameTypeDescription

Authorization*

String

Bearer {$secret-key}/{$api-key}

Content-Type*

String

application/json

{
  "success": true,
  "data": {
    "current_page": 1,
    "data": [{
      "id": 32,
      "first_name": "tobimola",
      "middle_name": null,
      "surname": "tyidewale",
      "phone_no": "02090908910",

      "email": "oyideia8dewalet@gmail.com",
      "address": null,
      "gender": null,
      "date_of_birth": "1990-06-08T00:00:00.000000Z",
      "password": null,
      "policy_no": "2104205800051",
      "have_beneficiaries": true,
      "enable": true,
      "next_of_kin_full_name": "adewalet ayuba",
      "merchant_user_id": 1,
      "user_type": "user",
      "created_at": "2021-04-14T16:38:15.000000Z",
      "updated_at": "2021-04-14T16:38:25.000000Z",
      "beneficiary": [{
          "id": 3,
          "full_name": "adewalet ayuba",
          "surname": null,
          "email": null,
          "phone_no": null,
          "address": null,
          "gender": null,
          "date_of_birth": null,
          "product_id": null,
          "user_id": 32,
          "created_at": "2021-04-14T16:38:16.000000Z",
          "updated_at": "2021-04-14T16:38:16.000000Z"
        },
        {
          "id": 4,
          "full_name": "Ayomide Taiwp",
          "surname": null,
          "email": null,
          "phone_no": null,
          "address": null,
          "gender": null,
          "date_of_birth": null,
          "product_id": null,
          "user_id": 32,
          "created_at": "2021-04-14T16:38:16.000000Z",
          "updated_at": "2021-04-14T16:38:16.000000Z"
        },
        {

          "id": 5,
          "full_name": "third beneficiary ooo",
          "surname": null,
          "email": null,
          "phone_no": null,
          "address": null,
          "gender": null,
          "date_of_birth": null,
          "product_id": null,
          "user_id": 32,
          "created_at": "2021-04-14T16:38:16.000000Z",
          "updated_at": "2021-04-14T16:38:16.000000Z"
        }
      ],
      "subscriptions": {
        "id": 25,
        "user_id": 32,
        "product_id": 1,
        "recurring": true,
        "subscriptions_type": "monthly",
        "subscriptions_no": 1,
        "start_date": "2021-04-14T00:00:00.000000Z",
        "end_date": "2021-05-14T00:00:00.000000Z",
        "enable": 1,
        "policy_no": "2104205800051",
        "merchant_user_id": 1,
        "created_at": "2021-04-14T16:38:17.000000Z",
        "updated_at": "2021-04-14T16:38:24.000000Z",
        "active_date": "2021-04-18 00:00:00"
      },
      "transactions": [{
        "id": 32,
        "user_id": 32,
        "amount": "400.00",
        "product_id": 1,
        "status": "successful",
        "type": "credit",
        "subscriptions_id": 25,
        "merchant_user_id": 0,
        "created_at": "2021-04-14T16:38:17.000000Z",
        "updated_at": "2021-04-14T16:38:17.000000Z",
        "coverdor_commission": "50.00",

        "merchant_commission": "50.00",
        "total_commission": "100.00"
      }]
    }],

    "first_page_url": "http://insurpass-
    api.test / api / merchant / all_subscriptions ? page = 1 ",

    "from" : 1,
    "last_page": 1,

    "last_page_url": "http://insurpass-
    api.test / api / merchant / all_subscriptions ? page = 1 ",

    "next_page_url" : null,
    "path": "http://insurpass-api.test/api/merchant/all_subscriptions",
    "per_page": 15,
    "prev_page_url": null,
    "to": 1,
    "total": 1
  },
  "message": "Your subscribers get successful"
}
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://sandbox.insurpass.com/api/merchant/micro_health/all_subscriptions',
  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;

A merchant can request all subscribed customers' details either per day, week, month, quarter, year or from one specific date to another.

Validate subscription by Policy number

This endpoint validates a subscription by Policy number

GET https://sandbox.insurpass.com/api/merchant/micro_health/validate_policy/:policy_no

This endpoint allows a merchant to request a specific customer's details by passing the customer's policy number for validation.

Path Parameters

NameTypeDescription

policy_no

String

The unique number that identifies the purchased insurance policy - 20570819

Headers

NameTypeDescription

Authorization*

String

Bearer {$secret-key}/{$api-key}

Content-Type*

String

application/json

{
    "success": true,
    "data": {
        "id": 25,
        "user_id": 32,
        "product_id": 1,
        "recurring": true,
        "subscriptions_type": "monthly",
        "subscriptions_no": 1,
        "start_date": "2021-04-14T00:00:00.000000Z",
        "end_date": "2021-05-14T00:00:00.000000Z",
        "enable": 1,
        "policy_no": "2104205800051",
        "merchant_user_id": 1,
        "created_at": "2021-04-14T16:38:17.000000Z",
        "updated_at": "2021-04-14T16:38:24.000000Z",
        "active_date": "2021-04-18 00:00:00",
        "product": {
            "id": 1,
            "name": "malerail care 1",
            "details": "<p>my product details</p>",
            "beneficiaries": true,
            "max_beneficiaries": 3,
            "provider_id": 1,
            "logo_url": null,
            "enable": true,
            "created_at": "2021-03-26T22:57:33.000000Z",
            "updated_at": "2021-03-26T22:57:34.000000Z"
        }
    },
    "message": "Subscription get successful"
}
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://sandbox.insurpass.com/api/merchant/micro_health/validate_policy/:policy_no',
  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;

Last updated