Authentication: All endpoints require Authorization: Bearer <access_token>.External Dependency: Narayana Health Insurance API (purchase, claims, status).

Overview


List Plans

curl "http://localhost:8080/insurance/plans" \
  -H 'Authorization: Bearer eyJhbGci...'
Query filters (all optional):
ParameterTypeValues
plan_typestringINDIVIDUAL | FAMILY | GROUP
coverage_typestringBASIC | COMPREHENSIVE | PREMIUM
min_sum_insurednumbere.g. 200000
max_premiumnumbere.g. 10000

Calculate Premium

curl -X POST http://localhost:8080/insurance/calculate-premium \
  -H 'Authorization: Bearer eyJhbGci...' \
  -H 'Content-Type: application/json' \
  -d '{
    "plan_id": "b2c3d4e5-f6a7-8901-bcde-f12345678901",
    "policyholder": {
      "dob": "1985-03-20",
      "gender": "MALE"
    },
    "dependants": [
      { "relationship": "SPOUSE", "dob": "1988-07-12", "gender": "FEMALE" },
      { "relationship": "CHILD", "dob": "2015-01-05", "gender": "MALE" }
    ]
  }'
Premium formula:
ComponentFormula
Baseplan.base_premium
Age loading (age > 35)5% × ⌊(age − 35) / 5⌋ × base_premium
Per spouse+30% of base_premium
Per child+20% of base_premium
GST+18% of subtotal

Purchase Insurance

Called after a successful payment (order status = SUCCESS).
curl -X POST http://localhost:8080/insurance/purchase \
  -H 'Authorization: Bearer eyJhbGci...' \
  -H 'Content-Type: application/json' \
  -d '{
    "plan_id": "b2c3d4e5-f6a7-8901-bcde-f12345678901",
    "payment_order_id": "aarokya-1767808100",
    "dependants": [
      { "name": "Sunita Kumar", "relationship": "SPOUSE", "dob": "1988-07-12", "gender": "FEMALE" },
      { "name": "Aryan Kumar", "relationship": "CHILD", "dob": "2015-01-05", "gender": "MALE" }
    ]
  }'

Get Policy Details

curl "http://localhost:8080/insurance/policies/{policyId}" \
  -H 'Authorization: Bearer eyJhbGci...'

Submit Claim

curl -X POST "http://localhost:8080/insurance/policies/{policyId}/claim" \
  -H 'Authorization: Bearer eyJhbGci...' \
  -H 'Content-Type: application/json' \
  -d '{
    "reason": "Hospitalization for appendicitis surgery",
    "hospital_name": "Narayana Health City, Bengaluru",
    "admission_date": "2025-06-10",
    "amount_claimed": 45000.00
  }'
Claims are forwarded to Narayana Health’s API — adjudication happens on their side. Aarokya does not own the claims workflow beyond submission.

Endpoint Summary

MethodPathDescription
GET/insurance/plansList available plans (with optional filters)
GET/insurance/plans/{id}Full plan detail with features + exclusions
POST/insurance/calculate-premiumPremium breakdown for a plan + dependants
POST/insurance/purchasePurchase plan, create policy via NH API
GET/insurance/policiesList user’s active policies
GET/insurance/policies/{id}Policy detail with dependants
POST/insurance/policies/{id}/claimSubmit claim to Narayana Health