Health Insurance Buying Journey API Documentation

This documentation outlines the API endpoints used in the health insurance buying journey, enabling customers to obtain quotes, review plans, and purchase health insurance.

Authentication

Endpoint

POST {{domain}}/login/verifyPassword

This endpoint verifies a user’s password and returns authentication tokens along with access permissions.

Headers

Content-Type: application/json

The request body must contain the following JSON structure:

{
“userId”: “string”,
“password”: “string”
}

  • userId: The identifier of the user whose password is being verified.
  • password: The password to verify.

Upon successful verification, the response will include the verification status, access and refresh tokens, and a list of access permissions.

Success Response

{
“isVerified”: true,
“accessToken”: “your_access_token_here”,
“refreshToken”: “your_refresh_token_here”,
“accessList”: [
{
“internalName”: “ENDORSEMENT_VISIBLE”,
“module”: “TICKETS”
},

{
“internalName”: “LOGGER_DASHBOARD_VISIBLE”,
“module”: “ANALYTICAL_DASHBOARD”
}
]
}

  • isVerified: Indicates whether the password verification was successful.
  • accessToken: JWT access token for authenticated sessions.
  • refreshToken: JWT refresh token for generating new access tokens.
  • accessList: Array of objects detailing the access permissions granted to the user. Each object contains: internalName: The internal name identifying the permission. module: The system module to which the permission applies.

Success Response

{
“statusCode”: 500,
“message”: “Please enter valid credentials”
}

curl –location –globoff ‘{{domain}}/login/verifyPassword’ \
–header ‘Content-Type: application/json’ \
–data ‘{
“userId”: “user-id”,
“password”: “password”
}’

Get Quote Fields

This endpoint retrieves the necessary fields required to generate a quote for health insurance products, tailored to user inputs such as product type and lead ID.

Endpoint

GET {{domain}}/preQuote/quoteFields

  • Query Parameters:
    • product: Type of insurance product (e.g., SAVINGS)
    • leadId: Unique identifier for the lead

{
“pages”: [
{
“title”: “Page Title”,
“fields”: [
{
“title”: “Field Title”,
“value”: “Pre-filled value or empty”,
“enabled”: true/false,
“fieldId”: “unique_field_identifier”,
“visible”: true/false,
“viewType”: “text/date/autoCompleteText/editText/checkboxGroup”,
“alignment”: {
“col”: 6,
“row”: “new/existing”,
“direction”: “row”,
“horizontal”: “start/center/end”
},
“validation”: {
“error”: “Error message for validation failure”,
“validationType”: “text/date/radio_selection”,
“lengthValidation”: {
“max”: “maximum length”,
“min”: “minimum length”
},
“contentValidation”: “Regex for content validation”
},
“placeholder”: “Placeholder text”,
“parentProperty”: “parent_property_identifier”
},

],
“pageId”: “1”,
“alignment”: {
“width”: “Percentage of total width”,
“vertical”: “Alignment direction”
}
}
]
}

  • pages: Array of page objects, each representing a section of the quote form.
  • title: Title of the page or field.
  • fields: Array of field objects that need to be filled out or presented to the user.
  • fieldId: Unique identifier for each field.
  • viewType: Type of input or view for the field (e.g., text input, date picker).
  • validation: Contains validation rules and error messages for each field.
  • alignment: Describes how the field is aligned and displayed on the page.
  • parentProperty: Groups fields under a common parent property, aiding in structured data submission.

curl –location ‘https://api-predev.ensuredit.com/preQuote/quoteFields?product=SAVINGS&leadId=78791’ \
–header ‘Authorization: Bearer <your_access_token> ‘

Create Quote

This endpoint is used to submit quote request data for health insurance products and retrieve available plans based on the provided information.

Endpoint

POST {{domain}}/getQuote/HEALTH

Headers

Content-Type: application/json
Authorization: Bearer <your_access_token>

The response includes the quote ID, product type, and an array of plan options that match the request criteria.

{
“id”: 31643,
“product”: “HEALTH”,
“filterData”: null,
“fieldData”: […],
“createdAt”: “2023-01-27T12:52:44.491Z”,
“quotePlans”: [
{
“companyId”: 31,
“planId”: 111,
“payingAmount”: 8066,
“planData”: {

“paymentModes”: [
{
“internalName”: “FORM”,
“displayName”: “Payment Gateway”
}
],
“brochure”: “URL_to_brochure.pdf”
},
“amountDetail”: […]
},

],
“companyErrorMessage”: null,
“status”: “SUCCESS”
}

  • id: Unique identifier for the quote request.
  • product: Type of insurance product for which the quote was requested.
  • fieldData: Array of field objects containing user inputs.
  • createdAt: Timestamp when the quote was created.
  • quotePlans: Array of available insurance plans based on the quote request.

Markup:

Each plan includes details such as companyId, planId, payingAmount, planData (with plan specifics, coverages, payment modes, and brochure URL), and amountDetail (detailed breakdown of costs).

  • status: Indicates the success or failure of the quote request.

curl –location ‘https://api-predev.ensuredit.com/getQuote/HEALTH’ \
–header ‘Content-Type: application/json’ \
–header ‘Authorization: Bearer ‘ \
–data ‘{
“fieldData”: [
{
“id”: “gender”,
“value”: “male”,
“parentProperty”: “proposerDetails”
},

{
“id”: “pincode”,
“value”: “400001”,
“parentProperty”: “communicationAddress”
}
],
“salesChannelUserId”: “2”
}’

Get Proposal Fields

This endpoint provides the fields required for completing a proposal for health insurance, based on the selected quote and plan.

Endpoint

GET {{domain}}/preProposal/proposalFields

  • Query Parameters:
    • companyId: The ID of the insurance company.
    • product: Type of insurance product (e.g., HEALTH).
    • step: The step or page number in the proposal process.
    • sumInsured: The amount of insurance coverage requested.
    • quoteId: The ID of the generated quote.
    • quotePlanId: The ID of the selected quote plan.

The response includes sections of fields that need to be filled as part of the proposal form.

{
“pages”: [
{
“icon”: “next”,
“title”: “Proposer”,
“fields”: [
{
“value”: “Proposer Details”,
“enabled”: true,
“fieldId”: “proposerDetailSection”,
“visible”: true,
“viewType”: “sectionTitle”,

}
],

“navigation”: {
“next”: {
“text”: “Next”,

},
“previous”: null
}
},

],
“header”: {
“policyType”: “Digit Double Wallet”,
“companyLogo”: “https://…”,
“companyName”: “Digit”,
“premiumAnnually”: “11413”,
“companyId”: 8
},
“proposalId”: 27022
}

  • pages: An array containing the details of each page or section of the proposal form.
  • icon: Icon indicating the action (e.g., “next”).
  • title: The title of the page or section.
  • fields: Array of fields within the page.
    • value, enabled, fieldId, visible, viewType: Attributes describing each field.
    • alignment: Layout information for displaying the field.
  • navigation: Navigation options to move between pages or sections.
  • header: Contains general information about the policy, including the insurance company’s logo, name, and the premium amount.
  • proposalId: A unique identifier for the proposal being filled.

curl –location ‘https://api-predev.ensuredit.com/preProposal/proposalFields?companyId=8&product=HEALTH&step=0&sumInsured=10&quoteId=94232&quotePlanId=594303’ \ –header ‘Authorization: Bearer <your_access_token>

Create Proposal

This endpoint is used to submit a proposal for a health insurance product based on the user’s details and their chosen plan.

Endpoint

GET {{domain}}/preProposal/proposalFields

Headers

Content-Type: application/json
Authorization: Bearer <your_access_token>

Below is a sample request body containing proposer and insured member information. This example includes fields for the proposer’s title, full name, gender, marital status, date of birth, email, phone, PAN number, Aadhaar number, and similar information for an insured member. Additionally, it includes fields for medical history, lifestyle details, and nominee information.

{
“fields”: [
{
“id”: “proposerTitle”,
“parentProperty”: “proposerDetails”,
“value”: “Mrs.”
},
{
“id”: “proposerFullName”,
“parentProperty”: “proposerDetails”,
“value”: “Sushmitha Jain”
},
{
“id”: “proposerGender”,
“parentProperty”: “proposerDetails”,
“value”: “Female”
},
{
“id”: “proposerMaritalStatus”,
“parentProperty”: “proposerDetails”,
“value”: “Married”
},
{
“id”: “proposerDOB”,
“parentProperty”: “proposerDetails”,
“value”: “30/05/1994”
},
{
“id”: “proposerEmail”,
“parentProperty”: “proposerDetails”,
“value”: “sushmitha@ensuredit.com”
},
{
“id”: “proposerPhone”,
“parentProperty”: “proposerDetails”,
“value”: “9164298612”
},
{
“id”: “panNumber”,
“parentProperty”: “proposerDetails”,
“value”: “HKOPL9087L”
},
{
“id”: “aadhaarNumber”,
“parentProperty”: “proposerDetails”,
“value”: “”
},
{
“id”: “sameAsProposerDetail”,
“parentProperty”: “proposerDetails”,
“value”: “Yes”
},

],
“quotePlanId”: “245916”,
“leadId”: “29297”,
“salesChannelUserId”: “305”
}

The response includes details about the proposal submission status, payment options, and field data.

{
“id”: 27164,
“product”: “HEALTH”,
“status”: “FAILED”,
“paymentData”: {
“modes”: [
{
“details”: null,
“selected”: “No”,
“displayName”: “Payment Gateway”,
“internalName”: “FORM”
}
]
},
“fieldData”: {

},
“insurerSpecificData”: {
“amount”: null,
“ckycStatus”: “FAIL”
},
“quotePlan”: {

},
“createdAt”: “2024-02-17T05:34:59.178Z”,
“invoiceDetails”: {},
“ckycDetails”: {

},
“note”: {
“text”: null
}
}

  • id: A unique identifier for the proposal.
  • product: The insurance product type.
  • status: Indicates whether the proposal was successfully created.
  • paymentData: Information about available payment modes.
  • fieldData: Contains the data submitted in the proposal fields.
  • insurerSpecificData: Additional data specific to the insurer.
  • quotePlan: Details about the selected insurance plan.
  • createdAt: Timestamp indicating when the proposal was created.
  • invoiceDetails: Details related to the proposal invoice.
  • ckycDetails: Information regarding CKYC verification.

curl –location ‘https://api-predev.ensuredit.com/proposal/HEALTH/create’ \
–header ‘Content-Type: application/json’ \
–header ‘Authorization: Bearer <your_access_token>‘ \
–data-raw ‘{
“fields”: [
{
“id”: “proposerTitle”,
“parentProperty”: “proposerDetails”,
“value”: “Mrs.”
},

{
“id”: “nomineeRelation”,
“parentProperty”: “nomineeDetails”,
“value”: “Sister”
}
],
“quotePlanId”: “245916”,
“leadId”: “29297”,
“salesChannelUserId”: “305”
}’

Get Payment Form

This endpoint is designed to initiate the payment process for a health insurance proposal. Upon submission, it returns an HTML form that automatically redirects the user to the payment gateway.

Endpoint

GET {{domain}}/proposal/HEALTH/paymentForm/{leadId}

{
“fields”: [
{
“id”: “proposerTitle”,
“value”: “Mrs.”,
“parentProperty”: “proposerDetails”
},

{
“id”: “nomineeRelation”,
“value”: “Sister”,
“parentProperty”: “nomineeDetails”
}
],
“quotePlanId”: “245916”,
“leadId”: “29297”,
“salesChannelUserId”: “305”

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>Payment Redirection</title>
    <script type="text/javascript">
        function submitHealthForm() {
            document.PAYMENTFORM.submit();
        }
    </script>
</head>
<body onload="submitHealthForm();">
    <form action="https://paymentgateway.com/pay" method="post" name="PAYMENTFORM">
        <input type="hidden" name="proposalNum" value="1120006326783"/>
        <input type="hidden" name="returnURL" value="https://api-predev.ensuredit.com/proposal/paymentCallback/HEALTH/CARE?transactionNo=1708458483"/>
    </form>
</body>
</html>

curl –location ‘https://api-predev.ensuredit.com/proposal/HEALTH/create
–header ‘Content-Type: application/json’
–data-raw ‘{…}’