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.post
https://sandbox.insurpass.com
api/merchant/micro_health/get_quote
Get a quoted price
PHP
NODE JS
CURL
1
<?php
2
3
$curl = curl_init();
4
5
curl_setopt_array($curl, array(
6
CURLOPT_URL => 'https://sandbox.insurpass.com/api/merchant/micro_health/get_quote',
7
CURLOPT_RETURNTRANSFER => true,
8
CURLOPT_ENCODING => '',
9
CURLOPT_MAXREDIRS => 10,
10
CURLOPT_TIMEOUT => 0,
11
CURLOPT_FOLLOWLOCATION => true,
12
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
13
CURLOPT_CUSTOMREQUEST => 'POST',
14
CURLOPT_POSTFIELDS =>'{
15
"no_of_users": 2,
16
"subscription_type": "monthly",
17
"product_id": "1"
18
}',
19
CURLOPT_HTTPHEADER => array(
20
'Authorization: Bearer {{SECRETKEY}}',
21
'Content-Type: application/json'
22
),
23
));
24
25
$response = curl_exec($curl);
26
27
curl_close($curl);
28
echo $response;
29
1
var axios = require('axios');
2
var data = JSON.stringify({
3
"no_of_users": 2,
4
"subscription_type": "monthly",
5
"product_id": "1"
6
});
7
8
var config = {
9
method: 'post',
10
url: 'https://sandbox.insurpass.com/api/merchant/micro_health/get_quote',
11
headers: {
12
'Authorization': 'Bearer {{SECRETKEY}}',
13
'Content-Type': 'application/json'
14
},
15
data: data
16
};
17
18
axios(config)
19
.then(function (response) {
20
console.log(JSON.stringify(response.data));
21
})
22
.catch(function (error) {
23
console.log(error);
24
});
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"
}'
post
https://sandbox.insurpass.com
/api/merchant/micro_health/initiate
This method initiates the creation of a Micro-Health Policy.
PHP
NODE JS
CURL
1
<?php
2
3
$curl = curl_init();
4
5
curl_setopt_array($curl, array(
6
CURLOPT_URL => 'https://sandbox.insurpass.com/api/merchant/micro_health/initiate',
7
CURLOPT_RETURNTRANSFER => true,
8
CURLOPT_ENCODING => '',
9
CURLOPT_MAXREDIRS => 10,
10
CURLOPT_TIMEOUT => 0,
11
CURLOPT_FOLLOWLOCATION => true,
12
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
13
CURLOPT_CUSTOMREQUEST => 'POST',
14
CURLOPT_POSTFIELDS =>'{
15
"first_name" : "bob",
16
"surname" : "Bobbison",
17
"email" :"[email protected]",
18
"phone_no": "08102223475" ,
19
"date_of_birth": "1999-09-09",
20
"product_id" : 3,
21
"subscription_type":"monthly",
22
"amount" : 700,
23
"nin_number" : 22222222222,
24
"first_beneficiary_full_name" :"Bob Bobbison",
25
"second_beneficiary_full_name" : "Bob1 Bobbison1",
26
"third_beneficiary_full_name" : " Bob2 Bobbison2",
27
"id_url": "https://images.pexels.com/photos/10840765/pexels-photo-10840765.jpeg",
28
"profile_url" :"profile_url"
29
}',
30
CURLOPT_HTTPHEADER => array(
31
'Authorization: Bearer {{SECRETKEY}}',
32
'Content-Type: application/json'
33
),
34
));
35
36
$response = curl_exec($curl);
37
38
curl_close($curl);
39
echo $response;
1
var axios = require('axios');
2
var data = JSON.stringify({
3
"first_name": "bob",
4
"surname": "Bobbison",
5
"email": "[email protected]",
6
"phone_no": "08102223475",
7
"date_of_birth": "1999-09-09",
8
"product_id": 3,
9
"subscription_type": "monthly",
10
"amount": 700,
11
"nin_number": 22222222222,
12
"first_beneficiary_full_name": "Bob Bobbison",
13
"second_beneficiary_full_name": "Bob1 Bobbison1",
14
"third_beneficiary_full_name": " Bob2 Bobbison2",
15
"id_url": "https://images.pexels.com/photos/10840765/pexels-photo-10840765.jpeg",
16
"profile_url": "profile_url"
17
});
18
19
var config = {
20
method: 'post',
21
url: 'https://sandbox.insurpass.com/api/merchant/micro_health/initiate',
22
headers: {
23
'Authorization': 'Bearer {{SECRETKEY}}',
24
'Content-Type': 'application/json'
25
},
26
data: data
27
};
28
29
axios(config)
30
.then(function (response) {
31
console.log(JSON.stringify(response.data));
32
})
33
.catch(function (error) {
34
console.log(error);
35
});
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 protected]",
"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"
}'
post
https://sandbox.insurpass.com
/api/merchant/micro_health/verify
This endpoints sends a token that verifies the creation of a Micro-Health Policy.
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
NODE JS
CURL
1
<?php
2
3
$curl = curl_init();
4
5
curl_setopt_array($curl, array(
6
CURLOPT_URL => 'https://sandbox.insurpass.com/api/merchant/micro_health/verify',
7
CURLOPT_RETURNTRANSFER => true,
8
CURLOPT_ENCODING => '',
9
CURLOPT_MAXREDIRS => 10,
10
CURLOPT_TIMEOUT => 0,
11
CURLOPT_FOLLOWLOCATION => true,
12
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
13
CURLOPT_CUSTOMREQUEST => 'POST',
14
CURLOPT_POSTFIELDS =>'{
15
"token":"IDP163438169412711526"
16
}',
17
CURLOPT_HTTPHEADER => array(
18
'Authorization: Bearer {{SECRETKEY}}',
19
'Content-Type: application/json'
20
),
21
));
22
23
$response = curl_exec($curl);
24
25
curl_close($curl);
26
echo $response;
1
var axios = require('axios');
2
var data = JSON.stringify({
3
"token": "IDP163438169412711526"
4
});
5
6
var config = {
7
method: 'post',
8
url: 'https://sandbox.insurpass.com/ap/merchant/micro_health/verify',
9
headers: {
10
'Authorization': 'Bearer {{SECRETKEY}}',
11
'Content-Type': 'application/json'
12
},
13
data: data
14
};
15
16
axios(config)
17
.then(function (response) {
18
console.log(JSON.stringify(response.data));
19
})
20
.catch(function (error) {
21
console.log(error);
22
});
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"
}'
post
https://sandbox.insurpass.com
/api/merchant/micro_health/top_up
This endpoints renews a Micro-Health Policy.
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
NODE JS
CURL
1
<?php
2
3
$curl = curl_init();
4
5
curl_setopt_array($curl, array(
6
CURLOPT_URL => 'https://sandbox.insurpass.com/api/merchant/micro_health/top_up',
7
CURLOPT_RETURNTRANSFER => true,
8
CURLOPT_ENCODING => '',
9
CURLOPT_MAXREDIRS => 10,
10
CURLOPT_TIMEOUT => 0,
11
CURLOPT_FOLLOWLOCATION => true,
12
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
13
CURLOPT_CUSTOMREQUEST => 'POST',
14
CURLOPT_POSTFIELDS =>'{
15
"subscription_type":"monthly",
16
"amount" : 200000 ,
17
"policy_no":"UIC/HGJ/7685/GHF"
18
}',
19
CURLOPT_HTTPHEADER => array(
20
'Authorization: Bearer {{SECRETKEY}}',
21
'Content-Type: application/json'
22
),
23
));
24
25
$response = curl_exec($curl);
26
27
curl_close($curl);
28
echo $response;
1
var axios = require('axios');
2
var data = JSON.stringify({
3
"subscription_type": "monthly",
4
"amount": 200000,
5
"policy_no": "UIC/HGJ/7685/GHF"
6
});
7
8
var config = {
9
method: 'post',
10
url: 'https://sandbox.insurpass.com/api/merchant/micro_health/top_up',
11
headers: {
12
'Authorization': 'Bearer {{SECRETKEY}}',
13
'Content-Type': 'application/json'
14
},
15
data: data
16
};
17
18
axios(config)
19
.then(function (response) {
20
console.log(JSON.stringify(response.data));
21
})
22
.catch(function (error) {
23
console.log(error);
24
});
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"
}'
get
https://sandbox.insurpass.com
/api/merchant/micro_health/all_subscriptions
This endpoint returns a list of all the Micro-health Policy subscriptions
PHP
NODE JS
CURL
1
<?php
2
3
$curl = curl_init();
4
5
curl_setopt_array($curl, array(
6
CURLOPT_URL => 'https://sandbox.insurpass.com/api/merchant/micro_health/all_subscriptions',
7
CURLOPT_RETURNTRANSFER => true,
8
CURLOPT_ENCODING => '',
9
CURLOPT_MAXREDIRS => 10,
10
CURLOPT_TIMEOUT => 0,
11
CURLOPT_FOLLOWLOCATION => true,
12
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
13
CURLOPT_CUSTOMREQUEST => 'GET',
14
CURLOPT_HTTPHEADER => array(
15
'Authorization: Bearer {{SECRETKEY}}'
16
),
17
));
18
19
$response = curl_exec($curl);
20
21
curl_close($curl);
22
echo $response;
23
1
var axios = require('axios');
2
3
var config = {
4
method: 'get',
5
url: 'https://sandbox.insurpass.com/api/merchant/micro_health/all_subscriptions',
6
headers: {
7
'Authorization': 'Bearer {{SECRETKEY}}'
8
}
9
};
10
11
axios(config)
12
.then(function (response) {
13
console.log(JSON.stringify(response.data));
14
})
15
.catch(function (error) {
16
console.log(error);
17
});
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.
get
https://sandbox.insurpass.com
/api/merchant/micro_health/validate_policy/:policy_no
This endpoint validates a subscription by Policy number
PHP
NODE JS
CURL
1
<?php
2
3
$curl = curl_init();
4
5
curl_setopt_array($curl, array(
6
CURLOPT_URL => 'https://sandbox.insurpass.com/api/merchant/micro_health/validate_policy/:policy_no',
7
CURLOPT_RETURNTRANSFER => true,
8
CURLOPT_ENCODING => '',
9
CURLOPT_MAXREDIRS => 10,
10
CURLOPT_TIMEOUT => 0,
11
CURLOPT_FOLLOWLOCATION => true,
12
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
13
CURLOPT_CUSTOMREQUEST => 'GET',
14
CURLOPT_HTTPHEADER => array(
15
'Authorization: Bearer {{SECRETKEY}}'
16
),
17
));
18
19
$response = curl_exec($curl);
20
21
curl_close($curl);
22
echo $response;
1
var axios = require('axios');
2
3
var config = {
4
method: 'get',
5
url: 'https://sandbox.insurpass.com/api/merchant/micro_health/validate_policy/:policy_no',
6
headers: {
7
'Authorization': 'Bearer {{SECRETKEY}}'
8
}
9
};
10
11
axios(config)
12
.then(function (response) {
13
console.log(JSON.stringify(response.data));
14
})
15
.catch(function (error) {
16
console.log(error);
17
});
18
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 modified 11mo ago