Skip to content

Repository files navigation

Claims Ingestion & Validation API

.NET ASP.NET Core

A RESTful API that ingests historical insurance claims data from legacy systems, validates it against modern compliance rules, and returns a structured financial summary.

(Legacy Claims Ingestion & Validation API).


Live deployment

  • API base URL: https://claims-api-hixi.onrender.com
  • Interactive API docs (Swagger UI): https://claims-api-hixi.onrender.com/swagger

Note: hosted on Render's free tier — the service may take 30–60 seconds to spin up if it's been idle.

The problem

Discontinued insurance books ("run-off" portfolios) are often acquired along with claims data from outdated, inconsistent legacy systems. Before that data can be trusted for financial reporting, it needs to be checked for basic sanity — no negative payments, no claims dated before the policy could possibly have existed — and then aggregated into a portfolio- level view.

This API is that validation and aggregation layer.

Endpoint

POST /api/claims/ingest

Accepts an array of claim objects, validates each one, and returns an aggregated summary of valid claims alongside a list of flagged claims.

Request body

[
  {
    "claimId": "CLM-001",
    "policyNumber": "POL-100",
    "underwritingYear": 2018,
    "claimDate": "2019-06-15",
    "amountPaid": 50000,
    "outstandingReserve": 20000,
    "lineOfBusiness": "Motor"
  }
]

Response body

{
  "summary": {
    "totalClaimsIngested": 1,
    "totalFinancialExposure": 70000,
    "exposureByLineOfBusiness": [
      { "lineOfBusiness": "Motor", "totalExposure": 70000, "claimCount": 1 }
    ]
  },
  "flaggedClaims": []
}

Validation rules

Rule Behaviour
amountPaid is negative Claim is flagged, excluded from aggregation
outstandingReserve is negative Claim is flagged, excluded from aggregation
claimDate falls before underwritingYear, or more than 5 years after it Claim is flagged, excluded from aggregation

Flagged claims are not silently discarded — they're returned in flaggedClaims, each with the specific reason(s) it failed, so a human reviewer can investigate and resubmit corrected data. Only valid claims contribute to the financial summary, so bad data can't distort reported exposure figures.

Assumption: the brief doesn't specify an exact date boundary for "reasonable" relative to underwriting year. Claims often take years to settle, so I allowed up to 5 years after underwriting year as valid, while disallowing any date before it (a claim can't predate the policy it belongs to).

Tech stack

  • C# / .NET 10
  • ASP.NET Core Minimal APIs
  • LINQ for aggregation and grouping

Getting started

git clone https://github.com/phiwakonkem/Claims-API.git
cd Claims-API
dotnet run

The API runs at http://localhost:5256 (port may vary — check your terminal output).

Testing the endpoint

A ready-to-use request collection is included in requests.http (requires the REST Client VS Code extension), or test via PowerShell:

$claims = Get-Content requests.http -Raw
Invoke-RestMethod -Uri "http://localhost:5256/api/claims/ingest" -Method Post -Body $claims -ContentType "application/json"

Project structure

About

This is an API that takes messy old claims data,checks it for errors,and spits out a summary. This project was made using C#/ASP.NET Core Minimal APIs.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages