Threshold Evaluation Service
API Contract
REST
/api/v1/threshold-evaluation
9 endpoints
GET
/api/v1/threshold-evaluation/api/v1/threshold-evaluation/thresholds
List threshold configurations per organisation
Public
Response Example
{
"data": [
{
"threshold_id": "thr_org001",
"organisation_id": "org_001",
"amount_limit": 1000,
"distance_limit_km": 200,
"currency": "NOK",
"updated_at": "2026-01-15T10:00:00Z"
}
],
"pagination": {
"page": 1,
"limit": 20,
"total": 1
}
}
GET
/api/v1/threshold-evaluation/api/v1/threshold-evaluation/thresholds/:threshold_id
Get a specific threshold configuration
Public
Response Example
{
"threshold_id": "thr_org001",
"organisation_id": "org_001",
"amount_limit": 1000,
"distance_limit_km": 200,
"currency": "NOK",
"updated_at": "2026-01-15T10:00:00Z"
}
POST
/api/v1/threshold-evaluation/api/v1/threshold-evaluation/thresholds
Create threshold configuration for an organisation
Public
Request Example
{
"organisation_id": "org_002",
"amount_limit": 2000,
"distance_limit_km": 300,
"currency": "NOK"
}
Response Example
{
"threshold_id": "thr_org002",
"organisation_id": "org_002",
"amount_limit": 2000,
"distance_limit_km": 300,
"currency": "NOK",
"created_at": "2026-03-26T08:00:00Z",
"updated_at": "2026-03-26T08:00:00Z"
}
PUT
/api/v1/threshold-evaluation/api/v1/threshold-evaluation/thresholds/:threshold_id
Update threshold configuration
Public
Request Example
{
"amount_limit": 1500,
"distance_limit_km": 250
}
Response Example
{
"threshold_id": "thr_org001",
"organisation_id": "org_001",
"amount_limit": 1500,
"distance_limit_km": 250,
"updated_at": "2026-03-26T09:00:00Z"
}
DELETE
/api/v1/threshold-evaluation/api/v1/threshold-evaluation/thresholds/:threshold_id
Delete a threshold configuration
Public
Response Example
{
"deleted": true,
"threshold_id": "thr_org001"
}
POST
/api/v1/threshold-evaluation/api/v1/threshold-evaluation/evaluate
Evaluate a claim against organisation thresholds (evaluateClaim)
Public
Request Example
{
"claim_id": "clm_9f2a3b4c",
"organisation_id": "org_001",
"expense_lines": [
{
"description": "Train Oslo-Bergen",
"amount": 1200,
"category": "transport",
"distance_km": 0
},
{
"description": "Hotel 2 nights",
"amount": 3650,
"category": "accommodation",
"distance_km": 0
}
]
}
Response Example
{
"claim_id": "clm_9f2a3b4c",
"combined_total": 4850,
"combined_distance_km": 0,
"threshold_amount_limit": 1000,
"threshold_distance_limit_km": 200,
"exceeds_amount_threshold": true,
"exceeds_distance_threshold": false,
"auto_approvable": false,
"evaluated_at": "2026-03-26T08:05:00Z"
}
POST
/api/v1/threshold-evaluation/api/v1/threshold-evaluation/compute-total
Compute combined monetary total of expense lines (computeCombinedTotal)
Public
Request Example
{
"expense_lines": [
{
"description": "Taxi to airport",
"amount": 320,
"category": "transport",
"distance_km": 0
},
{
"description": "Client lunch",
"amount": 180,
"category": "meals",
"distance_km": 0
}
]
}
Response Example
{
"combined_total": 500,
"currency": "NOK",
"line_count": 2
}
POST
/api/v1/threshold-evaluation/api/v1/threshold-evaluation/compute-distance
Compute combined distance of mileage expense lines (computeCombinedDistance)
Public
Request Example
{
"expense_lines": [
{
"description": "Car Oslo–Drammen",
"amount": 0,
"category": "mileage",
"distance_km": 54.2
},
{
"description": "Car Drammen–Kongsberg",
"amount": 0,
"category": "mileage",
"distance_km": 36.8
}
]
}
Response Example
{
"combined_distance_km": 91,
"line_count": 2
}
POST
/api/v1/threshold-evaluation/api/v1/threshold-evaluation/is-auto-approvable
Check if a claim qualifies for auto-approval (isAutoApprovable)
Public
Request Example
{
"claim_id": "clm_7e8f9a0b",
"organisation_id": "org_001"
}
Response Example
{
"claim_id": "clm_7e8f9a0b",
"auto_approvable": true,
"combined_total": 480,
"combined_distance_km": 0,
"reason": "Combined total 480.00 NOK is below threshold 1000.00 NOK and distance 0 km is below 200 km"
}