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
Request Body
{
"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;
var axios = require('axios');
var data = JSON.stringify({
"no_of_users": 2,
"subscription_type": "monthly",
"product_id": "1"
});
var config = {
method: 'post',
url: 'https://sandbox.insurpass.com/api/merchant/micro_health/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);
});
curl --location --request POST https://sandbox.insurpass.com/api/merchant/micro_health/get_quote' \
--header 'Authorization: Bearer {{SECRETKEY}}' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data-raw '{
"no_of_users": 2,
"subscription_type": "monthly",
"product_id": "1"
}'
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
Request Body
{
"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;
var axios = require('axios');
var data = JSON.stringify({
"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"
});
var config = {
method: 'post',
url: 'https://sandbox.insurpass.com/api/merchant/micro_health/initiate',
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);
});
curl --location --request POST https://sandbox.insurpass.com/api/merchant/micro_health/initiate' \
--header 'Authorization: Bearer {{SECRETKEY}}' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data-raw '{
"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"
}'
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
Request Body
{
"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;
var axios = require('axios');
var data = JSON.stringify({
"token": "IDP163438169412711526"
});
var config = {
method: 'post',
url: 'https://sandbox.insurpass.com/ap/merchant/micro_health/verify',
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);
});
curl --location --request POST https://sandbox.insurpass.com/api/merchant/micro_health/verify' \
--header 'Authorization: Bearer {{SECRETKEY}}' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data-raw '{
"token": "IDP163438169412711526"
}'
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
Request Body
{
"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;
var axios = require('axios');
var data = JSON.stringify({
"subscription_type": "monthly",
"amount": 200000,
"policy_no": "UIC/HGJ/7685/GHF"
});
var config = {
method: 'post',
url: 'https://sandbox.insurpass.com/api/merchant/micro_health/top_up',
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);
});
curl --location --request POST https://sandbox.insurpass.com/api/merchant/micro_health/top_up' \
--header 'Authorization: Bearer {{SECRETKEY}}' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data-raw '{
"subscription_type": "monthly",
"amount": 200000,
"policy_no": "UIC/HGJ/7685/GHF"
}'
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
{
"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;
var axios = require('axios');
var config = {
method: 'get',
url: 'https://sandbox.insurpass.com/api/merchant/micro_health/all_subscriptions',
headers: {
'Authorization': 'Bearer {{SECRETKEY}}'
}
};
axios(config)
.then(function (response) {
console.log(JSON.stringify(response.data));
})
.catch(function (error) {
console.log(error);
});
curl --location --request GET https://sandbox.insurpass.com/api/merchant/micro_health/all_subscriptions' \
--header 'Authorization: Bearer {{SECRETKEY}}' \
--header 'Accept: application/json' \
--data-raw ''
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
Headers
{
"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;
var axios = require('axios');
var config = {
method: 'get',
url: 'https://sandbox.insurpass.com/api/merchant/micro_health/validate_policy/:policy_no',
headers: {
'Authorization': 'Bearer {{SECRETKEY}}'
}
};
axios(config)
.then(function (response) {
console.log(JSON.stringify(response.data));
})
.catch(function (error) {
console.log(error);
});
curl --location --request GET https://sandbox.insurpass.com/api/merchant/micro_health/validate_policy/:policy_no' \
--header 'Authorization: Bearer {{SECRETKEY}}' \
--header 'Accept: application/json' \
--data-raw ''
Last updated