Introduction
Welcome to the Mister Prakan (MP) API! You can use our API to access MP API endpoints, which can get information on various insurance campaigns, premiums, coverage details in our database.
We have language bindings in CURL-Shell/Javascript/AJAX/C# and more are coming! 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
To authorize, include your Authentication code with every request:
# With shell, you can just pass the correct header with each request
curl "api_endpoint_here" \
-H "Authorization: {{authcode}}"
var aData = ['authcode'];
string authcode = "authcode";
Make sure to replace
authcode
with your Authentication code.
Our API uses API keys to allow access to the API. You can register a new API key at our developer portal.
Our API expects for the API key to be included in all API requests to the server looks like the following:
Authorization: {{autcode}}
Motor (Car)
Get Makes
var aData = ['authcode'];
var jsonData = JSON.stringify({ aData: aData });
$.ajax({
type: "POST",
contentType: "application/json; charset=utf-8",
url: 'https://misterprakan.com/apiws/motor/afmotor.svc/getmakes',
data: jsonData,
dataType: "json",
success: function (data) {
$(data.d).each(function (index, value) {
//example
$("#quotes").append("<tr><td>" + value.manu + "</td></tr>");
});
},
});
The above command returns JSON structured like this:
[
{
"status": "OK",
"carmanuid": "19",
"manu": "TOYOTA",
"country": "J"
}
{
"status": "OK",
"carmanuid": "15",
"manu": "HONDA",
"country": "J"
}
]
This endpoint retrieves the makes of the car (for insurance only).
HTTP Request
POST https://misterprakan.com/apiws/motor/afmotor.svc/getmakes
Query Parameters
Parameter | Mandatory | Values | Description |
---|---|---|---|
authcode | Yes | 'authcode' | Your Authentication code |
JSON Vars
Var | Description |
---|---|
status | API status |
carmanuid | Car manufacture id |
manu | Car manufacture's name |
country | Car manufacture's origin |
Get Models
var aData = ['authcode','TOYOTA'];
var jsonData = JSON.stringify({ aData: aData });
$.ajax({
type: "POST",
contentType: "application/json; charset=utf-8",
url: 'https://misterprakan.com/apiws/motor/afmotor.svc/getmodels',
data: jsonData,
dataType: "json",
success: function (data) {
$(data.d).each(function (index, value) {
//example
$("#quotes").append("<tr><td>" + value.model + "</td></tr>");
});
},
});
The above command returns JSON structured like this:
[
{
"status": "OK",
"carmodelid": "4",
"carmodel": "YARIS",
"cargroup": "5",
"amount": "599000"
}
{
"status": "OK",
"carmodelid": "3",
"carmodel": "VIOS",
"cargroup": "J",
"amount": "619000"
}
]
This endpoint retrieves the models based on the car make (for insurance only).
HTTP Request
POST https://misterprakan.com/apiws/motor/afmotor.svc/getmodels
Query Parameters
Parameter | Mandatory | Values | Description |
---|---|---|---|
authcode | Yes | 'authcode' | Your Authentication code |
make | Yes | 'TOYOTA' | Car's Make |
JSON Vars
Var | Description |
---|---|
status | API status |
carmodelid | ID of the model |
carmodel | Car's model |
cargroup | Car's insurance group |
amount | Car's new amount (Red Plate) |
Get Quotes
var aData = ['authcode','2016','TOYOTA','YARIS',null,null,'1'];
var jsonData = JSON.stringify({ aData: aData });
$.ajax({
type: "POST",
contentType: "application/json; charset=utf-8",
url: 'https://misterprakan.com/apiws/motor/afmotor.svc/getquotes',
data: jsonData,
dataType: "json",
success: function (data) {
$(data.d).each(function (index, value) {
//example
$("#quotes").append("<tr><td>" + value.logo + "</td></tr>");
});
},
});
The above command returns JSON structured like this:
[
{
"status": "OK",
"premiumid": 1,
"logo": "vib.jpg",
"company": "วิริยะ",
"engcompany" : "Viriyah",
"rating": 5,
"rec": 1,
"cargroup": 1,
"type": 1,
"condition": "อู่",
"deduct": 5000,
"netpremium": 12000,
"totalpremium": 15000,
"salepremium": 10000,
"salecom": 5000,
"owndamage": 500000,
"fire": 500000,
"theft": 500000,
"one": 1,
"two": 1,
"three": 1,
"four": 1,
"five": 1,
"six": 1,
"seven": 1,
"special" : "Free Starbuck Card!"
}
]
This endpoint retrieves all car insurance premium campaigns.
HTTP Request
POST https://misterprakan.com/apiws/motor/afmotor.svc/getquotes
Query Parameters
Parameter | Mandatory | Values | Description |
---|---|---|---|
authcode | Yes | 'authcode' | Your Authentication code |
year | Yes | '2016' | Car's Year |
make | Yes | 'TOYOTA' | Car's Make |
model | Yes | 'YARIS' | Car's Model |
condition | No | 'อู่' or 'ห้าง' | Car insurance condition. NULL to include ALL |
city | No | 'กรุงเทพ' or 'ต่างจังหวัด' | Car's registered city. NULL if don't know |
class | Yes | '1' or '2+' or '3+' or '3' | Insurance Class |
JSON Vars
Var | Description |
---|---|
status | API status |
premiumid | ID of the premium |
logo | Logo of the insurance company |
company | Name of the insurance company in Thai |
engcompany | Name of the insurance company in English |
rating | Rating of this insurance campaign. 0 to 5 |
rec | 1 or 0. 1 = Recommended, 0 = Not recommended |
cargroup | Group of the car based on insurance company |
type | Insurance Class. 1, 2+, 3+ or 3 |
condition | Condition of the premium |
deduct | Deductible amount |
netpremium | Net premium amount (amount before VAT & Stamps) |
totalpremium | Total premium amount (This amount is the full price) |
salepremium | Premium after commission (amount after commission) |
salecom | commission amount (if sold at full price) |
owndamage | Own damage amount |
fire | Fire damage amount |
theft | Theft damage amount |
one | Third-party : Death or Dismemberment / Person |
two | Third-party : Death or Dismemberment / Time |
three | Third-party : Public Liability |
four | Personal Accident |
five | Medical Expenses |
six | Bail Bond |
seven | Number of people covered in a car |
special | Promotion |
Get Coverage
var aData = ['authcode','premiumid','2016','TOYOTA','YARIS'];
var jsonData = JSON.stringify({ aData: aData });
$.ajax({
type: "POST",
contentType: "application/json; charset=utf-8",
url: 'https://misterprakan.com/apiws/motor/afmotor.svc/getcoverage',
data: jsonData,
dataType: "json",
success: function (data) {
$(data.d).each(function (index, value) {
//example
$("#quotes").append("<tr><td>" + value.logo + "</td></tr>");
});
},
});
The above command returns JSON structured like this:
[
{
"status": "OK",
"premiumid": 1,
"logo": "vib.jpg",
"company": "วิริยะ",
"engcompany" : "Viriyah",
"rating": 5,
"rec": 1,
"cargroup": 1,
"type": 1,
"condition": "อู่",
"deduct": 5000,
"netpremium": 12000,
"totalpremium": 15000,
"salepremium": 10000,
"salecom": 5000,
"owndamage": 500000,
"fire": 500000,
"theft": 500000,
"one": 1,
"two": 1,
"three": 1,
"four": 1,
"five": 1,
"six": 1,
"seven": 1,
"special" : "Free Starbuck Card!"
}
]
This endpoint retrieves coverage details based on the(one) premium ID.
HTTP Request
POST https://misterprakan.com/apiws/motor/afmotor.svc/getcoverage
Query Parameters
Parameter | Mandatory | Values | Description |
---|---|---|---|
authcode | Yes | 'authcode' | Your Authentication code |
premiumid | Yes | '19868' | Premium's ID (Get ID from getquotes API) |
year | Yes | '2016' | Car's Year |
make | Yes | 'TOYOTA' | Car's Make |
model | Yes | 'YARIS' | Car's Model |
JSON Vars
Var | Description |
---|---|
status | API status |
premiumid | ID of the premium |
logo | Logo of the insurance company |
company | Name of the insurance company in Thai |
engcompany | Name of the insurance company in English |
rating | Rating of this insurance campaign. 0 to 5 |
rec | 1 or 0. 1 = Recommended, 0 = Not recommended |
cargroup | Group of the car based on insurance company |
type | Insurance Class. 1, 2+, 3+ or 3 |
condition | Condition of the premium |
deduct | Deductible amount |
netpremium | Net premium amount (amount before VAT & Stamps) |
totalpremium | Total premium amount (This amount is the full price) |
salepremium | Premium after commission (amount after commission) |
salecom | commission amount (if sold at full price) |
owndamage | Own damage amount |
fire | Fire damage amount |
theft | Theft damage amount |
one | Third-party : Death or Dismemberment / Person |
two | Third-party : Death or Dismemberment / Time |
three | Third-party : Public Liability |
four | Personal Accident |
five | Medical Expenses |
six | Bail Bond |
seven | Number of people covered in a car |
special | Promotion |
Send Lead
var aData = ['authcode','en','Car','John Doe','A1234556','029859123','api@api.com','Johnline','Bangkok','1กจ 2564กท','4','2016','18686','Bank','15000','300000','Google'];
var jsonData = JSON.stringify({ aData: aData });
$.ajax({
type: "POST",
contentType: "application/json; charset=utf-8",
url: 'https://misterprakan.com/apiws/motor/afmotor.svc/sendlead',
data: jsonData,
dataType: "json",
success: function (data) {
$(data.d).each(function (index, value) {
//example
$("#quotes").append("<tr><td>" + value.leadid + "</td></tr>");
});
},
});
The above command returns JSON structured like this:
[
{
"status": "OK",
"leadid": "1200"
}
]
This endpoint sends the lead details to us.
HTTP Request
POST https://misterprakan.com/apiws/motor/afmotor.svc/sendlead
Query Parameters
Parameter | Mandatory | Values | Description |
---|---|---|---|
authcode | Yes | 'authcode' | Your Authentication code |
lag | No | 'th' or 'en' | Lead's language |
insurancetype | Yes | 'Car' | Please input Car |
name | No | 'John Doe' | Lead's Name |
citizenid | No | 'A1234556' | Lead's Passport/Citizen ID # |
phone | No | '029859123' | Lead's phone # |
No | 'api@api.com' | Lead's email | |
line | No | 'Johnline' | Lead's Line (Chat) id |
address | No | 'Bangkok' | Lead's address |
license | No | '1กจ 2564 กท' | Lead's car license plate |
carmodelid | Yes | '4' | Car's model ID (Get ID from getmodels API) |
caryear | Yes | '2016' | Car's year |
premiumid | No | '18686' | Premium's ID (Get ID from getquotes/getcoverage API) |
paymenttype | No | 'Bank' or 'CreditCard' or 'Paylite' | Payment method |
salepremium | No | '15000' | Premium that you sells |
owndamage | No | '300000' | Owndamage for the car (Get from getquotes/getcoverage API) |
source | No | 'Google' | The source of the lead. (SEO,Google Ad,Facebook, etc.) |
JSON Vars
Var | Description |
---|---|
status | API status |
leadid | Lead's ID |
Motor (Motorbike)
Get Makes
var aData = ['authcode'];
var jsonData = JSON.stringify({ aData: aData });
$.ajax({
type: "POST",
contentType: "application/json; charset=utf-8",
url: 'https://misterprakan.com/apiws/motor/afmotor.svc/getmakes',
data: jsonData,
dataType: "json",
success: function (data) {
$(data.d).each(function (index, value) {
//example
$("#quotes").append("<tr><td>" + value.manu + "</td></tr>");
});
},
});
The above command returns JSON structured like this:
[
{
"status": "OK",
"carmanuid": "19",
"manu": "HONDA",
"country": "J"
}
{
"status": "OK",
"carmanuid": "15",
"manu": "KAWASAKI",
"country": "J"
}
]
This endpoint retrieves the makes of the bike (for insurance only).
HTTP Request
POST https://misterprakan.com/apiws/motor/afmotor.svc/getbikemakes
Query Parameters
Parameter | Mandatory | Values | Description |
---|---|---|---|
authcode | Yes | 'authcode' | Your Authentication code |
JSON Vars
Var | Description |
---|---|
status | API status |
carmanuid | Bike manufacture id |
manu | Bike manufacture's name |
country | Bike manufacture's origin |
Get Quotes
var aData = ['authcode','2016','HONDA','CBR','100000','250'];
var jsonData = JSON.stringify({ aData: aData });
$.ajax({
type: "POST",
contentType: "application/json; charset=utf-8",
url: 'https://misterprakan.com/apiws/motor/afmotor.svc/getbikequotes',
data: jsonData,
dataType: "json",
success: function (data) {
$(data.d).each(function (index, value) {
//example
$("#quotes").append("<tr><td>" + value.logo + "</td></tr>");
});
},
});
The above command returns JSON structured like this:
[
{
"status": "OK",
"premiumid": 1,
"logo": "vib.jpg",
"company": "วิริยะ",
"engcompany" : "Viriyah",
"rating": 5,
"rec": 1,
"cargroup": 1,
"type": 1,
"condition": "อู่",
"deduct": 5000,
"netpremium": 12000,
"totalpremium": 15000,
"salepremium": 10000,
"salecom": 5000,
"owndamage": 500000,
"fire": 500000,
"theft": 500000,
"one": 1,
"two": 1,
"three": 1,
"four": 1,
"five": 1,
"six": 1,
"seven": 1,
"special" : "Free Starbuck Card!"
}
]
This endpoint retrieves all bike insurance premium campaigns.
HTTP Request
POST https://misterprakan.com/apiws/motor/afmotor.svc/getbikequotes
Query Parameters
Parameter | Mandatory | Values | Description |
---|---|---|---|
authcode | Yes | 'authcode' | Your Authentication code |
year | Yes | '2016' | Car's Year |
make | Yes | 'HONDA' | Car's Make |
model | No | 'CBR' | Car's Model |
suminsure | Yes | '100000' | Insured amount that you want |
engine* | Yes* | '75' or '250' or '500' or '1000' | Bike's engine size* |
Bike's Engine size*
Values | Description |
---|---|
'75' | 75cc - 150cc |
'250' | 250cc - 499cc |
'500' | 500cc - 999cc |
'1000' | More than 1,000cc |
JSON Vars
Var | Description |
---|---|
status | API status |
premiumid | ID of the premium |
logo | Logo of the insurance company |
company | Name of the insurance company in Thai |
engcompany | Name of the insurance company in English |
rating | Rating of this insurance campaign. 0 to 5 |
rec | 1 or 0. 1 = Recommended, 0 = Not recommended |
cargroup | Group of the car based on insurance company |
type | Insurance Class. 1, 2+, 3+ or 3 |
condition | Condition of the premium |
deduct | Deductible amount |
netpremium | Net premium amount (amount before VAT & Stamps) |
totalpremium | Total premium amount (This amount is the full price) |
salepremium | Premium after commission (amount after commission) |
salecom | commission amount (if sold at full price) |
owndamage | Own damage amount |
fire | Fire damage amount |
theft | Theft damage amount |
one | Third-party : Death or Dismemberment / Person |
two | Third-party : Death or Dismemberment / Time |
three | Third-party : Public Liability |
four | Personal Accident |
five | Medical Expenses |
six | Bail Bond |
seven | Number of people covered in a car |
special | Promotion |
Get Coverage
var aData = ['authcode','premiumid','2016','HONDA','CBR','100000'];
var jsonData = JSON.stringify({ aData: aData });
$.ajax({
type: "POST",
contentType: "application/json; charset=utf-8",
url: 'https://misterprakan.com/apiws/motor/afmotor.svc/getbikecoverage',
data: jsonData,
dataType: "json",
success: function (data) {
$(data.d).each(function (index, value) {
//example
$("#quotes").append("<tr><td>" + value.logo + "</td></tr>");
});
},
});
The above command returns JSON structured like this:
[
{
"status": "OK",
"premiumid": 1,
"logo": "vib.jpg",
"company": "วิริยะ",
"engcompany" : "Viriyah",
"rating": 5,
"rec": 1,
"cargroup": 1,
"type": 1,
"condition": "อู่",
"deduct": 5000,
"netpremium": 12000,
"totalpremium": 15000,
"salepremium": 10000,
"salecom": 5000,
"owndamage": 500000,
"fire": 500000,
"theft": 500000,
"one": 1,
"two": 1,
"three": 1,
"four": 1,
"five": 1,
"six": 1,
"seven": 1,
"special" : "Free Starbuck Card!"
}
]
This endpoint retrieves coverage details based on the(one) premium ID.
HTTP Request
POST https://misterprakan.com/apiws/motor/afmotor.svc/getbikecoverage
Query Parameters
Pa### Query Parameters
Parameter | Mandatory | Values | Description |
---|---|---|---|
authcode | Yes | 'authcode' | Your Authentication code |
premiumid | Yes | '19868' | Premium's ID (Get ID from getbikequotes API) |
year | Yes | '2016' | Bike's Year |
make | Yes | 'HONDA' | Bike's Make |
model | No | 'CBR' | Bike's Model |
suminsure | Yes | '100000' | Insured amount that you want |
JSON Vars
Var | Description |
---|---|
status | API status |
premiumid | ID of the premium |
logo | Logo of the insurance company |
company | Name of the insurance company in Thai |
engcompany | Name of the insurance company in English |
rating | Rating of this insurance campaign. 0 to 5 |
rec | 1 or 0. 1 = Recommended, 0 = Not recommended |
cargroup | Group of the car based on insurance company |
type | Insurance Class. 1, 2+, 3+ or 3 |
condition | Condition of the premium |
deduct | Deductible amount |
netpremium | Net premium amount (amount before VAT & Stamps) |
totalpremium | Total premium amount (This amount is the full price) |
salepremium | Premium after commission (amount after commission) |
salecom | commission amount (if sold at full price) |
owndamage | Own damage amount |
fire | Fire damage amount |
theft | Theft damage amount |
one | Third-party : Death or Dismemberment / Person |
two | Third-party : Death or Dismemberment / Time |
three | Third-party : Public Liability |
four | Personal Accident |
five | Medical Expenses |
six | Bail Bond |
seven | Number of people covered in a car |
special | Promotion |
Send Lead
var aData = ['authcode','en','Motorbike','John Doe','A1234556','029859123','api@api.com','Johnline','Bangkok','1กจ 2564กท','1414','2016','18686','Bank','15000','300000','Google'];
var jsonData = JSON.stringify({ aData: aData });
$.ajax({
type: "POST",
contentType: "application/json; charset=utf-8",
url: 'https://misterprakan.com/apiws/motor/afmotor.svc/sendlead',
data: jsonData,
dataType: "json",
success: function (data) {
$(data.d).each(function (index, value) {
//example
$("#quotes").append("<tr><td>" + value.leadid + "</td></tr>");
});
},
});
The above command returns JSON structured like this:
[
{
"status": "OK",
"leadid": "1200"
}
]
This endpoint sends the lead details to us.
HTTP Request
POST https://misterprakan.com/apiws/motor/afmotor.svc/sendlead
Query Parameters
Parameter | Mandatory | Values | Description |
---|---|---|---|
authcode | Yes | 'authcode' | Your Authentication code |
lag | No | 'th' or 'en' | Lead's language |
insurancetype | Yes | 'Motorbike' | Please input Motorbike |
name | No | 'John Doe' | Lead's Name |
citizenid | No | 'A1234556' | Lead's Passport/Citizen ID # |
phone | No | '029859123' | Lead's phone # |
No | 'api@api.com' | Lead's email | |
line | No | 'Johnline' | Lead's Line (Chat) id |
address | No | 'Bangkok' | Lead's address |
license | No | '1กจ 2564 กท' | Lead's bike license plate |
carmodelid | Yes | '1414' | Please input 1414 (For bike) |
caryear | Yes | '2016' | Bike's year |
premiumid | No | '18686' | Premium's ID (Get ID from getbikequotes/getbikecoverage API) |
paymenttype | No | 'Bank' or 'CreditCard' or 'Paylite' | Payment method |
salepremium | No | '15000' | Premium that you sells |
owndamage | No | '300000' | Owndamage for the bike (Get from getbikequotes/getbikecoverage API) |
source | No | 'Google' | The source of the lead. (SEO,Google Ad,Facebook, etc.) |
JSON Vars
Var | Description |
---|---|
status | API status |
leadid | Lead's ID |
Motor (Car)-Daily
Get Makes
var aData = {
'hashcode':'MP',
};
$.ajax({
type: "GET",
contentType: "application/json; charset=utf-8",
url: 'https://misterprakan.com/apiws/motor/afmotor.svc/getnmakes',
data: aData,
dataType: "json",
success: function (data) {
$(data.d).each(function (index, value) {
//example
$("#quotes").append("<tr><td>" + value.manu + "</td></tr>");
});
},
});
The above command returns JSON structured like this:
[
{
"status": "OK",
"carmanuid": "19",
"manu": "TOYOTA",
"country": "J"
}
{
"status": "OK",
"carmanuid": "15",
"manu": "HONDA",
"country": "J"
}
]
This endpoint retrieves the makes of the car (for insurance only).
HTTP Request
GET https://misterprakan.com/apiws/motor/afmotor.svc/getnmakes
Query Parameters
Parameter | Mandatory | Values | Description |
---|---|---|---|
authcode | Yes | 'authcode' | Your Authentication code |
JSON Vars
Var | Description |
---|---|
status | API status |
carmanuid | Car manufacture id |
manu | Car manufacture's name |
country | Car manufacture's origin |
Get Models
var aData = {
'hashcode':'MP',
'make':'TOYOTA',
};
$.ajax({
type: "GET",
contentType: "application/json; charset=utf-8",
url: 'https://misterprakan.com/apiws/motor/afmotor.svc/getnmodels',
data: aData,
dataType: "json",
success: function (data) {
$(data.d).each(function (index, value) {
//example
$("#quotes").append("<tr><td>" + value.model + "</td></tr>");
});
},
});
The above command returns JSON structured like this:
[
{
"status": "OK",
"carmodelid": "4",
"carmodel": "YARIS",
"cargroup": "5",
"amount": "599000"
}
{
"status": "OK",
"carmodelid": "3",
"carmodel": "VIOS",
"cargroup": "J",
"amount": "619000"
}
]
This endpoint retrieves the models based on the car make (for insurance only).
HTTP Request
GET https://misterprakan.com/apiws/motor/afmotor.svc/getnmodels
Query Parameters
Parameter | Mandatory | Values | Description |
---|---|---|---|
authcode | Yes | 'authcode' | Your Authentication code |
make | Yes | 'TOYOTA' | Car's Make |
JSON Vars
Var | Description |
---|---|
status | API status |
carmodelid | ID of the model |
carmodel | Car's model |
cargroup | Car's insurance group |
amount | Car's new amount (Red Plate) |
Get Quotes
var aData = {
'hashcode': 'MP',
'year': '2016',
'make': 'TOYOTA',
'model': 'YARIS',
'duration': '2',
};
$.ajax({
type: "GET",
contentType: "application/json; charset=utf-8",
url: 'https://misterprakan.com/apiws/motor/afmotor.svc/cdailyquotes',
data: aData,
dataType: "json",
success: function (data) {
$(data.d).each(function (index, value) {
//example
$("#quotes").append("<tr><td>" + value.salepremium + "</td></tr>");
});
},
});
The above command returns JSON structured like this:
[
{
"status": "OK",
"logo": "vib.jpg",
"company": "วิริยะ",
"engcompany" : "Viriyah",
"rating": 5,
"rec": 1,
"cargroup": 5,
"type": 1,
"condition": "อู่",
"deduct": 3000,
"netpremium": NULL,
"totalpremium": NULL,
"salepremium": 280,
"salecom": NULL,
"owndamage": 500000,
"fire": 500000,
"theft": 500000,
"one": 1000000,
"two": 10000000,
"three": 5000000,
"four": 200000,
"five": 200000,
"six": 200000,
"seven": 7,
"special" : "Free Starbuck Card!"
}
]
This endpoint retrieves the daily insurance quote based on the make,model and the duration.
HTTP Request
GET https://misterprakan.com/apiws/motor/afmotor.svc/cdailyquotes
Query Parameters
Parameter | Mandatory | Values | Description |
---|---|---|---|
authcode | Yes | 'authcode' | Your Authentication code |
year | Yes | '2010' | Car's Year |
make | Yes | 'TOYOTA' | Car's Make (Get from getmakes API) |
model | Yes | 'YARIS' | Car's Model (Get from getmodels API) |
duration | Yes | '2' | Number of days the insurance is active |
JSON Vars
Var | Description |
---|---|
status | API status |
logo | Logo of the insurance company |
company | Name of the insurance company in Thai |
engcompany | Name of the insurance company in English |
rating | Rating of this insurance campaign. 0 to 5 |
rec | 1 or 0. 1 = Recommended, 0 = Not recommended |
cargroup | Group of the car based on insurance company |
type | Insurance Class. 1, 2+, 3+ or 3 |
condition | Condition of the premium |
deduct | Deductible amount |
netpremium | Net premium amount (amount before VAT & Stamps) |
totalpremium | Total premium amount (This amount is the full price) |
salepremium | Premium after commission (amount after commission) |
salecom | commission amount (if sold at full price) |
owndamage | Own damage amount |
fire | Fire damage amount |
theft | Theft damage amount |
one | Third-party : Death or Dismemberment / Person |
two | Third-party : Death or Dismemberment / Time |
three | Third-party : Public Liability |
four | Personal Accident |
five | Medical Expenses |
six | Bail Bond |
seven | Number of people covered in a car |
special | Promotion |
Start Coverage
var aData = {
"hashcode": 'MP',
"year": '2016',
"make": 'TOYOTA',
"model": 'YARIS',
"startdate": '2017-04-29',
"enddate": '2017-04-30',
"license": '8888',
"chasis": '1234567890',
"sinsuredname": 'Jaruwitt Akaratongskul',
"sinsuredpassport": 'A1234',
"sinsuredaddress": '110/13 BANGKOK',
"sinsuredemail": 'jakaratongskul@gmail.com',
};
$.ajax({
type: "GET",
contentType: "application/json; charset=utf-8",
url: 'https://misterprakan.com/apiws/motor/afmotor.svc/cdailystartcover',
data: aData,
dataType: "json",
success: function (data) {
$(data.d).each(function (index, value) {
//example
$("#quotes").append("<tr><td>" + value.id + "</td></tr>");
});
},
});
The above command returns JSON structured like this:
[
{
"status": "OK",
"id": "3000"
}
]
This endpoint starts coverage for the daily motor insurance and send the insurance covernote instantly.
HTTP Request
GET https://misterprakan.com/apiws/motor/afmotor.svc/cdailystartcover
Query Parameters
Parameter | Mandatory | Values | Description |
---|---|---|---|
authcode | Yes | 'authcode' | Your Authentication code |
year | Yes | '2010' | Car's Year |
make | Yes | 'TOYOTA' | Car's Make (Get from getnmakes API) |
model | Yes | 'YARIS' | Car's Model (Get from getnmodels API) |
startdate | Yes | '2017-04-29' | Insurance's start date |
enddate | Yes | '2017-04-30' | Insurance's end date |
license | Yes | '123 กขค กท' | Insured car's plate license number |
chasis | Yes | 'AAAAAAAAAA123' | Insured car's chasis number (13 digits) |
sinsuredname | Yes | 'Kevin Kim' | Insured person (NAME) |
sinsuredpassport | Yes | 'A1234' | Insured person (Passport or ID) |
sinsuredaddress | Yes | '110/13 Bangkok' | Insured person (Address) |
sinsuredemail | Yes | 'test@mp.com' | Insured person (Email) (Policy will be sent to this email) |
JSON Vars
Var | Description |
---|---|
status | API status |
id | Policy ID Number (Use to identify to the insurance company) |
Download Covernote
This endpoint return the policy in PDF (bytes[])
HTTP Request
GET https://misterprakan.com/apiws/motor/afmotor.svc/cdailydownloadcv
Query Parameters
Parameter | Mandatory | Values | Description |
---|---|---|---|
policyid | Yes | '3019' | ID reference of the POLICY |
Response
Var | Description |
---|---|
file | PDF File |
Travel (Ticket insurance - INB)
Get Quotes
curl "https://apiws.misterprakan.com/nonmotor/ta.svc/ibgetquotes?hashcode={hashcode}&destinationcountry={destinationcountry}&duration={duration}" \
var aData = {
"hashcode": 'MP',
"destinationcountry": 'Worldwide',
"duration": '1',
};
$.ajax({
type: "GET",
contentType: "application/json; charset=utf-8",
url: 'https://apiws.misterprakan.com/nonmotor/ta.svc/ibgetquotes',
data: aData,
dataType: "json",
success: function (data) {
$(data.d).each(function (index, value) {
//example
$("#quotes").append("<tr><td>" + value.premium + "</td></tr>");
});
},
});
WebClient webclient = new WebClient();
webclient.QueryString.Add("hashcode","MP");
webclient.QueryString.Add("destinationcountry", "Worldwide");
webclient.QueryString.Add("duration", "1");
dynamic jsonresult = webclient.DownloadString("https://apiws.misterprakan.com/nonmotor/ta.svc/ibgetquotes");
The above command returns JSON structured like this:
[
{
"areaofcoverage": "Thailand",
"claimprocedures": [
{
"procedure": "Prepare all of the medical receipts and records that you have paid for. Send them to our claim contact channel at support@misterprakan.com."
},
{
"procedure": "Your claims will be handled directly by us and will be processed with the claim department of the insurance company that you are currently insured with."
},
{
"procedure": "Please provide us with a copy of your passport and a copy of the medical bills as well as the purchased transportation ticket, travel itinerary documents, bank account details or Paypal email address as these will serve as your identification number within the system."
}
],
"coverages": [
{
"amount": "550,000",
"coverage": "Personal Accident – Loss of Life, Dismemberment, Loss of Sight or Total Permanent Disability"
},
{
"amount": "50,000",
"coverage": "Medical Expenses Each Accident"
}
],
"currency": "THB",
"duration": "1",
"plancode": "A",
"premium": "63.37",
"status": "OK",
"termsconditions": [
{
"terms": "The insured can buy a maximum of 1 insurance policy per person per trip."
},
{
"terms": "The insured must be between the age of 1 - 75 years old."
},
]
}
]
This endpoint gets all of the available plans for your customer's travel plans.
HTTP Request
GET https://apiws.misterprakan.com/nonmotor/ta.svc/ibgetquotes
Query Parameters
Parameter | Mandatory | Values | Description |
---|---|---|---|
hashcode | Yes | 'hashcode' | Your Authentication/hashcode code |
destinationcountry* | Yes | 'Thailand or Worldwide' | Destination country |
duration | Yes | '1' | Duration of the travel dates |
Destination Country Code*
Values | Description |
---|---|
Thailand | Thailand's plans |
Worldwide | Worldwide's plans |
Response
Var | Description |
---|---|
status | API status |
areaofcoverage | Country of coverage |
claimprocedures | List of claim procedures |
coverages | List of coverages available for the plan |
currency | Plan's currency |
duration | Duration of the insurance/plan |
plancode | Plan's code that you need to use to issue the policy |
premium | Premium of the plan. (Plan * duration) |
termsconditions | List of terms and conditions of the plan |
Start Coverage
var aData = {
"hashcode": 'MP',
"livemode": '1',
"ticketid":'test',
"departure":'thailand',
"destination":'laos',
"name":'Kevin Kim',
"passport":'123456',
"email":'kevin@mp.com',
"startdate":'2017-01-01 12:50:21',
"enddate":'2017-01-01 12:50:21',
"product": 'A',
};
$.ajax({
type: "GET",
contentType: "application/json; charset=utf-8",
url: 'https://misterprakan.com/apiws/nonmotor/afnonmotor.svc/ibtastartcover',
data: aData,
dataType: "json",
success: function (data) {
$(data.d).each(function (index, value) {
//example
console.log(data);
});
},
});
WebClient webclient = new WebClient();
webclient.QueryString.Add("hashcode","0963532564");
webclient.QueryString.Add("livemode", "1");
webclient.QueryString.Add("ticketid", "IDOFTICKET");
webclient.QueryString.Add("departure", "Thailand");
webclient.QueryString.Add("destination", "Laos");
webclient.QueryString.Add("name", "Kevin Kim");
webclient.QueryString.Add("passport", "IFUSJSD");
webclient.QueryString.Add("email", "kevin@mp.com");
webclient.QueryString.Add("startdate", startDate);
webclient.QueryString.Add("enddate", endDate);
webclient.QueryString.Add("product", "A");
dynamic jsonresult = webclient.DownloadString("https://misterprakan.com/apiws/nonmotor/afnonmotor.svc/ibtastartcover");
The above command returns JSON structured like this:
[
{
"status": "OK",
"livemode": "1",
"policyid": "1857",
"ticketid": "JIKHG64"
}
]
This endpoint starts coverage for travel insurance (INB) and send the insurance covernote instantly.
HTTP Request
GET https://misterprakan.com/apiws/nonmotor/afnonmotor.svc/ibtastartcover
Query Parameters
Parameter | Mandatory | Values | Description |
---|---|---|---|
hashcode | Yes | 'hashcode' | Your Authentication code |
livemode | Yes | '1 or 0' | Use 1 for LIVE and 0 for TESTING |
ticketid | Yes | 'J12472' | Your ticket's identification number |
departure | Yes | 'Mien Tay Bus Station' | Departure route |
destination | Yes | 'Mochit Bus Station' | Destination route |
name | Yes | 'Kevin Kim' | The insured's name |
passport | Yes | '28572UDJ' | The insured's passport |
No | 'kevin@test.com' | The insured's email (Policy will be sent to this email) | |
startdate | Yes | '2017-05-30 11:48:24' | Insurance's startdate in this format : yyyy-MM-dd HH:mm:ss |
enddate | Yes | '2017-05-31 11:48:24' | Insurance's enddate in this format : yyyy-MM-dd HH:mm:ss |
product* | Yes* | 'A' | product's code* |
Product's Code*
Values | Description |
---|---|
'A' | Thailand- PA:500,000 ME:500,000 |
'B' | Thailand- PA:300,000 ME:300,000 |
'C' | Thailand- PA:100,000 ME:100,000 |
'INA' | ASEAN- PA:500,000 ME:500,000 |
'INB' | ASEAN- PA:300,000 ME:300,000 |
'INC' | ASEAN- PA:100,000 ME:100,000 |
JSON Vars
Var | Description |
---|---|
status | API status |
livemode | 1 for LIVE and 0 for TESTING |
policyid | Policy ID Number (Use to identify to the insurance company) |
ticketid | Your ticketID |
Travel (Offshore-ACS)
Get Countries
var aData = {
"hashcode": 'MP',
};
$.ajax({
type: "GET",
contentType: "application/json; charset=utf-8",
url: 'https://api.misterprakan.com/nonmotor/ta/ta.svc/getcountries',
data: aData,
dataType: "json",
success: function (data) {
$(data.d).each(function (index, value) {
//example
console.log(data);
});
},
});
WebClient webclient = new WebClient();
webclient.QueryString.Add("hashcode","MP");
dynamic jsonresult = webclient.DownloadString("https://api.misterprakan.com/nonmotor/ta/ta.svc/getcountries");
The above command returns JSON structured like this:
[
{
"status": "OK",
"country": "Singapore",
}
]
This endpoint gets all countries (based on terms and conditions of the insurance company) for travel insurance.
HTTP Request
GET https://api.misterprakan.com/nonmotor/ta/ta.svc/getcountries
Query Parameters
Parameter | Mandatory | Values | Description |
---|---|---|---|
hashcode | Yes | 'hashcode' | Your Authentication code |
JSON Vars
Var | Description |
---|---|
status | API status |
country | Country's name in English |
Get Quotes
var aData = {
"hashcode": 'MP',
"countryofresidence": 'Singapore',
"destination": 'Thailand',
"nationality": 'Singapore',
"dob": '19/04/1994',
"startdate": '25/06/2018',
"enddate": '28/06/2018',
};
$.ajax({
type: "GET",
contentType: "application/json; charset=utf-8",
url: 'https://api.misterprakan.com/nonmotor/ta/ta.svc/getosquotes',
data: aData,
dataType: "json",
success: function (data) {
$(data.d).each(function (index, value) {
//example
console.log(data);
});
},
});
WebClient webclient = new WebClient();
webclient.QueryString.Add("hashcode","MP");
webclient.QueryString.Add("countryofresidence","Singapore");
webclient.QueryString.Add("destination","Thailand");
webclient.QueryString.Add("nationality","Singapore");
webclient.QueryString.Add("dob","19/04/1994");
webclient.QueryString.Add("startdate","25/06/2018");
webclient.QueryString.Add("enddate","28/06/2018");
dynamic jsonresult = webclient.DownloadString("https://api.misterprakan.com/nonmotor/ta/ta.svc/getosquotes");
The above command returns JSON structured like this:
[
{
"status": "OK",
"premium": "507",
"message": null,
}
]
This endpoint gets premium based on a certain number of parameters for travel insurance.
HTTP Request
GET https://api.misterprakan.com/nonmotor/ta/ta.svc/getosquotes
Query Parameters
Parameter | Mandatory | Values | Description |
---|---|---|---|
hashcode | Yes | 'hashcode' | Your Authentication code |
countryofresidence | Yes | 'Singapore' | Country of residency |
destination | Yes | 'Thailand' | Country of destination |
nationality | Yes | 'Singapore' | The insured's country of nationality |
dob | Yes | '19/04/1994' | The insured's date of birth in 'dd/MM/yyyy' format |
startdate | Yes | '26/06/2018' | Policy's start effective date in 'dd/MM/yyyy' format |
enddate | Yes | '28/06/2018' | Policy's end effective date in 'dd/MM/yyyy' format |
JSON Vars
Var | Description |
---|---|
status | API status |
premium | Insurance's premium in THAI baht |
message | remark messages |
Start Coverage
var aData = {
"hashcode": 'MP',
"livemode": '1',
"countryofresidence": 'Singapore',
"destination": 'Thailand',
"nationality": 'Singapore',
"dob": '19/04/1994',
"startdate": '25/06/2018',
"enddate": '28/06/2018',
"name":'Kevin Kim',
"passport":'123456',
"address":'0 Bayfront Avenue, Singapore 018956',
};
$.ajax({
type: "GET",
contentType: "application/json; charset=utf-8",
url: 'https://api.misterprakan.com/nonmotor/ta/ta.svc/osstartcover',
data: aData,
dataType: "json",
success: function (data) {
$(data.d).each(function (index, value) {
//example
console.log(data);
});
},
});
WebClient webclient = new WebClient();
webclient.QueryString.Add("hashcode","0963532564");
webclient.QueryString.Add("livemode", "1");
webclient.QueryString.Add("countryofresidence", "Singapore");
webclient.QueryString.Add("destination", "Thailand");
webclient.QueryString.Add("nationality", "Singapore");
webclient.QueryString.Add("dob", "19/04/1994");
webclient.QueryString.Add("startdate", "25/06/2018");
webclient.QueryString.Add("enddate", "28/06/2018");
webclient.QueryString.Add("name", "Kevin Kim");
webclient.QueryString.Add("passport", "123456");
webclient.QueryString.Add("address", "0 Bayfront Avenue, Singapore 018956");
dynamic jsonresult = webclient.DownloadString("https://api.misterprakan.com/nonmotor/ta/ta.svc/osstartcover");
The above command returns JSON structured like this:
[
{
"status": "OK",
"livemode": "1",
"policyid": "1857",
"message": null,
}
]
This endpoint starts coverage for travel insurance (Offshore-ACS) instantly.
HTTP Request
GET https://api.misterprakan.com/nonmotor/ta/ta.svc/osstartcover
Query Parameters
Parameter | Mandatory | Values | Description |
---|---|---|---|
hashcode | Yes | 'hashcode' | Your Authentication code |
livemode | Yes | '1 or 0' | Use 1 for LIVE and 0 for TESTING |
countryofresidence | Yes | 'Singapore' | Country of residency |
destination | Yes | 'Thailand' | Country of destination |
nationality | Yes | 'Singapore' | The insured's country of nationality |
dob | Yes | '19/04/1994' | The insured's date of birth in 'dd/MM/yyyy' format |
startdate | Yes | '26/06/2018' | Policy's start effective date in 'dd/MM/yyyy' format |
enddate | Yes | '28/06/2018' | Policy's end effective date in 'dd/MM/yyyy' format |
name | Yes | 'Kevin Kim' | The insured's name |
passport | Yes | '28572UDJ' | The insured's passport |
address | Yes | '0 Bayfront Avenue, Singapore 018956' | The insured's residency address |
JSON Vars
Var | Description |
---|---|
status | API status |
livemode | 1 for LIVE and 0 for TESTING |
policyid | Policy ID Number (Use to identify to the insurance company) |
message | remark messages |
Errors
The MP API uses the following error codes:
Error Code | Meaning |
---|---|
400 | Bad Request -- Your request is not so good :( |
401 | Unauthorized -- Your API key is wrong |
403 | Forbidden -- The MP requested is hidden for administrators only |
404 | Not Found -- The specified MP could not be found |
405 | Method Not Allowed -- You tried to access a MP with an invalid method |
406 | Not Acceptable -- You requested a format that isn't json |
410 | Gone -- The MP requested has been removed from our servers |
429 | Too Many Requests -- You're requesting too many MPs! Slow down! |
500 | Internal Server Error -- We had a problem with our server. Try again later. |
503 | Service Unavailable -- We're temporarily offline for maintenance. Please try again later. |