Insurance Quote API

Environment: Live

Quote the premium of each motor insurance cover for a start date and number of seats, before selling a policy.

# Insurance Quote API

Get the premium of each motor insurance cover for a start date and number of seats. Use the premium of the cover you sell as premium when you sell the policy. Nothing is charged by a quote.

## Endpoint
- **Method**: POST
- **URL**: https://api.moolre.com/open/sales/insurance/quote

## Headers
| Header | Type | Required | Description |
| :--- | :--- | :--- | :--- |
| Content-Type | string | Yes | Send application/json. |
| X-API-USER | string | Yes | Your Moolre username. |
| X-API-KEY | string | Yes | Your Private API Key for the paying wallet. |

## Request Body
| Parameter | Type | Required | Description |
| :--- | :--- | :--- | :--- |
| accountnumber | string | Yes | Your insurance agent wallet account number. |
| start_date | string | Yes | Date the policy starts, as YYYY-MM-DD. A date in the past is priced as today. |
| seats | integer | Yes | Number of seats of the vehicle, a whole number from 1 to 100. |

## Response (200 Quote (IQ20))
Premiums for each cover available for the details. Prices change, so a quote is only good for the start date it was asked for.

```json
{
  "status": "1",
  "code": "IQ20",
  "message": "Insurance quote",
  "data": {
    "start_date": "2026-12-01",
    "seats": 5,
    "period_months": 12,
    "currency": "GHS",
    "covers": [
      {
        "cover_type": "third_party",
        "cover_code": "T",
        "premium": "1250.00"
      },
      {
        "cover_type": "third_party_fire_theft",
        "cover_code": "F",
        "premium": "1980.50"
      },
      {
        "cover_type": "comprehensive",
        "cover_code": "C",
        "premium": "3400.00"
      }
    ]
  },
  "go": null,
  "meta": {
    "requestid": "req_c68f4c66115c26725c796242",
    "notices": []
  }
}
```

## Response (200 Refused (IQ05, ASQ01 and others))
Nothing is priced. data names the field to fix. See the codes below.

```json
{
  "status": "0",
  "code": "ASQ01",
  "message": "start_date must be a valid date as YYYY-MM-DD.",
  "data": "start_date",
  "go": null,
  "meta": {
    "requestid": "req_c68f4c66115c26725c796242",
    "notices": []
  }
}
```

## Before you begin

Insurance is sold from a wallet that Moolre has registered as an insurance sales agent (the Insurance sales product). Register it in the Moolre App by creating a Sell on Our Platform service, choosing the Insurance product and linking your GHS wallet, or contact Moolre Support to be set up. The accountnumber you send must be your own GHS wallet; any other wallet is refused. Insurance is sold in GHS only.

Call these endpoints from your server with your Moolre username as X-API-USER and your Private API Key as X-API-KEY: never put the private key in a browser or a mobile app. Quote, Vehicles, VIN lookup and Covers only read: nothing is charged and no externalref is needed. Only Sell Insurance charges the wallet.

## How quotes work

The quote is for a vehicle priced on a standard value for a 12 month cover, for the seats you send. Answers are kept for a short time and reused: a quote stays valid until the end of its start date, and for at most 24 hours. For a new policy, send the premium that Quote returns for the chosen cover, using the quote for the same start date as the policy commencement date (com_date, or today when it is in the past) and the same number of seats as policy.motor.noseats. The price is checked again before you are charged: when it differs by more than 0.01 the request is refused with IS10, nothing is charged, and the quote must be fetched again. For a renewal, send the renewal premium due; the amount you send is the amount charged.

## Codes

Application codes, not HTTP status codes. Codes starting IQ come from the sales server and are returned unchanged.

| Code | Meaning | Next step |
| --- | --- | --- |
| ASQ00 | Authentication error (Quote). | Check X-API-USER, X-API-KEY and accountnumber. |
| ASQ01 | start_date is missing or not a valid date. | Send start_date as YYYY-MM-DD. |
| ASQ02 | seats is missing or not a whole number from 1 to 100. | Send the number of seats. |
| ASQ04 | Request incomplete (Quote). | Send accountnumber, start_date and seats. |
| ASQ05 | No readable answer from the insurer. | Wait a moment and ask again. Nothing is charged by a quote. |
| ASQ06 | Unknown error (Quote). | Ask again. Nothing is charged by a quote. |
| IQ02 | Not authorised. | accountnumber must be your own insurance agent wallet and the request must use your API user and key. |
| IQ03 | type must be 1 (quote), 2 (vehicle search) or 3 (VIN lookup). | Use the Quote, Vehicles or VIN endpoint. |
| IQ04 | This wallet is not registered as an insurance sales agent. | Contact Moolre Support to register the wallet. |
| IQ05 | start_date is missing or not a valid date. | Send start_date as YYYY-MM-DD. |
| IQ06 | seats is missing or not a whole number from 1 to 100. | Send the number of seats. |
| IQ09 | The insurer (for a VIN lookup, or the VIN decoder) could not be reached, try again. | Ask again after a moment. |
| IQ10 | The insurer has no price for these details. | Check start_date and seats, or choose another cover. |
| IQ20 | Insurance quote. | Quote returned in data.covers. |
| IQ30 | Unknown error (quote or vehicle search). | Ask again. Nothing is charged. |

[Find the vehicle](https://docs.moolre.com/api/sales/insurance/vehicles), then [sell the policy](https://docs.moolre.com/api/sales/insurance).

## Fields every response can carry

These fields are additive: existing fields keep their names, order and types.

| Field | Meaning |
| :--- | :--- |
| meta | Always present, last in the object. meta.replayed is true only when the response is the stored answer to a repeated Idempotency-Key (absent otherwise). meta.requestid is the unique id of the request (also the X-Request-Id response header): quote it when you contact support. meta.notices is always an array, empty when there is nothing to report; each notice is { code, message, docs? }, for example that a deprecated way of sending credentials was used. See [Deprecations](https://docs.moolre.com/guides/deprecations). |

There is no outcome field. Decide the result from status, code and, on payment and transfer endpoints, data.txstatus (0 pending, 1 succeeded, 2 failed). These codes mean the result is unknown and may still succeed, so treat them as pending and check the status: PY01, PY02, TR01, TR02, TP11, TP18, APY10, APY16, ASL06, IS30, SYS500. Status 1 with TR08, OBGH01, OTGH01, OBNG01, GHQ03 or OM03 is final success; any other status 1 is an accepted, unfinished request.

Send X-Moolre-Http-Status: strict to receive real HTTP status codes (400, 401, 403, 404, 409, 422, 429, 5xx) instead of HTTP 200. See [Responses and request IDs](https://docs.moolre.com/guides/responses).

Back to the Moolre AI documentation index