Introduction
Welcome to Pasarpolis developer guide. You can use our API to access API endpoints for policy.
We have language bindings in Shell, Ruby, Java, Go, PHP and Python! You can view code examples in the dark area to the right, and you can switch the programming language of the examples with the tabs in the top right.
Authentication
We use HMAC based authentication behind the scenes.
You just need PartnerCode and PartnerSecret to get started. (details given in the Initialization section)
To know more about HMAC authentication click here
Initialization
To initialize, use this code:
require 'pasarpolis_sdk'
PasarpolisSdk.init(<PartnerCode>, <PartnerSecret>, <Host>)
from pasapolis import Client
Client.init(<PartnerCode>, <PartnerSecret>, <Host>)
import com.pasarpolis.sdk.PasarpolisClient;
PasarpolisClient.init(<PartnerCode>, <PartnerSecret>, <Host>);
import(
"gitlab.com/pasarpolis/go-sdk"
)
pasarpolis.InitClient(<PartnerCode>, <PartnerSecret>, <Host>);
const sdk = require('pasarpolis-sdk-nodejs')
const client = sdk.init(<PartnerCode>, <PartnerSecret>, <Host>)
require_once('pasarpolis/client.php')
$clientObj = new client(<PartnerCode>, <PartnerSecret>, <HOST>)
For Initialization you need PartnerCode, PartnerSecret and Host.
PartnerCode (string) : Provided by Pasarpolis for Authentication.
PartnerSecret (string) : Secret Key provided by Pasarpolis.
Host (string) : Fully qualified domain name as specified below.
Sandbox: https://integrations-sandbox.pasarpolis.io
Production: https://integrations.pasarpolis.io
Guide
Config Create Policy
Signature
policy = Pasarpolis::Policy.config_create_policy(<
Product>
, params);
from pasarpolis import Policy
policy = Policy.config_create_policy(<
Product>
, params);
import com.pasarpolis.sdk.models.Policy;
Policy policy = Policy.configCreatePolicy(<
Product>
, params);
import(
pasarpolis_models "gitlab.com/pasarpolis/go-sdk.v2/models"
"fmt"
)
policy, error := pasarpolis_models.CreatePolicy(<
Product>
, params);
Policy.config_create_policy(<
Product>
, params);
require_once('pasarpolis/policy.php')
$policyObj = new policy($params);
$policy = $policyObj->config_create_policy(<
Product>
, $params, $clientObj);
Example code:
require "pasarpolis_sdk"
params = {}
params["name"]="John Doe"
params["email_id"]="john.doe@example.com"
params["phone_no"]="+6200000000000"
params["reference_id"]="R1"
params["make"]="Apple"
params["model"]="iPhone X"
params["purchase_date"]="2018-12-20"
params["purchase_value"]=32000.00
policy = Pasarpolis::Policy.config_create_policy("gadget-protection", params);
puts policy.reference_number
puts policy.application_number
puts policy.premium
from pasarpolis import Policy
params = {}
params["name"]="John Doe"
params["email_id"]="john.doe@example.com"
params["phone_no"]="+6200000000000"
params["reference_id"]="R1"
params["make"]="Apple"
params["model"]="iPhone X"
params["purchase_date"]="2018-12-20"
params["purchase_value"]=32000.00
policy = Policy.config_create_policy("gadget-protection", params);
print(policy.reference_number,"\n")
print(policy.application_number)
print(policy.premium)
import java.util.HashMap;
import com.pasarpolis.sdk.models.Policy;
try {
HashMap<String, Object> params = new HashMap<String, Object>();
params.put("name","John Doe");
params.put("email_id","john.doe@example.com");
params.put("phone_no","+6200000000000");
params.put("reference_id","R1");
params.put("make","Apple");
params.put("model","iPhone X");
params.put("purchase_date","2018-12-20");
params.put("purchase_value",32000.00);
Policy policy = Policy.configCreatePolicy("gadget-protection", params);
System.out.println(policy.referenceNumber);
System.out.println(policy.applicationNumber);
System.out.println(policy.premium);
}catch(Exception e) {
// Error Handling part
}
import(
pasarpolis_models "gitlab.com/pasarpolis/go-sdk.v2/models"
"fmt"
)
params := map[string]interface{}{};
params["name"]="John Doe"
params["email_id"]="john.doe@example.com"
params["phone_no"]="+6200000000000"
params["reference_id"]="R1"
params["make"]="Apple"
params["model"]="iPhone X"
params["purchase_date"]="2018-12-20"
params["purchase_value"]=32000.00
params["last_property"]=true
policy := pasarpolis_models.ConfigCreatePolicy("gadget-protection", params);
fmt.Println(policy.referenceNumber);
fmt.Println(policy.applicationNumber);
fmt.Println(policy.premium);
const sdk = require('pasarpolis-sdk-nodejs')
const client = sdk.init(<PartnerCode>, <PartnerSecret>, <Host>)
const packageName = 'phone-protection'
const params = {
"name": "John Doe",
"email_id": "john.doe@example.com",
"phone_no": "+6200000000000",
"reference_id": "R1",
"make": "Apple",
"model": "iPhone X",
"purchase_date": "2018-12-20",
"purchase_value": 32000.00
}
const configCreatePolicy = client.configCreatePolicy(packageName, params)
/** It will give response as promise */
configCreatePolicy
.then(response => console.log(response))
.catch(err => console.log(err))
require_once('pasarpolis/policy.php')
$policyObj = new policy($params);
$params = Array();
$params["name"] = "Jacob";
$params["email_id"] = "john.doe@example.com"
$params["phone_no"] = "+6200000000000"
$params["reference_id"] = "R1"
$params["make"] = "Apple"
$params["model"] = "iPhone X"
$params["purchase_date"] = "2018-12-20"
$params["purchase_value"] = 32000.00;
$params["last_property"] = true;
$policy = $policyObj->create_policy("gadget-rental-protection", $params, $clientObj);
print_r($policy['reference_number']);
echo '<br>';
print_r($policy['application_number']);
echo '<br>';
print_r($policy['premium']);
The above code snippet returns would return:
d77d436ad9485b86b8a0c18c3d2f70f77a10c43d
APP-000000224
15000
Create policy will create a new policy and will return a Policy object having application_number, premium and reference_number.
where:
- Product (string): Type of product for which policy is being created.
- Params (hash): Product specific data to be sent. Signature of every product specific data is provided here.
it will return a Policy object which contains:
- reference_number (string): Hexadecimal number provided by Pasarpolis for future reference.
- application_number (string): Number provided for future reference.
- premium (integer): Premium amount for policy.
Config Validate Policy
Signature
policy = Pasarpolis::Policy.config_validate_policy(<
Product>
, params);
from pasarpolis import Policy
policy = Policy.config_validate_policy(<
Product>
, params);
import com.pasarpolis.sdk.models.Policy;
Policy policy = Policy.configValidatePolicy(<
Product>
, params);
import(
pasarpolis_models "gitlab.com/pasarpolis/go-sdk.v2/models"
"fmt"
)
policy, error := pasarpolis_models.ConfigCreatePolicy(<
Product>
, params);
Policy.configValidatePolicy(<
Product>
, params);
require_once('pasarpolis/policy.php')
$policyObj = new policy($params);
$policy = $policyObj->config_validate_policy(<
Product>
, $params, $clientObj);
Example code:
require "pasarpolis_sdk"
params = {}
params["name"]="John Doe"
params["email_id"]="john.doe@example.com"
params["phone_no"]="+6200000000000"
params["reference_id"]="R1"
params["make"]="Apple"
params["model"]="iPhone X"
params["purchase_date"]="2018-12-20"
params["purchase_value"]=32000.00
policy = Pasarpolis::Policy.config_validate_policy("gadget-protection", params);
puts policy.message
from pasarpolis import Policy
params = {}
params["name"]="John Doe"
params["email_id"]="john.doe@example.com"
params["phone_no"]="+6200000000000"
params["reference_id"]="R1"
params["make"]="Apple"
params["model"]="iPhone X"
params["purchase_date"]="2018-12-20"
params["purchase_value"]=32000.00
policy = Policy.config_validate_policy("travel-protection", params);
print(policy.message)
import java.util.HashMap;
import com.pasarpolis.sdk.models.Policy;
try {
HashMap<String, Object> params = new HashMap<String, Object>();
params.put("name","John Doe");
params.put("email_id","john.doe@example.com");
params.put("phone_no","+6200000000000");
params.put("reference_id","R1");
params.put("make","Apple");
params.put("model","iPhone X");
params.put("purchase_date","2018-12-20");
params.put("purchase_value",32000.00);
Policy policy = Policy.configValidatePolicy("gadget-protection", params);
System.out.println(policy.message);
}catch(Exception e) {
// Error Handling part
}
import(
pasarpolis_models "gitlab.com/pasarpolis/go-sdk.v2/models"
"fmt"
)
params := map[string]interface{}{};
params["name"]="John Doe"
params["email_id"]="john.doe@example.com"
params["phone_no"]="+6200000000000"
params["reference_id"]="R1"
params["make"]="Apple"
params["model"]="iPhone X"
params["purchase_date"]="2018-12-20"
params["purchase_value"]=32000.00
params["last_property"]=true
policy := pasarpolis_models.ConfigValidatePolicy("gadget-rental-protection", params);
fmt.Println(policy.message);
const sdk = require('pasarpolis-sdk-nodejs')
const client = sdk.init(<PartnerCode>, <PartnerSecret>, <Host>)
const packageName = 'phone-protection'
const params = {
"name": "John Doe",
"email_id": "john.doe@example.com",
"phone_no": "+6200000000000",
"reference_id": "R1",
"make": "Apple",
"model": "iPhone X",
"purchase_date": "2018-12-20",
"purchase_value": 32000.00
}
const configValidatePolicy = client.configValidatePolicy(packageName, params)
/** It will give response as promise */
configValidatePolicy
.then(response => console.log(response))
.catch(err => console.log(err))
require_once('pasarpolis/policy.php')
$policyObj = new policy($params);
$params = Array();
$params["name"] = "Jacob";
$params["email_id"] = "john.doe@example.com"
$params["phone_no"] = "+6200000000000"
$params["reference_id"] = "R1"
$params["make"] = "Apple"
$params["model"] = "iPhone X"
$params["purchase_date"] = "2018-12-20"
$params["purchase_value"] = 32000.00;
$params["last_property"] = true;
$policy = $policyObj->config_validate_policy("gadget-rental-protection", $params, $clientObj);
print_r($policy['message']);
The above code snippet returns would return:
Valid request
Validate policy will validate a new policy and will return a Policy object having message.
where:
- Product (string): Type of product for which policy is being created.
- Params (hash): Product specific data to be sent. Signature of every product specific data is provided here.
it will return a Policy object which contains:
- message (string): Message containing content Valid request .
Create Policy
Signature
policy = Pasarpolis::Policy.create_policy(<
Product>
, params);
from pasarpolis import Policy
policy = Policy.create_policy(<
Product>
, params);
import com.pasarpolis.sdk.models.Policy;
Policy policy = Policy.createPolicy(<
Product>
, params);
import(
pasarpolis_models "gitlab.com/pasarpolis/go-sdk.v2/models"
"fmt"
)
policy, error := pasarpolis_models.CreatePolicy(<
Product>
, params);
Policy.createPolicy(<
Product>
, params);
require_once('pasarpolis/policy.php')
$policyObj = new policy($params);
$policy = $policyObj->create_policy(<
Product>
, $params, $clientObj);
Example code:
require "pasarpolis_sdk"
params = {}
params["name"]="John Doe"
params["email_id"]="john.doe@example.com"
params["phone_no"]="+6200000000000"
params["reference_id"]="R1"
params["make"]="Apple"
params["model"]="iPhone X"
params["purchase_date"]="2018-12-20"
params["purchase_value"]=32000.00
policy = Pasarpolis::Policy.create_policy("gadget-protection", params);
puts policy.reference_number
puts policy.application_number
puts policy.premium
from pasarpolis import Policy
params = {}
params["name"]="John Doe"
params["email_id"]="john.doe@example.com"
params["phone_no"]="+6200000000000"
params["reference_id"]="R1"
params["make"]="Apple"
params["model"]="iPhone X"
params["purchase_date"]="2018-12-20"
params["purchase_value"]=32000.00
params["last_property"]=true
policy = Policy.create_policy("travel-protection", params);
print(policy.reference_number)
print(policy.application_number)
print(policy.premium)
import java.util.HashMap;
import com.pasarpolis.sdk.models.Policy;
try {
HashMap<String, Object> params = new HashMap<String, Object>();
params.put("name","John Doe");
params.put("email_id","john.doe@example.com");
params.put("phone_no","+6200000000000");
params.put("reference_id","R1");
params.put("make","Apple");
params.put("model","iPhone X");
params.put("purchase_date","2018-12-20");
params.put("purchase_value",32000.00);
Policy policy = Policy.createPolicy("gadget-protection", params);
System.out.println(policy.referenceNumber);
System.out.println(policy.applicationNumber);
System.out.println(policy.premium);
}catch(Exception e) {
// Error Handling part
}
import(
pasarpolis_models "gitlab.com/pasarpolis/go-sdk.v2/models"
"fmt"
)
params := map[string]interface{}{};
params["name"]="John Doe"
params["email_id"]="john.doe@example.com"
params["phone_no"]="+6200000000000"
params["reference_id"]="R1"
params["make"]="Apple"
params["model"]="iPhone X"
params["purchase_date"]="2018-12-20"
params["purchase_value"]=32000.00
params["last_property"]=true
policy := pasarpolis_models.CreatePolicy("gadget-rental-protection", params);
fmt.Println(policy.referenceNumber);
fmt.Println(policy.applicationNumber);
fmt.Println(policy.premium);
const sdk = require('pasarpolis-sdk-nodejs')
const client = sdk.init(<PartnerCode>, <PartnerSecret>, <Host>)
const packageName = 'phone-protection'
const params = {
"name": "John Doe",
"email_id": "john.doe@example.com",
"phone_no": "+6200000000000",
"reference_id": "R1",
"make": "Apple",
"model": "iPhone X",
"purchase_date": "2018-12-20",
"purchase_value": 32000.00
}
const createPolicy = client.createPolicy(packageName, params)
/** It will give response as promise */
createPolicy
.then(response => console.log(response))
.catch(err => console.log(err))
require_once('pasarpolis/policy.php')
$policyObj = new policy($params);
$params = Array();
$params["name"] = "Jacob";
$params["email_id"] = "john.doe@example.com"
$params["phone_no"] = "+6200000000000"
$params["reference_id"] = "R1"
$params["make"] = "Apple"
$params["model"] = "iPhone X"
$params["purchase_date"] = "2018-12-20"
$params["purchase_value"] = 32000.00;
$params["last_property"] = true;
$policy = $policyObj->create_policy("gadget-rental-protection", $params, $clientObj);
print_r($policy['reference_number']);
echo '<br>';
print_r($policy['application_number']);
echo '<br>';
print_r($policy['premium']);
The above code snippet returns would return:
d77d436ad9485b86b8a0c18c3d2f70f77a10c43d
APP-000000224
15000
Create policy will create a new policy and will return a Policy object having application_number, premium and reference_number.
where:
- Product (string): Type of product for which policy is being created.
- Params (hash): Product specific data to be sent. Signature of every product specific data is provided here.
it will return a Policy object which contains:
- reference_number (string): Hexadecimal number provided by Pasarpolis for future reference.
- application_number (string): Number provided for future reference.
- premium (integer): Premium amount for policy.
Validate Policy
Signature
policy = Pasarpolis::Policy.validate_policy(<
Product>
, params);
from pasarpolis import Policy
policy = Policy.validate_policy(<
Product>
, params);
import com.pasarpolis.sdk.models.Policy;
Policy policy = Policy.validatePolicy(<
Product>
, params);
import(
pasarpolis_models "gitlab.com/pasarpolis/go-sdk.v2/models"
"fmt"
)
policy, error := pasarpolis_models.ValidatePolicy(<
Product>
, params);
client.validatePolicy(<
Product>
, params);
require_once('pasarpolis/policy.php')
$policyObj = new policy($params);
$policy = $policyObj->validate_policy(<
Product>
, $params, $clientObj);
Example code:
require "pasarpolis_sdk"
params = {}
params["name"]="John Doe"
params["email_id"]="john.doe@example.com"
params["phone_no"]="+6200000000000"
params["reference_id"]="R1"
params["make"]="Apple"
params["model"]="iPhone X"
params["purchase_date"]="2018-12-20"
params["purchase_value"]=32000.00
policy = Pasarpolis::Policy.validate_policy("gadget-protection", params);
puts policy.message
from pasarpolis import Policy
params = {}
params["name"]="John Doe"
params["email_id"]="john.doe@example.com"
params["phone_no"]="+6200000000000"
params["reference_id"]="R1"
params["make"]="Apple"
params["model"]="iPhone X"
params["purchase_date"]="2018-12-20"
params["purchase_value"]=32000.00
params["last_property"]=true
policy = Policy.validate_policy("travel-protection", params);
print(policy.message)
import java.util.HashMap;
import com.pasarpolis.sdk.models.Policy;
try {
HashMap<String, Object> params = new HashMap<String, Object>();
params.put("name","John Doe");
params.put("email_id","john.doe@example.com");
params.put("phone_no","+6200000000000");
params.put("reference_id","R1");
params.put("make","Apple");
params.put("model","iPhone X");
params.put("purchase_date","2018-12-20");
params.put("purchase_value",32000.00);
Policy policy = Policy.validatePolicy("gadget-protection", params);
System.out.println(policy.message);
}catch(Exception e) {
// Error Handling part
}
import(
pasarpolis_models "gitlab.com/pasarpolis/go-sdk.v2/models"
"fmt"
)
params := map[string]interface{}{};
params["name"]="John Doe"
params["email_id"]="john.doe@example.com"
params["phone_no"]="+6200000000000"
params["reference_id"]="R1"
params["make"]="Apple"
params["model"]="iPhone X"
params["purchase_date"]="2018-12-20"
params["purchase_value"]=32000.00
params["last_property"]=true
policy := pasarpolis_models.ValidatePolicy("gadget-rental-protection", params);
fmt.Println(policy.message);
const sdk = require('pasarpolis-sdk-nodejs')
const client = sdk.init(<PartnerCode>, <PartnerSecret>, <Host>)
const packageName = 'phone-protection'
const params = {
"name": "John Doe",
"email_id": "john.doe@example.com",
"phone_no": "+6200000000000",
"reference_id": "R1",
"make": "Apple",
"model": "iPhone X",
"purchase_date": "2018-12-20",
"purchase_value": 32000.00
}
const validatePolicy = client.validatePolicy(packageName, params)
/** It will give response as promise */
validatePolicy
.then(response => console.log(response))
.catch(err => console.log(err))
require_once('pasarpolis/policy.php')
$policyObj = new policy($params);
$params = Array();
$params["name"] = "Jacob";
$params["email_id"] = "john.doe@example.com"
$params["phone_no"] = "+6200000000000"
$params["reference_id"] = "R1"
$params["make"] = "Apple"
$params["model"] = "iPhone X"
$params["purchase_date"] = "2018-12-20"
$params["purchase_value"] = 32000.00;
$params["last_property"] = true;
$policy = $policyObj->validate_policy("gadget-rental-protection", $params, $clientObj);
print_r($policy['message']);
The above code snippet returns would return:
Valid request
Validate policy will validate a new policy and will return a Policy object having message
where:
- Product (string): Type of product for which policy is being created.
- Params (hash): Product specific data to be sent. Signature of every product specific data is provided here.
it will return a Policy object which contain:
- message (string): Message containing content Valid request .
Create Aggregate Policy
Signature
policy = Pasarpolis::Policy.create_aggregate_policy(<
Product>
, params);
from pasarpolis import Policy
policy = Policy.create_aggregate_policy(<
Product>
, params);
import com.pasarpolis.sdk.models.Policy;
Policy[] policy = Policy.createAggregatePolicy(<
Product>
, params);
import(
pasarpolis_models "gitlab.com/pasarpolis/go-sdk.v2/models"
)
policy, error := pasarpolis_models.CreateAggregatePolicy(<
Product>
, params);
client.createAggregatePolicy(<
Product>
, params);
require_once('pasarpolis/policy.php')
$policyObj = new policy($params);
$policy = $policyObj->create_aggregate_policy(<
Product>
, <
params>
, <
clientObj>
);
Example code:
require "pasarpolis_sdk"
params1 = {}
params1["name"]="Jacob"
params1["email_id"]="john.doe@example.com"
params1["phone_no"]="+6200000000000"
params1["reference_id"]="R1"
params1["make"]="Apple"
params1["model"]="iPhone X"
params1["purchase_date"]="2018-12-20"
params1["purchase_value"]=32000.00
params2 = {}
params2["name"]="Jason"
params2["email_id"]="john.doe@example.com"
params2["phone_no"]="+6200000000000"
params2["reference_id"]="R1"
params2["make"]="Apple"
params2["model"]="iPhone X"
params2["purchase_date"]="2018-12-20"
params2["purchase_value"]=32000.00
param_list = [params1, params2]
policies = Policy.create_aggregate_policy("travel-protection", param_list);
puts policies
from pasarpolis import Policy
params1 = {}
params1["name"]="Jacob"
params1["email_id"]="john.doe@example.com"
params1["phone_no"]="+6200000000000"
params1["reference_id"]="R1"
params1["make"]="Apple"
params1["model"]="iPhone X"
params1["purchase_date"]="2018-12-20"
params1["purchase_value"]=32000.00
params1["last_property"]=true
params2 = {}
params2["name"]="Jason"
params2["email_id"]="john.doe@example.com"
params2["phone_no"]="+6200000000000"
params2["reference_id"]="R1"
params2["make"]="Apple"
params2["model"]="iPhone X"
params2["purchase_date"]="2018-12-20"
params2["purchase_value"]=32000.00
params2["last_property"]=true
param_list = [params1, params2]
policies = Policy.create_aggregate_policy("travel-protection", param_list);
print(policies)
import java.util.HashMap;
import java.util.ArrayList;
import com.pasarpolis.sdk.models.Policy;
try {
ArrayList <HashMap<String, Object>> params = new ArrayList <HashMap<String, Object>>();
HashMap<String, Object> params1 = new HashMap<String, Object>();
params1.put("name","John Doe");
params1.put("email_id","john.doe@example.com");
params1.put("phone_no","+6200000000000");
params1.put("reference_id","R1");
params1.put("make","Apple");
params1.put("model","iPhone X");
params1.put("purchase_date","2018-12-20");
params1.put("purchase_value",32000.00);
HashMap<String, Object> params2 = new HashMap<String, Object>();
params2.put("name","John Doe");
params2.put("email_id","john.doe@example.com");
params2.put("phone_no","+6200000000000");
params2.put("reference_id","R2");
params2.put("make","Apple");
params2.put("model","iPhone X");
params2.put("purchase_date","2018-12-20");
params2.put("purchase_value",32000.00);
params.add(params1);
params.add(params2);
Policy[] policy = Policy.createAggregatePolicy("gadget-protection", params);
System.out.println(policy);
}catch(Exception e) {
// Error Handling part
}
import(
pasarpolis_models "gitlab.com/pasarpolis/go-sdk.v2/models"
"fmt"
)
var params []interface{}
params1 := map[string]interface{}{};
params1["name"]="Jacob"
params1["email_id"]="john.doe@example.com"
params1["phone_no"]="+6200000000000"
params1["reference_id"]="R1"
params1["make"]="Apple"
params1["model"]="iPhone X"
params1["purchase_date"]="2018-12-20"
params1["purchase_value"]=32000.00
params2 := map[string]interface{}{};
params2["name"]="Jacob2"
params2["email_id"]="john.doe@example.com"
params2["phone_no"]="+6200000000000"
params2["reference_id"]="R1"
params2["make"]="Apple"
params2["model"]="iPhone X"
params2["purchase_date"]="2018-12-20"
params2["purchase_value"]=32000.00
params = append(params, params1)
params = append(params, params2)
policy, error := pasarpolis_models.CreateAggregatePolicy("gadget-rental-protection", params)
fmt.Println(policy)
const sdk = require('pasarpolis-sdk-nodejs')
const client = sdk.init(<PartnerCode>, <PartnerSecret>, <Host>)
const packageName = 'travel-protection-ultra'
const params = [
{
"reference_id": "2c104b94-3705-45d2-bd1e-test1",
"policy_insured"{
"name": "John Doe",
"phone_no": "+6200000000000",
"email": "abc@gmail.com",
"gender": "Male",
"identity_type": 1,
"identity_number": "123456789111"
},
"flight_information"[
{
"type": 0,
"airport_code": "FGK",
"flight_code": "JT-341",
"departure_date": "2019-01-01 04:30:00",
"destination_airport_code": "KUL",
"pnr": "187651"
},
{
"type": 1,
"airport_code": "FGK",
"flight_code": ""QG-342"",
"departure_date": "2019-01-01 13:23:00",
"destination_airport_code": "DEL",
"pnr": "187659"
},
],
"booking_code": "ABC123455"
"travel_type": 1
"transit_type": 1
"travel_destination": 1
"trip_reason": 1
"note": ""
"package_id": 1
},
{
"reference_id": "2c104b94-3705-45d2-bd1e-test2",
"policy_insured"{
"name": "Alice Doe",
"phone_no": "627888910121",
"email": "abc@gmail.com",
"gender": "Male",
"identity_type": 1,
"identity_number": "123456789113"
},
"flight_information"[
{
"type": 0,
"airport_code": "KJL",
"flight_code": "JT-3422",
"departure_date": "2019-01-01 04:30:00",
"destination_airport_code": "KUL",
"pnr": "187661"
},
{
"type": 1,
"airport_code": "KUL",
"flight_code": ""QG-345"",
"departure_date": "2019-01-01 14:23:00",
"destination_airport_code": "KLP",
"pnr": "187662"
},
],
"booking_code": "ABC123455"
"travel_type": 1
"transit_type": 1
"travel_destination": 1
"trip_reason": 1
"note": ""
"package_id": 1
}
]
const createAgrregatePolicy = client.createAggregatePolicy(packageName, params)
/** It will give response as promise */
createAgrregatePolicy
.then(response => {
if ( response.details !== undefined )
console.log(response.detail.errors)
else
console.log(response)
})
.catch(err => console.log(err))
require_once('pasarpolis/policy.php')
$policyObj = new policy($params);
$params1 = Array();
$params1["name"] = "Jacob";
$params1["email_id"] = "john.doe@example.com"
$params1["phone_no"] = "+6200000000000"
$params1["reference_id"] = "R1"
$params1["purchase_date"] = "2018-12-20"
$params1["purchase_value"] = 32000.00;
$params1["last_property"] = true;
$params2 = Array();
$params2["name"] = "Jacob";
$params2["email_id"] = "john.doe@example.com"
$params2["phone_no"] = "+6200000000000"
$params2["reference_id"] = "R1"
$params2["purchase_date"] = "2018-12-20"
$params2["purchase_value"] = 32000.00;
$params2["last_property"] = true;
$param_list = array ($params1, $params2);
$policies = Policy.create_aggregate_policy("travel-protection", $param_list,$clientObj);
print_r($policies)
The above code snippet returns would return:
{
"policies":{
"INS12AQYF40392-973-1":{
"application_no":"APP-000067265",
"ref":"259a06539a4e9d75c39ec0e1b292077fee17c840",
"premium":48000,
},
"INS12AQYF40392-974-1":{
"application_no":"APP-000067265",
"ref":"259a06539a4e9d75c39ec0e1b292077fee17c840",
"premium":48000,
}
}
}
Create aggregate policy will create new policies for a product and will return a dictionary with reference number passed as key Policy object having application_number , premium and reference_number as value
where:
- Product (string): Type of product for which policy is being created.
- Params (list): Product specific data to be sent.
it will return a dictionary which contains:
- reference_id passed for policy creation as key
- reference_number (string): Hexadecimal number provided by Pasarpolis for future reference.
- application_number (string): Number provided for future reference.
- premium (integer): Premium amount for policy.
Validate Aggregate Policy
Signature
policy = Pasarpolis::Policy.validate_aggregate_policy(<
Product>
, params);
from pasarpolis import Policy
policy = Policy.validate_aggregate_policy(<
Product>
, params);
import com.pasarpolis.sdk.models.Policy;
Policy policy = Policy.validateAggregatePolicy(<
Product>
, params);
import(
pasarpolis_models "gitlab.com/pasarpolis/go-sdk.v2/models"
)
policy, error := pasarpolis_models.ValidateAggregatePolicy(<
Product>
, params);
client.validateAggregatePolicy(<
Product>
, params);
require_once('pasarpolis/policy.php')
$policyObj = new policy($params);
$policy = $policyObj->validate_aggregate_policy(<
Product>
, <
params>
, <
clientObj>
);
Example code:
require "pasarpolis_sdk"
params1 = {}
params1["name"]="Jacob"
params1["email_id"]="john.doe@example.com"
params1["phone_no"]="+6200000000000"
params1["reference_id"]="R1"
params1["make"]="Apple"
params1["model"]="iPhone X"
params1["purchase_date"]="2018-12-20"
params1["purchase_value"]=32000.00
params2 = {}
params2["name"]="Jason"
params2["email_id"]="john.doe@example.com"
params2["phone_no"]="+6200000000000"
params2["reference_id"]="R1"
params2["make"]="Apple"
params2["model"]="iPhone X"
params2["purchase_date"]="2018-12-20"
params2["purchase_value"]=32000.00
param_list = [params1, params2]
policies = Policy.validate_aggregate_policy("travel-protection", param_list);
puts policies.message
from pasarpolis import Policy
params1 = {}
params1["name"]="Jacob"
params1["email_id"]="john.doe@example.com"
params1["phone_no"]="+6200000000000"
params1["reference_id"]="R1"
params1["make"]="Apple"
params1["model"]="iPhone X"
params1["purchase_date"]="2018-12-20"
params1["purchase_value"]=32000.00
params1["last_property"]=true
params2 = {}
params2["name"]="Jason"
params2["email_id"]="john.doe@example.com"
params2["phone_no"]="+6200000000000"
params2["reference_id"]="R1"
params2["make"]="Apple"
params2["model"]="iPhone X"
params2["purchase_date"]="2018-12-20"
params2["purchase_value"]=32000.00
params2["last_property"]=true
param_list = [params1, params2]
policies = Policy.validate_aggregate_policy("travel-protection", param_list);
print(policies)
import java.util.HashMap;
import java.util.ArrayList;
import com.pasarpolis.sdk.models.Policy;
try {
ArrayList <HashMap<String, Object>> params = new ArrayList <HashMap<String, Object>>();
HashMap<String, Object> params1 = new HashMap<String, Object>();
params1.put("name","John Doe");
params1.put("email_id","john.doe@example.com");
params1.put("phone_no","+6200000000000");
params1.put("reference_id","R1");
params1.put("make","Apple");
params1.put("model","iPhone X");
params1.put("purchase_date","2018-12-20");
params1.put("purchase_value",32000.00);
HashMap<String, Object> params2 = new HashMap<String, Object>();
params2.put("name","John Doe");
params2.put("email_id","john.doe@example.com");
params2.put("phone_no","+6200000000000");
params2.put("reference_id","R2");
params2.put("make","Apple");
params2.put("model","iPhone X");
params2.put("purchase_date","2018-12-20");
params2.put("purchase_value",32000.00);
params.add(params1);
params.add(params2);
Policy[] policy = Policy.validateAggregatePolicy("gadget-protection", params);
System.out.println(policy);
}catch(Exception e) {
// Error Handling part
}
import(
pasarpolis_models "gitlab.com/pasarpolis/go-sdk.v2/models"
"fmt"
)
var params []interface{}
params1 := map[string]interface{}{};
params1["name"]="Jacob"
params1["email_id"]="john.doe@example.com"
params1["phone_no"]="+6200000000000"
params1["reference_id"]="R1"
params1["make"]="Apple"
params1["model"]="iPhone X"
params1["purchase_date"]="2018-12-20"
params1["purchase_value"]=32000.00
params2 := map[string]interface{}{};
params2["name"]="Jacob2"
params2["email_id"]="john.doe@example.com"
params2["phone_no"]="+6200000000000"
params2["reference_id"]="R1"
params2["make"]="Apple"
params2["model"]="iPhone X"
params2["purchase_date"]="2018-12-20"
params2["purchase_value"]=32000.00
params = append(params, params1)
params = append(params, params2)
policy, error := pasarpolis_models.ValidateAggregatePolicy("gadget-rental-protection", params)
fmt.Println(policy)
const sdk = require('pasarpolis-sdk-nodejs')
const client = sdk.init(<PartnerCode>, <PartnerSecret>, <Host>)
const packageName = 'travel-protection-ultra'
const params = [
{
"reference_id": "2c104b94-3705-45d2-bd1e-test1",
"policy_insured"{
"name": "John Doe",
"phone_no": "+6200000000000",
"email": "abc@gmail.com",
"gender": "Male",
"identity_type": 1,
"identity_number": "123456789111"
},
"flight_information"[
{
"type": 0,
"airport_code": "FGK",
"flight_code": "JT-341",
"departure_date": "2019-01-01 04:30:00",
"destination_airport_code": "KUL",
"pnr": "187651"
},
{
"type": 1,
"airport_code": "FGK",
"flight_code": ""QG-342"",
"departure_date": "2019-01-01 13:23:00",
"destination_airport_code": "DEL",
"pnr": "187659"
},
],
"booking_code": "ABC123455"
"travel_type": 1
"transit_type": 1
"travel_destination": 1
"trip_reason": 1
"note": ""
"package_id": 1
},
{
"reference_id": "2c104b94-3705-45d2-bd1e-test2",
"policy_insured"{
"name": "Alice Doe",
"phone_no": "627888910121",
"email": "abc@gmail.com",
"gender": "Male",
"identity_type": 1,
"identity_number": "123456789113"
},
"flight_information"[
{
"type": 0,
"airport_code": "KJL",
"flight_code": "JT-3422",
"departure_date": "2019-01-01 04:30:00",
"destination_airport_code": "KUL",
"pnr": "187661"
},
{
"type": 1,
"airport_code": "KUL",
"flight_code": ""QG-345"",
"departure_date": "2019-01-01 14:23:00",
"destination_airport_code": "KLP",
"pnr": "187662"
},
],
"booking_code": "ABC123455"
"travel_type": 1
"transit_type": 1
"travel_destination": 1
"trip_reason": 1
"note": ""
"package_id": 1
}
]
const createPolicy = client.validateAggregatePolicy(packageName, params)
/** It will give response as promise */
validateAggregatePolicy
.then(response => {
if ( response.details !== undefined )
console.log(response.detail.errors)
else
console.log(response)
})
.catch(err => console.log(err))
require_once('pasarpolis/policy.php')
$policyObj = new policy($params);
$params1 = Array();
$params1["name"] = "Jacob";
$params1["email_id"] = "john.doe@example.com"
$params1["phone_no"] = "+6200000000000"
$params1["reference_id"] = "R1"
$params1["purchase_date"] = "2018-12-20"
$params1["purchase_value"] = 32000.00;
$params1["last_property"] = true;
$params2 = Array();
$params2["name"] = "Jason";
$params2["email_id"] = "john.doe@example.com"
$params2["phone_no"] = "+6200000000000"
$params2["reference_id"] = "R1"
$params2["purchase_date"] = "2018-12-20"
$params2["purchase_value"] = 32000.00;
$params2["last_property"] = true;
$param_list = array ($params1, $params2);
$policies = Policy.validate_aggregate_policy("travel-protection", $param_list,$clientObj);
print_r($policies)
The above code snippet returns would return:
Valid request
{
"policies":{
"INS12AQYF40392-973-1":{
"application_no":"APP-000067265",
"ref":"259a06539a4e9d75c39ec0e1b292077fee17c840",
"premium":48000,
},
"INS12AQYF40392-974-1":{
"application_no":"APP-000067265",
"ref":"259a06539a4e9d75c39ec0e1b292077fee17c840",
"premium":48000,
}
}
}
{
"message":"Valid request"
}
Valid request
{ "policies":
{ '2c104b94-3705-45d2-bd1e-test1':
{
"application_no":"APP-000067265",
"ref":"259a06539a4e9d75c39ec0e1b292077fee17c840",
},
{ '2c104b94-3705-45d2-bd1e-test2':
{
"application_no":"APP-000067265",
"ref":"259a06539a4e9d75c39ec0e1b292077fee17c840",
}
}
}
Valid request
Create aggregate policy will create new policies for a product and will return a dictionary with reference number passed as key Policy object having application_number , premium and reference_number as value
where:
- Product (string): Type of product for which policy is being created.
- Params (list): Product specific data to be sent.
it will return a dictionary which contains:
- reference_id passed for policy creation as key
- reference_number (string): Hexadecimal number provided by Pasarpolis for future reference.
- application_number (string): Number provided for future reference.
- premium (integer): Premium amount for policy.
Get Policy Status
Signature
policy = Pasarpolis::Policy.get_policy_status(<
ReferenceNumbers>
);
from pasarpolis import Policy
policy = Policy.get_policy_status(<
ReferenceNumbers>
);
import com.pasarpolis.sdk.models.Policy;
Policy[] policy = Policy.getPolicyStatus(<
ReferenceNumbers>
);
import(
pasarpolis_models "gitlab.com/pasarpolis/go-sdk.v2/models"
)
policy, error := pasarpolis_models.GetPolicyStatus(<
ReferenceNumbers>
);
client.getPolicyStatus(<
ReferenceNumbers>
);
require_once('pasarpolis/policy.php')
$policyObj = new policy($params);
$policy = $policyObj->get_policy_status(<
ReferenceNumbers>
, <
clientObj>
);
Example code:
require "pasarpolis_sdk"
refs = ["d77d436ad9485b86b8a0c18c3d2f70f77a10c43d"]
policy = Pasarpolis::Policy.get_policy_status(refs)
puts policies[0]
from pasarpolis import Policy
refs = ["d77d436ad9485b86b8a0c18c3d2f70f77a10c43d"]
policies = Policy.get_policy_status(refs)
print(policies[0])
import com.pasarpolis.sdk.models.Policy;
try {
String[] refs = {"d77d436ad9485b86b8a0c18c3d2f70f77a10c43d"});
Policy[] policies = Policy.getPolicyStatus(refs);
System.out.println(policies[0]);
}catch(Exception e) {
// Error Handling part
}
import(
pasarpolis_models "gitlab.com/pasarpolis/go-sdk.v2/models"
"fmt"
)
String[] refs = {"d77d436ad9485b86b8a0c18c3d2f70f77a10c43d"});
policies, error = pasarpolis_models.GetPolicyStatus(refs)
fmt.Println(policies[0])
const sdk = require('pasarpolis-sdk-nodejs')
const client = sdk.init(<PartnerCode>, <PartnerSecret>, <Host>)
const getPolicyStatus = client.getPolicyStatus('48fc2801e487af79ef311621f63e4133c')
/** It will give response as promise */
getPolicyStatus
.then(response => console.log(response))
.catch(err => console.log(err))
require_once('pasarpolis/policy.php')
$refs = Array("d77d436ad9485b86b8a0c18c3d2f70f77a10c43d");
$policyObj = new policy($params);
$policies = Policy -> get_policy_status($refs, $clientObj);
print_r($policies[0])
The above code snippet returns would return:
{
"ref":"d77d436ad9485b86b8a0c18c3d2f70f77a10c43d",
"application_no":"MI100073",
"document_url":"NA",
"policy_no":"-",
"status_code":2,
"status":"COMPLETED",
"issue_date":"2020-07-16 08:24:11",
"message":"",
"partner_ref":"b4b35667-ab56-38a6-8642-bd38b21e087d",
"product_key":"go-car-complete",
"expiry_date":"2017-06-22 16:59:59"",
"activation_url":"",
}
Get policy status will give status of the policy created by providing policy reference number. It will return array of policies object being queried for.
where:
- ReferenceNumbers (string): An array of string containing reference numbers
it will return an array of Policy objects. Each Policy object contains:
- reference_number (string): Hexadecimal number provided by Pasarpolis for future reference.
- application_number (string): Number provided for future reference.
- document_url (string): Url for policy document (if any).
- policy_number (string): Number for policy.
- status (string): Status of a given policy.
- status_code (integer): Status code of a given policy.
- issue_date (string): Issue date(YYYY-MM-DD h:mm:ss) of given policy.
- message (string): Message/Comments on a given policy if any
- partner_ref (string): Unique reference of a given policy.
- product_key (string): product name of a given policy
- expiry_date (string): expiry date(YYYY-MM-DD hh:mm:ss) of a given policy
- activation_url (string): activation url of a given policy if activation flow present for policy.
Cancellation
Signature
policy = Pasarpolis::Policy.cancel_policy(<
Ref_ID>
, <
Params>
);
from pasarpolis import Policy
policy = Policy.cancel_policy(<
ReferenceNumber>
, <
Params>
);
import com.pasarpolis.sdk.models.Policy;
Policy policy = Policy.cancelPolicy(<
RefID>
, <
Params>
);
import(
pasarpolis_models "gitlab.com/pasarpolis/go-sdk.v2/models"
)
policy, error := pasarpolis_models.CancelPolicy(<
ReferenceNumbers>
, <
Params>
);
client.cancelPolicy(<
RefID>
, <
Params>
);
require_once('pasarpolis/policy.php')
$policy = $policyObj->get_policy_status(<
ReferenceNumbers>
, <
Params>
, <
clientObj>
);
Example code:
require "pasarpolis_sdk"
params = {}
params["execution_date"] = ["2020-10-12 12:30:00"]
params["reason"] = ["wring policy"]
params["user"] = ["johndeo@gmail.com"]
policy = Pasarpolis::Policy.cancel_policy("xxxxx-xxxxx-xxxxxxxxxx", params)
puts policy
from pasarpolis import Policy
params = {}
params["execution_date"] = ["2020-10-12 12:30:00"]
params["reason"] = ["wring policy"]
params["user"] = ["johndeo@gmail.com"]
ref_id = "d77d436ad9485b86b8a0c18c3d2f70f77a10c43d"
policy = Policy.cancel_policy(ref_id, params)
print(policy)
import java.util.HashMap;
import com.pasarpolis.sdk.models.Policy;
try {
params.put ("execution_date", "2020-10-12 15:13:14")
params.put ("user", "johndeo@gmail.com")
params.put ("reason", "Wrong policy")
params.put ("execution_date", "2020-10-12 15:13:14")
Policy policies = Policy.cancelPolicy("1234-xxxx-xxxx", params);
}catch(Exception e) {
// Error Handling part
}
import(
pasarpolis_models "gitlab.com/pasarpolis/go-sdk.v2/models"
"fmt"
)
params :=map[string]interface{}{}
params["execution_date"] = ["2020-10-12 12:30:00"]
params["reason"] = ["wring policy"]
params["user"] = ["johndeo@gmail.com"]
policy, error := pasarpolis_models.CancelPolicy("123454321123", params)
fmt.Println(policy)
const sdk = require('pasarpolis-sdk-nodejs')
const client = sdk.init(<PartnerCode>, <PartnerSecret>, <Host>)
const refID = '456712345679876qwertg23'
const params {
"execution_date" : "2020-09-01 14:12:12",
"user" : "johndeo@example.com",
"reason" : "wrong policy created",
const cancelPolicy = client.cancelPolicy(refID, params)
/** It will give response as promise */
cancelPolicy
.then(response => console.log(response))
.catch(err => console.log(err))
require_once('pasarpolis/policy.php')
$policyObj = new policy($params);
$params = Array();
params["execution_date"] = ["2020-10-12 12:30:00"]
params["reason"] = ["wring policy"]
params["user"] = ["johndeo@gmail.com"]
$ref_id = "d77d436ad9485b86b8a0c18c3d2f70f77a10c43d"
$policies = Policy -> cancel_policy($ref_id, $params, $clientObj);
print_r($policies);
The above code snippet returns would return:
{
"closure_id":1
}
Cancellation will move an existing policy from COMPLETED state to CANCELLED and will return closure_id for reference
where:
- ReferenceNumbers (string): Reference number of policy that needs to be cancelled
-
Params (map): Params Body
- Execution Date(string): Date of cancellation
- Reason(string): Reason for cancellation
- User(string): User email
it will return an array of Policy objects. Each Policy object contains:
- closure_id (string): Reference number for cancellation request
Termination
Signature
policy = Pasarpolis::Policy.validate_aggregate_policy(<
Ref_ID>
, <
Params>
);
from pasarpolis import Policy
policy = Policy.terminate_policy(<
ReferenceNumber>
, <
Params>
);
import com.pasarpolis.sdk.models.Policy;
Policy policy = Policy.terminatePolicy(<
RefID>
, <
Params>
);
import(
pasarpolis_models "gitlab.com/pasarpolis/go-sdk.v2/models"
)
policy, error := pasarpolis_models.TerminatePolicy(<
ReferenceNumbers>
, <
Params>
);
client.terminatePolicy(<
RefID>
, <
Params>
);
require_once('pasarpolis/policy.php')
$policy = $policyObj->get_policy_status(<
ReferenceNumbers>
, <
Params>
, <
clientObj>
);
Example code:
require "pasarpolis_sdk"
params = {}
params["execution_date"] = ["2020-10-12 12:30:00"]
params["reason"] = ["wring policy"]
params["user"] = ["johndeo@gmail.com"]
policy = Pasarpolis::Policy.cancel_policy("xxxxx-xxxxx-xxxxxxxxxx", params)
puts policy
from pasarpolis import Policy
params = {}
params["execution_date"] = ["2020-10-12 12:30:00"]
params["reason"] = ["wring policy"]
params["user"] = ["johndeo@gmail.com"]
ref_id = "d77d436ad9485b86b8a0c18c3d2f70f77a10c43d"
policy = Policy.terminate_policy(ref_id, params)
print(policy)
import java.util.HashMap;
import com.pasarpolis.sdk.models.Policy;
try {
params.put ("execution_date", "2020-10-12 15:13:14")
params.put ("user", "johndeo@gmail.com")
params.put ("reason", "Wrong policy")
params.put ("execution_date", "2020-10-12 15:13:14")
Policy policies = Policy.terminatePolicy("1234-xxxx-xxxx", params);
System.out.println(policy);
}catch(Exception e) {
// Error Handling part
}
import(
pasarpolis_models "gitlab.com/pasarpolis/go-sdk.v2/models"
"fmt"
)
params :=map[string]interface{}{}
params["execution_date"] = ["2020-10-12 12:30:00"]
params["reason"] = ["wring policy"]
params["user"] = ["johndeo@gmail.com"]
policy, error := pasarpolis_models.TerminatePolicy("123454321123", params)
fmt.Println(policy)
const sdk = require('pasarpolis-sdk-nodejs')
const client = sdk.init(<PartnerCode>, <PartnerSecret>, <Host>)
const refID = '456712345679876qwertg23'
const params {
"execution_date" : "2020-09-01 14:12:12",
"user" : "johndeo@example.com",
"reason" : "wrong policy created",
const cancelPolicy = client.terminatePolicy(refID, params)
/** It will give response as promise */
cancelPolicy
.then(response => console.log(response))
.catch(err => console.log(err))
require_once('pasarpolis/policy.php')
$policyObj = new policy($params);
$params = Array();
params["execution_date"] = ["2020-10-12 12:30:00"]
params["reason"] = ["wring policy"]
params["user"] = ["johndeo@gmail.com"]
$ref_id = "d77d436ad9485b86b8a0c18c3d2f70f77a10c43d"
$policies = Policy -> cancel_policy($ref_id, $params, $clientObj);
print_r($policies);
The above code snippet returns would return:
{
"closure_id":1
}
Cancellation will move an existing policy from COMPLETED state to TERMINATED and will return closure_id for reference
where:
- ReferenceNumbers (string): Reference number of policy that needs to be cancelled
-
Params (map): Request Body
- Execution Date(string): Date of cancellation
- Reason(string): Reason for cancellation
- User(string): User email
it will return an array of Policy objects. Each Policy object contains:
- closure_id (string): Reference number for cancellation request
API References
API References Policies
URLs
You can access our API using these URLS :
Environment | URL |
---|---|
Sandbox | https://integrations-sandbox.pasarpolis.io |
Production | https://integrations.pasarpolis.io |
API Routes
Endpoint | HTTP Method | Link | |
---|---|---|---|
/api/v1/config/createpolicy/<product_key> | POST | Send product creation request data to generate policy | click here |
/api/v1/config/validatepolicy/<product_key> | POST | Send product creation request data to validate policy data | click here |
/api/v2/createpolicy/ | POST | Send product creation request data to generate policy | click here |
/api/v2/validatepolicy/ | POST | Send product creation request data to validate policy data | click here |
/api/v2/createaggregatepolicy/ | POST | Send product creation request data to generate aggregate policy | click here |
/api/v2/validateaggregatepolicy/ | POST | Send product creation request data to validate aggregate policy data | click here |
/api/v2/policystatus/ | POST | Check Statuses of given policies | click here |
/api/v2/cancellation/<ref_id> | POST | Cancel a given policy | click here |
/api/v2/termination/<ref_id> | POST | Terminate a given policy | click here |
Create Policy V1 API
This API will allows Partner to create policy on our portal. In request payload it expects all required main attributes along with other attributes required for a particular product . Attributes and validations on those attributes required for a product policy creation are shared in API specs shared via email.
Example for Product "bike-protection"
Sample JSON Request Body
{
"product":"phone-protection",
"dob": "1992-01-23",
"name": "Kaisar Wiranegara",
"brand": "365566",
"model": "365681",
"premium": 0,
"package_id": "combined",
"phone_no": "+6200000000000",
"reference_id": "a6f496ab-e2cc-4308-849e-50a4301ae321",
"vehicle_year": 2019,
"chassis_number": MH3RG5610KK003293
}
The above code snippet returns would return:
{
"application_no":"APP-000725168",
"premium":50000,
"ref":"d72cf8436c06968e9c60ee98bd6643062497cf36"
}
Definition
Endpoint | HTTP Method | Definition |
---|---|---|
/api/v1/config/createpolicy/<product_key> | POST | Send product creation request data to generate policy |
JSON Request Body Data:
Some Common mandatory fields
JSON Attribute | Definition | Required | Validation |
---|---|---|---|
package_code | name of package code | Yes | string, package code should be one of the list of package codes specified in api specs |
reference_id | Unique id | Yes | string, unique id for each policy |
name | customer | Yes | string, minimumlegth = 3 |
There can be additional mandatory and not mandatory attributes for policy creation depending on product. Here is list of attributes for product bike-protection
JSON Attribute | Definition | Required | Validation |
---|---|---|---|
dob | Insured's date of birth | Yes | string, Should be in the following format: YYYY-MM-DD. The age of user should be between 17-60 years. This date should be less than the current date. |
chasis_number | Chasis Number | Yes | string, can be used up to 4 active policy per chasis number |
vehicle_year | Year in which vehicle was brought | Yes | int, current year and vehicle year shouldn't have a gap of more than 7 years |
brand | Brand | Yes | int, brand id |
model | Model | Yes | int, model id |
premium | Premium of policy | No | int, should match package's premium if value is not 0 |
Validate Policy V1 API
This API will allows Partner to validate policy request on our portal. In request payload it expects all required main attributes along with other attributes required for a particular product . Attributes and validations on those attributes required for a product policy creation are shared in API specs shared via email.
Example for Product "bike-protection"
Sample JSON Request Body
{
"product":"phone-protection",
"dob": "1992-01-23",
"name": "Kaisar Wiranegara",
"brand": "365566",
"model": "365681",
"premium": 0,
"package_id": "combined",
"phone_no": "+6200000000000",
"reference_id": "a6f496ab-e2cc-4308-849e-50a4301ae321",
"vehicle_year": 2019,
"chassis_number": MH3RG5610KK003293
}
The above code snippet returns would return:
{
"message":"Valid request"
}
Definition
Endpoint | HTTP Method | Definition |
---|---|---|
/api/v1/config/validatepolicy/<product_key> | POST | Send product creation request data to validate policy data |
JSON Request Body Data:
Some Common mandatory fields
JSON Attribute | Definition | Required | Validation |
---|---|---|---|
package_code | name of package code | Yes | string, package code should be one of the list of package codes specified in api specs |
reference_id | Unique id | Yes | string, unique id for each policy |
name | customer | Yes | string, minimumlegth = 3 |
There can be additional mandatory and not mandatory attributes for policy request validation depending on product. Here is list of attributes for product bike-protection
JSON Attribute | Definition | Required | Validation |
---|---|---|---|
dob | Insured's date of birth | Yes | string, Should be in the following format: YYYY-MM-DD. The age of user should be between 17-60 years. This date should be less than the current date. |
chasis_number | Chasis Number | Yes | string, can be used up to 4 active policy per chasis number |
vehicle_year | Year in which vehicle was brought | Yes | int, current year and vehicle year shouldn't have a gap of more than 7 years |
brand | Brand | Yes | int, brand id |
model | Model | Yes | int, model id |
premium | Premium of policy | No | int, should match package's premium if value is not 0 |
Create Policy V2 API
This API will allows Partner to create policy on our portal. In request payload it expects all required main attributes along with other attributes required for a particular product . Attributes and validations on those attributes required for a product policy creation are shared in API specs shared via email.
Example for Product "bike-protection"
Sample JSON Request Body
{
"product":"phone-protection",
"dob": "1992-01-23",
"name": "Kaisar Wiranegara",
"brand": "365566",
"model": "365681",
"premium": 0,
"package_id": "combined",
"phone_no": "+6200000000000",
"reference_id": "a6f496ab-e2cc-4308-849e-50a4301ae321",
"vehicle_year": 2019,
"chassis_number": MH3RG5610KK003293
}
The above code snippet returns would return:
{
"application_no":"APP-000725168",
"premium":50000,
"ref":"d72cf8436c06968e9c60ee98bd6643062497cf36"
}
Definition
Endpoint | HTTP Method | Definition |
---|---|---|
/api/v2/createpolicy/ | POST | Send product creation request data to generate policy |
JSON Request Body Data:
Some Common mandatory fields
JSON Attribute | Definition | Required | Validation |
---|---|---|---|
package_code | name of package code | Yes | string, package code should be one of the list of package codes specified in api specs |
reference_id | Unique id | Yes | string, unique id for each policy |
name | customer | Yes | string, minimumlegth = 3 |
There can be additional mandatory and not mandatory attributes for policy request validation depending on product. Here is list of attributes for product bike-protection
JSON Attribute | Definition | Required | Validation |
---|---|---|---|
dob | Insured's date of birth | Yes | string, Should be in the following format: YYYY-MM-DD. The age of user should be between 17-60 years. This date should be less than the current date. |
chasis_number | Chasis Number | Yes | string, can be used up to 4 active policy per chasis number |
vehicle_year | Year in which vehicle was brought | Yes | int, current year and vehicle year shouldn't have a gap of more than 7 years |
brand | Brand | Yes | int, brand id |
model | Model | Yes | int, model id |
premium | Premium of policy | No | int, should match package's premium if value is not 0 |
Validate Policy V2 API
This API will allows Partner to validate policy request on our portal. In request payload it expects all required main attributes along with other attributes required for a particular product . Attributes and validations on those attributes required for a product policy creation are shared in API specs shared via email.
Example for Product "bike-protection"
Sample JSON Request Body
{
"product":"phone-protection",
"dob": "1992-01-23",
"name": "Kaisar Wiranegara",
"brand": "365566",
"model": "365681",
"premium": 0,
"package_id": "combined",
"phone_no": "+6200000000000",
"reference_id": "a6f496ab-e2cc-4308-849e-50a4301ae321",
"vehicle_year": 2019,
"chassis_number": MH3RG5610KK003293
}
The above code snippet returns would return:
{
"message":"Valid request"
}
Definition
Endpoint | HTTP Method | Definition |
---|---|---|
/api/v2/validatepolicy/ | POST | Send product creation request data to validate policy data |
JSON Request Body Data:
Some Common mandatory fields
JSON Attribute | Definition | Required | Validation |
---|---|---|---|
package_code | name of package code | Yes | string, package code should be one of the list of package codes specified in api specs |
reference_id | Unique id | Yes | string, unique id for each policy |
name | customer | Yes | string, minimumlegth = 3 |
There can be additional mandatory and not mandatory attributes for policy request validation depending on product. Here is list of attributes for product bike-protection
JSON Attribute | Definition | Required | Validation |
---|---|---|---|
dob | Insured's date of birth | Yes | string, Should be in the following format: YYYY-MM-DD. The age of user should be between 17-60 years. This date should be less than the current date. |
chasis_number | Chasis Number | Yes | string, can be used up to 4 active policy per chasis number |
vehicle_year | Year in which vehicle was brought | Yes | int, current year and vehicle year shouldn't have a gap of more than 7 years |
brand | Brand | Yes | int, brand id |
model | Model | Yes | int, model id |
premium | Premium of policy | No | int, should match package's premium if value is not 0 |
Create Aggregate Policy V2 API
This API will allows Partner to create aggregate policy on our portal. In request payload it expects all required main attributes along with other attributes required for a particular product . Attributes and validations on those attributes required for a product policy creation are shared in API specs shared via email.
Example for Product "bike-protection"
Sample JSON Request Body
[
{
"product":"phone-protection",
"dob": "1992-01-23",
"name": "Kaisar Wiranegara",
"brand": "365566",
"model": "365681",
"premium": 0,
"package_id": "combined",
"phone_no": "+6200000000000",
"reference_id": "a6f496ab-e2cc-4308-849e-50a4301ae321",
"vehicle_year": 2019,
"chassis_number": MH3RG5610KK003293
},
{
"product":"phone-protection",
"dob": "1992-01-23",
"name": "Kaisar Wiranegara",
"brand": "365566",
"model": "365681",
"premium": 0,
"package_id": "combined",
"phone_no": "+6200000000000",
"reference_id": "a6f496ab-e2cc-4308-849e-50a4301ae321",
"vehicle_year": 2019,
"chassis_number": MH3RG5610KK003293
}
]
The above code snippet returns would return:
{
"policies":{
"33551":{
"application_no":"APP-000725168",
"premium":50000,
"ref":"d72cf8436c06968e9c60ee98bd6643062497cf36"
},
"33552":{
"application_no":"APP-000725168",
"premium":50000,
"ref":"d72cf8436c06968e9c60ee98bd6643062497cf36"
}
}
}
Definition
Endpoint | HTTP Method | Definition |
---|---|---|
/api/v2/createaggregatepolicy/ | POST | Send product creation request data to generate aggregate policy |
JSON Request Body Data:
Some Common mandatory fields
JSON Attribute | Definition | Required | Validation |
---|---|---|---|
package_code | name of package code | Yes | string, package code should be one of the list of package codes specified in api specs |
reference_id | Unique id | Yes | string, unique id for each policy |
name | customer | Yes | string, minimumlegth = 3 |
There can be additional mandatory and not mandatory attributes for policy request validation depending on product. Here is list of attributes for product bike-protection
JSON Attribute | Definition | Required | Validation |
---|---|---|---|
dob | Insured's date of birth | Yes | string, Should be in the following format: YYYY-MM-DD. The age of user should be between 17-60 years. This date should be less than the current date. |
chasis_number | Chasis Number | Yes | string, can be used up to 4 active policy per chasis number |
vehicle_year | Year in which vehicle was brought | Yes | int, current year and vehicle year shouldn't have a gap of more than 7 years |
brand | Brand | Yes | int, brand id |
model | Model | Yes | int, model id |
premium | Premium of policy | No | int, should match package's premium if value is not 0 |
Validate Aggregate Policy V2 API
This API will allows Partner to validate aggregate policy request on our portal. In request payload it expects all required main attributes along with other attributes required for a particular product . Attributes and validations on those attributes required for a product policy creation are shared in API specs shared via email.
Example for Product "bike-protection"
Sample JSON Request Body
[
{
"product":"phone-protection",
"dob": "1992-01-23",
"name": "Kaisar Wiranegara",
"brand": "365566",
"model": "365681",
"premium": 0,
"package_id": "combined",
"phone_no": "+6200000000000",
"reference_id": "a6f496ab-e2cc-4308-849e-50a4301ae321",
"vehicle_year": 2019,
"chassis_number": MH3RG5610KK003293
},
{
"product":"phone-protection",
"dob": "1992-01-23",
"name": "Kaisar Wiranegara",
"brand": "365566",
"model": "365681",
"premium": 0,
"package_id": "combined",
"phone_no": "+6200000000000",
"reference_id": "a6f496ab-e2cc-4308-849e-50a4301ae321",
"vehicle_year": 2019,
"chassis_number": MH3RG5610KK003293
}
]
The above code snippet returns would return:
{
"message":"Valid request"
}
Definition
Endpoint | HTTP Method | Definition |
---|---|---|
/api/v2/validateaggregatepolicy/ | POST | Send product creation request data to validate aggregate policy data |
JSON Request Body Data:
Some Common mandatory fields
JSON Attribute | Definition | Required | Validation |
---|---|---|---|
package_code | name of package code | Yes | string, package code should be one of the list of package codes specified in api specs |
reference_id | Unique id | Yes | string, unique id for each policy |
name | customer | Yes | string, minimumlegth = 3 |
There can be additional mandatory and not mandatory attributes for policy request validation depending on product. Here is list of attributes for product bike-protection
JSON Attribute | Definition | Required | Validation |
---|---|---|---|
dob | Insured's date of birth | Yes | string, Should be in the following format: YYYY-MM-DD. The age of user should be between 17-60 years. This date should be less than the current date. |
chasis_number | Chasis Number | Yes | string, can be used up to 4 active policy per chasis number |
vehicle_year | Year in which vehicle was brought | Yes | int, current year and vehicle year shouldn't have a gap of more than 7 years |
brand | Brand | Yes | int, brand id |
model | Model | Yes | int, model id |
premium | Premium of policy | No | int, should match package's premium if value is not 0 |
Policy Status V2 API
This API will allow partner to check status of particular policy creation requests
Example for Product "bike-protection"
Sample JSON Request Body
{
"ids":[
"8695b5affd6b10ec7116f97cce745af508698aea"
]
}
The above code snippet returns would return:
[
{
"ref":"99fc4293d19f1e8533d52553240425b5f04925c9"
"application_no":"APP-010945796",
"document_url":"https://sample.com/testing/99fc4293d19f1e8533d50425b5f04925c9/APP.pdf",
"policy_no":"_",
"status_code":2,,
"status":"COMPLETED",
"issue_date":"2020-04-28 06:02:01",
"message":"",,
"partner_ref":"csp_0000014",,
"product_key":"bike-protection",,
"expiry_date":"2020-06-27 16:59:59",,
}
]
Definition
Endpoint | HTTP Method | Definition |
---|---|---|
/api/v2/policystatus/ | POST | Check Statuses of given policies |
JSON Request Body Data:
An array of reference ids is mandatory parameter
JSON Attribute | Definition | Required |
---|---|---|
ids | ref_id for which policy status is to be checked | Yes |
Cancellation Policy V2 API
This API will allow partner to cancel a particular policy (Only possible if policy is in COMPLETED state). For eg if wrong policy is created
Example for Product "bike-protection"
Sample JSON Request Body
{
"execution_date":"2020-03-03 16:00:00"
"reason":"Asked by customer"
"user":"john.doe@email.com"
}
The above code snippet returns would return:
{
"closure_id":15
}
Definition
Endpoint | HTTP Method | Definition |
---|---|---|
/api/v2/cancellation/<ref_id> | POST | Cancel a given policy |
JSON Request Body Data:
An array of reference ids is mandatory parameter
JSON Attribute | Definition | Required | validation |
---|---|---|---|
execution_date | execution date for cancel/terminate request | yes | string, date time YYYY-MM-DD HH:MMSS |
reason | reason for cancel/terminate | no | string |
user | email_id of user | no | string |
Termination Policy V2 API
This API will allow partner to terminate a particular policy (Only possible if policy is in COMPLETED state). For eg if wrong policy is created
Example for Product "bike-protection"
Sample JSON Request Body
{
"execution_date":"2020-03-03 16:00:00"
"reason":"Asked by customer"
"user":"john.doe@email.com"
}
The above code snippet returns would return:
{
"closure_id":15
}
Definition
Endpoint | HTTP Method | Definition |
---|---|---|
/api/v2/termination/<ref_id> | POST | Terminate a given policy |
JSON Request Body Data:
An array of reference ids is mandatory parameter
JSON Attribute | Definition | Required | validation |
---|---|---|---|
execution_date | execution date for cancel/terminate request | yes | string, date time YYYY-MM-DD HH:MMSS |
reason | reason for cancel/terminate | no | string |
user | email_id of user | no | string |
API References Claims
This is the general documentation which is there for how the claim integration is done with Pasarpolis and we have taken one product as a sample to explain our APIs. Please replace all params with expected valid values.
URLs
You can access our API using these URLS :
Environment | URL |
---|---|
Sandbox | https://integrations-sandbox.pasarpolis.io |
Production | https://integrations.pasarpolis.io |
API Routes
Endpoint | HTTP Method | Link | |
---|---|---|---|
/api/v3/claims/benefits/list/ | GET | This Api will help users to identify the benefits on which they can claim. As a part of claim creation process they need to send us the benefit_id provided in the response of this api with the application number. | click here |
/api/v3/claims/benefit/{{benefit_id}}/documents/ | GET | This API will list all the benfit documents along with the validation and type of the document required | click here |
/api/v3/claims/create_with_documents/ | POST | This API will allows users to create claim on our portal. | click here |
/api/v3/claims/update_with_documents/ | POST | This API will allow user to update the claims from reprocess state to document_complete in case of any document which was rejected while verification. | click here |
/api/v3/claims/{{claim_id}}/details/ | GET | This API will give you the current claim status along with other details. | click here |
Benefit List API
Sample Request Query
/api/v3/claims/benefits/list/?application_number=APP-000655580&is_detailed=true&partial_document=true
Sample Response Structure:
[{
"benefit_group_id":"adcf66ed-253d-48bc-9113-8634d5a7f1a6",
"benefit_group_name":"Layar Pecah",
"benefits": [{
"benefit_id":"97ca713d-2bfe-4c71-91ad-f2e7cd83818e",
"benefit_name":"Layar Pecah",
"benefit_slug":"Layar-Pecah",
"documents_required":[
{
"regex":null,
"required":true,
"default_value":null,
"name":"gadget_type",
"type":"string"
},
{
"regex":null,
"required":true,
"default_value":null,
"name":"serial_no",
"type":"string"
},
{
"regex":null,
"required":true,
"default_value":null,
"name":"gadget_screen_photo_before_repair",
"type":"image"
},
{
"regex":null,
"required":true,
"default_value":null,
"name":"invoice",
"type":"image"
},
{
"regex":null,
"required":true,
"default_value":null,
"name":"ktp-image-processing",
"type":"image"
}
],
"partial_documents":[
{
"regex":null,
"required":true,
"default_value":null,
"name":"repair_cost",
"type":"string"
},
{
"regex":null,
"required":true,
"default_value":null,
"name":"branch_address",
"type":"text"
},
{
"regex":null,
"required":true,
"default_value":null,
"name":"gadget_screen_photo_after_repair",
"type":"image"
}
]
}]
}]
This Api will help partner to identify the benefits on which they can claim. As a part of claim creation process they need to send us the benefit_id provided in the response of this api with the application number. For reference, this is the sample request and response for benefit list which is taking application_number as request params for which, user needs to get all existing benefits on this application number.
Definition
Endpoint | HTTP Method | Definition |
---|---|---|
/api/v3/claims/benefits/list/ | GET | This Api will help users to identify the benefits on which they can claim. As a part of claim creation process they need to send us the benefit_id provided in the response of this api with the application number. |
JSON Request Query Data:
Main attribute
JSON Attribute | Definition | Required |
---|---|---|
application_number | "Application Number for policy" | Yes |
is_detailed | "is_detailed flag is responsible for sending the benefit docs along with benefit" | No |
partial_document | "partial_document flag is responsible for sending the partial docs along with benefit" | No |
Create Claim With Documents API
Sample URL Request body
{
"reference_number": "APP-00012339",
"benefit_id": "33a73c9c-5045-4057-b0c9-98708fa168cf",
"benefit_slug": "jaminan-kerusakan-total",
"application_no": "APP-000578990",
"created_at": "2020-06-25 01:12:34",
"warning-physical-visit": "http://url"
"warning-email": "http://url"
"warning_letter": "http://url"
"medical-invoice": "http://url"
"proposed_amount": "100000000"
"tax-identification-number": "http://url"
"statement_letter_from_authorities": "http://url"
"payment-history": "http://url"
"witness_statement": "http://url"
"policy-certificate-internal": "http://url"
"ktp": "http://url"
"credit_aggrement": "http://url"
"family_certificate": "http://url"
}
The above code snippet returns would return:
{
"claim_number": "KLM-2008000011",
"status": "document_received"
}
This API will allows Partner to create claim on our portal. In request payload it expects all required main attributes along with other attributes required for a particular benefit . Attributes required for a benefit can be fetched from Benefit list API which also tells you the mandatory and non mandatory attributes need to be send along with the type of those attributes
Definition
Endpoint | HTTP Method | Definition |
---|---|---|
/api/v3/claims/create_with_documents/ | POST | This API will allows users to create claim on our portal. |
JSON Request Body Data
Example for Benefit "Asuransi Kredit"
Common Mandatory Attributes
JSON Attribute | Definition | Required |
---|---|---|
reference_number | "Reference Number" | Yes |
benefit_id | "Benefit ID" | Yes |
benefit_slug | "Benefit Slug" | Yes |
application_no | "Application Number" | Yes |
created_at | "Created At" | Yes |
Documents required for a particular benefit. As in this sample request for Benefit "Asuransi Kredit". These attributes may vary as per the benefits being choosen from the benefit List API and depending upon that only these attributes need to be sent. We have taken one example product to explain this.
JSON Attribute | Definition | Required |
---|---|---|
warning-physical-visit | "Warning Physical Visit" | Yes |
warning-email | "Warning Email" | Yes |
warning_letter | "Warning Letter" | Yes |
medical-invoice | "Medical Invoice" | Yes |
warning-physical-visit | "Warning Physical Visit" | Yes |
proposed_amount | "Proposed Amount" | Yes |
tax-identification-number | "Tax Identification Number" | Yes |
statement_letter_from_authorities | "Statement Letter from Authorities" | Yes |
payment-history | "Payment History" | Yes |
witness_statement | "Witness Statement" | Yes |
policy-certificate-internal | "Policy Certificate Internal" | Yes |
ktp | "KTP image" | Yes |
credit_aggrement | "Credit Agreement" | Yes |
family_certificate | "Family Certificate" | Yes |
Update Claim Documents API
Sample URL Request body
{
"claim_number": "KLM-2008000001",
"ktp": "https://updated-ktp.png",
"chronology": "Hello
world"
}
The above code snippet returns would return:
{
"success": true,
"message": "Documents Successfully Updated"
}
This API will allow user to update the claims from reprocess state to document_complete in case of any document which was rejected while verification. In request payload it expects claim_number as required main attribute which will be same as returned in the response of Create Claim With Documents API. Except this it can take all required document for a particular benefit which need to be updated .
Definition
Endpoint | HTTP Method | Definition |
---|---|---|
/api/v3/claims/update_with_documents/ | POST | This API will allow user to update the claims from reprocess state to document_complete in case of any document which was rejected while verification. |
JSON Request Body Data:
Main attribute
JSON Attribute | Definition | Required |
---|---|---|
claim_number | "Claim Number" | Yes |
Documents required for a particular benefit which need to be updated. As in this sample request for Benefit "Asuransi Kredit"
JSON Attribute | Definition | Required |
---|---|---|
ktp-image-processing | "KTP image" | No |
chronology | "Chronology" | No |
Claim Details API
Sample URL Request query params
/api/v3/claims/{{claim_number}}/details/
The above code snippet returns would return:
{
"claim_number": "KLM-2007006088",
"status": "Customer/Pasarpolis Received Payment From Provider",
"amount": 70000.0,
"application_no": "APP-000758162",
"created_at": "2020-07-21 09:01:16",
"updated_at": "2020-07-23 12:28:00",
"benefit_id": "fb7ac6ec-1fc1-49e0-85ed-17197b368de9",
"benefit_slug": "santunan-tunai-rawat-inap-dengan-pembedahan",
"policy_number": "DAN000014",
"policy_holder_name": "Insured Name 3",
"documents": {
"impatient_claim_form": {
"value": "https://storage.d7baa4b0-8d8b-4b33-8320-3ff18a110b1f.png",
"status": "valid"
},
"ktp-others": {
"value": "https://storage.7a1867de-b481-487b-a273-2948e3b0998e.png",
"status": "valid"
},
"doctor_certificate": {
"value": [
"https://storage.84640a46-4aa7-4282-b6f3-eff01e54e9fa.png"
],
"status": "valid"
},
"medical_bills": {
"value": [
"https://storage.5c500538-a19d-47b1-81e8-26b53086d44a.png"
],
"status": "valid"
},
"medical_records": {
"value": [
"https://storage.ba1f6a4f-94ea-4de8-9148-ecf5ce8e002c.png"
],
"status": "valid"
},
"account_number": {
"value": "https://storage.7a1867de-b481-487b-a273-2948e3b0998e.png",
"status": "valid"
},
"bank_name": {
"value": "https://storage.7a1867de-b481-487b-a273-2948e3b0998e.png",
"status": "valid"
},
"account_holder_name": {
"value": "https://storage.7a1867de-b481-487b-a273-2948e3b0998e.png",
"status": "valid"
},
},
"states": [
{
"status": "initiated",
"status_group": "initiated",
"status_changed_at": "2020-07-21 09:01:16"
},
{
"status": "document_received",
"status_group": "document_received",
"status_changed_at": "2020-07-21 09:02:06"
},
{
"status": "document_complete",
"status_group": "document_received",
"status_changed_at": "2020-07-21 09:02:07"
},
{
"status": "document_verified",
"status_group": "document_verified",
"status_changed_at": "2020-07-21 09:02:55"
},
{
"status": "claim_pending_from_pasarpolis",
"status_group": "document_verified",
"status_changed_at": "2020-07-21 09:03:08"
},
{
"status": "claim_accepted",
"status_group": "approved",
"status_changed_at": "2020-07-21 09:03:19"
},
{
"status": "claim_payment_pending",
"status_group": "approved",
"status_changed_at": "2020-07-21 09:03:19"
},
{
"status": "claim_payment_triggered",
"status_group": "approved",
"status_changed_at": "2020-07-21 09:03:33"
},
{
"status": "claim_payment_paid",
"status_group": "settled",
"status_changed_at": "2020-07-21 09:03:39"
},
{
"status": "settled",
"status_group": "settled",
"status_changed_at": "2020-07-21 09:03:48"
},
],
"transaction_details": [
{
"transaction_id": "quertyui",
"status": "success",
"completion_date": "2020-07-21 09:03:33",
"account_number": "AXCP123456",
"account_holder_name": "Testing XYZ",
"bank_name": "XYZ"
}
],
}
This API will give you the current claim status along with other details. In request it expects claim_number for which detials need to be fetched. claim_number can be get from the response of Create Claim With Documents API
Definition
Endpoint | HTTP Method | Definition |
---|---|---|
/api/v3/claims/{{claim_number}}/details/ | GET | This API will give you the current claim status along with other details. |
Webhook
Possible Statuses
Claim Status | Status Code | Definition |
---|---|---|
Initiated | initiated | claim has been created at our end. |
Document Received | document_received | claim documents have been received at our end. |
Document Complete | document_complete | claim documents have been analysed at our end. |
Document Verified | document_verified | claim documents have been verified at our end. |
Document Reprocess | reprocess | One or more document has been rejected at end. |
Claim Pending Approval From Pasarpolis | claim_pending_from_pasarpolis | claim is in processing and amount has been calculated |
Claim Accepted | claim_accepted | claim has been accepted at our end. |
Claim Rejected | claim_rejected | Claim has been rejected at our end. |
Payment Pending | claim_payment_pending | claim payment process has been initiated. |
Payment Triggered | claim_payment_triggered | claim payment has been triggered from our end. |
Payment Failed | claim_payment_failed | claim payment got failed at our end. |
Payment Paid | claim_payment_paid | claim payment has been made. |
Settled | settled | claim has been settled. |
Possible Error Codes
Error Code | Error |
---|---|
CLAIM_INTEGRATION_101 | Claim already present for given reference |
BENEFIT_104 | benefit slug is not provided |
CLAIM_106 | Application Number is required |
CLAIM_119 | Claim Documents are mandatory |
CLAIM_120 | Claim creation date is mandatory |
CLAIM_139 | Invalid Application Number provided |
BENEFIT_103 | Package Code is not provided |
CLAIM_147 | Claim can be created only after < X> days since coverage end date |
CLAIM_147 | Claim cannot be created after < X> days since coverage end date |
CLAIM_122 | Application no is not valid for this benefit |
POLICY_DETAIL_112 | Product key not provided in policy detail |
POLICY_DETAIL_119 | Package code not provided in policy detail |
CLAIM_123 | Future date claim cannot be created |
CLAIM_101 | Invalid benefit provided |
CLAIM_110 | Salah satu klaim Anda sudah dalam status pemrosesan sehingga Anda tidak dapat membuat yang baru |
CLAIM_103 | Klaim Anda untuk manfaat ini telah melebihi batas pengajuan yang ditentukan |
CLAIM_102 | Klaim Anda untuk manfaat ini telah melebihi batas pengajuan yang ditentukan |
CLAIM_106 | Application Number is required |
CLAIM_108 | batas klaim maksimum untuk grup manfaat ini telah mencapai |
CLAIM_105 | Policy dibatalkan |
BENEFIT_104 | benefit slug is not provided |
CLAIM_120 | benefit slug is not provided |
BENEFIT_102 | product key is not provided |
CLAIM_119 | Claim Documents are mandatory |
CLAIM_120 | Claim creation date is mandatory |
OPS_CLAIM_102 | Incorrect format of given date range, should be YYYY-MM-DD hh:mm:ss |
CLAIM_121 | Claim creation date is not in valid format |
CLAIM_123 | Future date claim cannot be created |
FORM_101 | Invalid form name provided |
Request Payload
For Claim Status claim_rejected
Sample URL Request body
#Body accepts an array of references returned from the application post
{
"partner_reference_id": " "
"claim_number": "KLM-xxxxxxxxxx"
"claim_status": "initiated"
"data": {
"reject_reason": "claim coverage date has ended"
}
}
JSON Attribute | Definition | Required | Validation |
---|---|---|---|
partner_reference_id | order_number attached with the policy |
Yes | Format: - pp-xxx.. |
claim_number | Identification number of the claim | Yes | Format : - KLM-2006100212 |
data | It will contain information about the claim depending on its current status | Yes | will be a blank dictionary at all claim statues except claim_rejected ,
reprocess , claim_payment_paid and settled |
reject_reason | It contain the reason behind the claim rejection. | Yes | mandatory if the status is claim_rejected |
For Claim Status claim_payment_paid
or settled
Sample URL Request body
#Body accepts an array of references returned from the application post
{
"partner_reference_id": " "
"claim_number": "KLM-xxxxxxxxxx"
"claim_status": "initiated"
"data": {
"paid_claim_amount": 1200
}
}
JSON Attribute | Definition | Required | Validation |
---|---|---|---|
partner_reference_id | order_number attached with the policy |
Yes | Format: - pp-xxx.. |
claim_number | Identification number of the claim | Yes | Format : - KLM-2006100212 |
data | It will contain information about the claim depending on its current status | Yes | will be a blank dictionary at all claim statues except claim_rejected ,
reprocess , claim_payment_paid and settled |
paid_claim_amount | It contain the claim amount that has been paid to the user | Yes | mandatory if the status is claim_payment_paid or settled |
For Claim Status reprocess
Sample URL Request body
#Body accepts an array of references returned from the application post
{
"partner_reference_id": " "
"claim_number": "KLM-xxxxxxxxxx"
"claim_status": "initiated"
"data": {
"attributes": ["insured_id"]
}
}
JSON Attribute | Definition | Required | Validation |
---|---|---|---|
partner_reference_id | order_number attached with the policy |
Yes | Format: - pp-xxx.. |
claim_number | Identification number of the claim | Yes | Format : - KLM-2006100212 |
data | It will contain information about the claim depending on its current status | Yes | will be a blank dictionary at all claim statues except claim_rejected ,
reprocess , claim_payment_paid and settled |
attributes | It will come in case of claim document rejection.each element of the array uniquely identifies the document that has been rejected. | Yes | must be from the set of document supported by the product |
Response Body JSON
If the response status code is 200:
Sample URL Response body for status code 200
#Body accepts an array of references returned from the application post
{
"status_code": 200
"message": "success"
}
JSON Attribute | Definition |
---|---|
status_code | Status Code |
message | Response Message |
If the response status code is 400:
Sample URL Response body for status code 400
#Body accepts an array of references returned from the application post
{
"status_code": 400
"message": "invalid request"
}
JSON Attribute | Definition |
---|---|
status_code | Status Code |
message | Response Message |
If the response status code is 500:
Sample URL Response body for status code 500
#Body accepts an array of references returned from the application post
{
"status_code": 500
"message": "Something went wrong, please try after sometime"
}
JSON Attribute | Definition |
---|---|
status_code | Status Code |
message | Response Message |
Errors
Pasarpolis SDK uses the following error codes:
Error Code | Meaning |
---|---|
400 | Bad Request -- Something wrong in request payload. Check API documentation describing payload of the endpoint you are calling. |
403 | Forbidden -- Server is not able to validate HMAC signature of this request. Make sure you are calculating the signature exactly same way as described by the documentation. |
404 | Not Found -- The specified API or resource could not be found. Refer API documentation to verify you are calling the correct endpoint. |
409 | Duplicate Request. A previous request for same data and action has already been processed. Current response body contains information about already processed request e.g. ref and application number in case of policy creation. |
500 | Internal Server Error -- We had a problem with our server. Try again later. |
Calculating HMAC
Every request needs to be signed and include the signature in request header.
How to calculate the signature?
First, you need to calculate string to be signed. String to sign can be obtained as:
string_to_sign = VERB + "\n" + content_md5 + "\n" + content_type +
"\n" + timestamp + "\n" + api_path
- VERB: Http verb ( in upper case ) used to make the call e.g. GET, POST
- content_md5: MD5 hash of the request body. Also to be sent as 'Content-MD5' header. Should be empty string in case of get request
- content_type: Content-type of the request body. Also to be sent as 'Content-Type' header.
- timestamp: Current time in RFC2616 format. Eg: 'Mon, 16 Jul 2018 08:27:53 GMT'. Also send the date in 'X-PP-Date' header.
- api_path: Part of the URL after base domain and without query string (in lower case only). Eg: For http://sandbox-integrations.pasarpolis.io/api/v2/policydetails/?id=mypolicyid, api_path is /api/v2/policydetails/
Calculate hmac for partner_secret ( received from PasarPolis ) and string_to_sign using sha256.
hmac_digest = hmac(partner_secret, string_to_sign, sha256).digest()
Final value to be used in 'Signature' header:
base64encode(partner_code + ":" + base64encode(hmac_digest))
where partner_code is shared by PasarPolis and hmac_digest is digest of hmac calculated in previous step.
Values to be sent in Header:
'Content-MD5': {content_md5}
'Content-Type': {content_type}
'X-PP-Date': {timestamp}
'Partner-Code': {partner_id}
'Signature': {hmac} as calculated above