Insurance Policies

Returns normalized insurance policy records by national code.

GET /insurance-policies

Inputs

namerequiredintypealiasesdefaultdescription
insuranceyesquerystringinsInsurance slug (ma, razi, asia, ...).
national_codeyesquerystringnationalCodeNational code or provider identity value.
typenoqueryint1Provider lookup type.

Response Format

pathtypedescription
okboolTrue on success.
errorstring|nullError message when ok=false.
providerstringSelected provider key.
insurancestringInsurance slug.
meta.provider_statusint|nullProvider HTTP status.
meta.countintReturned item count.
meta.is_under_covbool|nullCoverage status when returned by provider.
data[]objectNormalized policy records.
data[].policy_idint|nullPolicy identifier.
data[].policy_numberint|nullPolicy number.
data[].policy_full_numberstring|nullPolicy full number.
data[].business_group.slugstring|nullBusiness group slug.
data[].insured_person.national_codestring|nullInsured national code.
data[].insured_person.relation.slugstring|nullRelation slug.
data[].insured_person.seminary_student.slugstring|nullSeminary student slug.
data[].coverage.policy_beginint|nullPolicy begin date as unix timestamp.
data[].coverage.coverage_beginint|nullCoverage begin date as unix timestamp.
data[].coverage.coverage_endint|nullCoverage end date as unix timestamp.
data[].coverage.valid_untilint|nullValidity date as unix timestamp.
data[].coverage.entry_reason.slugstring|nullEntry reason slug.

Examples

Success

Request

GET /insurance-policies?insurance=ma&national_code=1234567890&type=1

Response

{
    "ok": true,
    "provider": "mad",
    "insurance": "ma",
    "meta": {
        "provider_status": 200,
        "count": 1,
        "is_under_cov": true
    },
    "data": [
        {
            "policy_id": 10001,
            "policy_number": 1,
            "policy_full_number": "12345678\/00\/000001",
            "policy_version": 1,
            "contract_id": 2001,
            "business_group": {
                "slug": null,
                "label": null
            },
            "customer": {
                "id": 1001,
                "name": "Example Customer"
            },
            "insured_person": {
                "id": 123456,
                "policy_link_id": 555001,
                "national_code": "1234567890",
                "relation": {
                    "slug": "child",
                    "label": "Child"
                },
                "seminary_student": {
                    "slug": "dependent",
                    "label": "Dependent"
                },
                "employee_code": "E-12345",
                "is_iranian": true,
                "passport_no": null,
                "naturalized_code": null,
                "has_special_illness": false,
                "special_illness_label": "No"
            },
            "coverage": {
                "policy_begin": 1700000000,
                "coverage_begin": 1700000000,
                "coverage_end": 1731536000,
                "valid_until": 1731536000,
                "entry_reason": {
                    "slug": null,
                    "label": null
                }
            },
            "first_insurer": {
                "id": null,
                "number": null
            },
            "insurance_caption": null
        }
    ]
}