Quote engine is running.
| Method | Path | Description |
|---|---|---|
| GET | / | This page |
| GET | /health | Returns { "status": "ok" } |
| POST | /quote | Requests a motor insurance quote |
The request body must be a JSON object with the following fields. All fields are required; any other fields are ignored.
| Field | Type | Description |
|---|---|---|
dateOfBirth | string | Driver's date of birth, in YYYY-MM-DD format |
engineSize | number | Engine size in litres; must be greater than zero |
fuelType | string | One of petrol, diesel or electric |
penaltyPoints | number | Penalty points on the driver's licence; zero or more |
POST /quote
Content-Type: application/json
{
"dateOfBirth": "1990-12-10",
"engineSize": 1.6,
"fuelType": "petrol",
"penaltyPoints": 0
}
200 OK
| Field | Type | Description |
|---|---|---|
result | string | Always ACCEPTED |
quoteId | string | 12-character quote reference |
premium | number | Annual premium, rounded to two decimal places |
currency | string | ISO 4217 currency code; always GBP |
validUntil | string | ISO 8601 UTC timestamp after which the quote expires |
{
"result": "ACCEPTED",
"quoteId": "3F2A9C1B-7D4",
"premium": 252.98,
"currency": "GBP",
"validUntil": "2026-10-11T09:30:00.000Z"
}
200 OK. The request was valid, but Aardvark will not insure this driver or vehicle.
| Field | Type | Description |
|---|---|---|
result | string | Always DECLINED |
reasons | string[] | One or more human-readable reasons the quote was declined |
{
"result": "DECLINED",
"reasons": [
"Aardvark does not insure drivers with more than 6 penalty points"
]
}
400 Bad Request. The body was not valid JSON, or one or more fields were missing or invalid.
| Field | Type | Description |
|---|---|---|
error | string | Always Invalid quote request |
details | string[] | One message for each problem with the request |
{
"error": "Invalid quote request",
"details": [
"engineSize must be a positive number",
"fuelType must be one of: petrol, diesel, electric"
]
}
An unknown path returns 404 Not Found. The wrong HTTP method returns 405 Method Not Allowed with an Allow header. Both have a JSON body of the form { "error": "..." }.