Skip to content
Demo environment. M-Pesa and DMVIC are simulated; no real money or certificates move. Sandbox details
FlexySure

Standard products

3 endpoints · base URL https://flexysure.intrepidprojects.co.ke/api/v1

Packaged covers — personal accident, domestic package, WIBA, fire, golfer's and the like — priced flat, by age band or as a rate on the sum insured. Insurance Cloud field names (coverName, basicPremium, sumInsured).

MethodPathSummaryScope
GET /api/v1/standard/products List standard products read
GET /api/v1/standard/quote Price a standard product quote
POST /api/v1/standard/save Bind a standard product bind
GET /api/v1/standard/products

List standard products

Every active product with its benefit schedule and each insurer's covers (plan_id, cover name, pricing basis). needs_age / needs_sum_insured say what the quote needs.

Scope
read
Authentication
Bearer token
Rate limit
60 requests per minute per token (per-client override)
Idempotency
Safe to repeat (read only).
Agent headers
Accepts X-Agent-Code and X-Agent-Key: the call runs as that agent and sees only the agent's own records.

Headers

HeaderMeaning
AuthorizationBearer <access_token> (scope read or quote)
X-Agent-CodeOptional. Agent code of the selling agent; the call runs with that agent's visibility.
X-Agent-KeyOptional, with X-Agent-Code. The agent's API key; a mismatch returns 403 agent_denied.

Example

Request cURL
curl -X GET 'https://flexysure.intrepidprojects.co.ke/api/v1/standard/products' \
  -H "Authorization: Bearer $ACCESS_TOKEN" \
  -H 'Accept: application/json' \
  -H 'X-Agent-Code: KK01' \
  -H "X-Agent-Key: $AGENT_KEY"
Response JSON
{
    "data": [
        {
            "id": 4,
            "code": "PA",
            "name": "Personal accident",
            "description": "…",
            "brochure_url": null,
            "needs_age": true,
            "needs_sum_insured": false,
            "benefits": [
                {
                    "name": "Death",
                    "limit": 1000000,
                    "limit_minor": 100000000
                }
            ],
            "covers": [
                {
                    "plan_id": 9,
                    "insurer_id": 1,
                    "insurer_name": "Savanna General",
                    "cover_name": "PA Classic",
                    "pricing": "age_band",
                    "rate_bps": null,
                    "ipf_eligible": false,
                    "premium": null,
                    "premium_minor": null,
                    "sum_insured": 1000000,
                    "sum_insured_minor": 100000000
                }
            ]
        }
    ]
}

Responses

StatusMeaning
200 Products

Errors are problem documents; the common codes (401, 403 insufficient_scope, 422, 429) apply to every endpoint.

GET /api/v1/standard/quote

Price a standard product

Scope
quote
Authentication
Bearer token
Rate limit
60 requests per minute per token (per-client override)
Idempotency
Safe to repeat (read only).
Agent headers
Accepts X-Agent-Code and X-Agent-Key: the call runs as that agent and sees only the agent's own records.

Headers

HeaderMeaning
AuthorizationBearer <access_token> (scope quote)
X-Agent-CodeOptional. Agent code; with X-Agent-Key the agent becomes the creator.
X-Agent-KeyOptional. The agent's key.

Parameters

NameInTypeRequiredDescription
product_id query integer Yes
insurer_id query integer No One insurer, or insurer_id[]= for several.
age query integer No Needed for age-band products.
sum_insured query integer No Flexysure only. Whole shillings; needed for rate-on-sum-insured products.

Example

Request cURL
curl -X GET 'https://flexysure.intrepidprojects.co.ke/api/v1/standard/quote' \
  -H "Authorization: Bearer $ACCESS_TOKEN" \
  -H 'Accept: application/json' \
  -H 'X-Agent-Code: KK01' \
  -H "X-Agent-Key: $AGENT_KEY"
Response JSON
{
    "message": "1 option found.",
    "quote": {
        "product_id": 4,
        "insurer_id": [
            1
        ],
        "age": 30,
        "sum_insured": null
    },
    "options": [
        {
            "insurer_id": 1,
            "insurer_name": "Savanna General",
            "plan_id": 9,
            "plan_name": "PA Classic",
            "basic_premium": 4500,
            "basic_premium_minor": 450000,
            "taxes": [],
            "taxes_total": 60,
            "taxes_total_minor": 6000,
            "total": 4560,
            "total_minor": 456000,
            "product_id": 4,
            "product_code": "PA",
            "pricing": "age_band",
            "age": 30
        }
    ]
}

Responses

StatusMeaning
200 Options
422 validation_failed or no_quote

Errors are problem documents; the common codes (401, 403 insufficient_scope, 422, 429) apply to every endpoint.

POST /api/v1/standard/save

Bind a standard product

Re-prices the product with the chosen insurer (policy.plan_id or coverName picks the cover) and checks policy.premium within KES 1. Age comes from policy.age or the client's dob. benefits[] (limits in shillings, rate in percent) is kept on the policy; otherwise the cover's schedule is used.

Scope
bind
Authentication
Bearer token
Rate limit
60 requests per minute per token (per-client override)
Idempotency
Required: send an Idempotency-Key; a retry with the same key replays the first response.
Agent headers
Accepts X-Agent-Code and X-Agent-Key: the call runs as that agent and sees only the agent's own records.

Headers

HeaderMeaning
AuthorizationBearer <access_token> (scope bind)
Idempotency-KeyRequired. Unique per save; replays return the first response.
X-Agent-CodeOptional. Agent code; with X-Agent-Key the agent becomes the creator.
X-Agent-KeyOptional. The agent's key.

Body fields

FieldTypeRequiredDescription
client object Yes Same block as POST /api/v1/motor/save, plus optional dob.
policy object Yes {product_id, start_date, end_date?, insurer_id, coverName?, plan_id?, age?, basicPremium?, sumInsured?, taxes?, premium, premium_instalments?}.
taxes array No Accepted for compatibility; the server computes levies.
benefits array No [{name, limit, rate, premium}].

Example

Request cURL
curl -X POST 'https://flexysure.intrepidprojects.co.ke/api/v1/standard/save' \
  -H "Authorization: Bearer $ACCESS_TOKEN" \
  -H 'Accept: application/json' \
  -H 'Idempotency-Key: 2462c57f-de65-49b2-ab7b-8516d9d2d0f7' \
  -H 'X-Agent-Code: KK01' \
  -H "X-Agent-Key: $AGENT_KEY" \
  -H 'Content-Type: application/json' \
  -d '{
    "client": {
        "name": "Mutua Musyoka",
        "phone": "0755000333",
        "dob": "1996-01-20"
    },
    "policy": {
        "product_id": 4,
        "start_date": "2026-10-14",
        "end_date": "2027-10-13",
        "insurer_id": 1,
        "coverName": "PA Classic",
        "basicPremium": 4500,
        "sumInsured": 1000000,
        "taxes": 60,
        "premium": 4560
    },
    "taxes": [],
    "benefits": [
        {
            "name": "Death",
            "limit": 1000000,
            "rate": null,
            "premium": 0
        }
    ]
}'
Request body (JSON)
Request body JSON
{
    "client": {
        "name": "Mutua Musyoka",
        "phone": "0755000333",
        "dob": "1996-01-20"
    },
    "policy": {
        "product_id": 4,
        "start_date": "2026-10-14",
        "end_date": "2027-10-13",
        "insurer_id": 1,
        "coverName": "PA Classic",
        "basicPremium": 4500,
        "sumInsured": 1000000,
        "taxes": 60,
        "premium": 4560
    },
    "taxes": [],
    "benefits": [
        {
            "name": "Death",
            "limit": 1000000,
            "rate": null,
            "premium": 0
        }
    ]
}
Response JSON
{
    "message": "Policy saved successfully.",
    "id": 455,
    "uuid": "e7f1…",
    "risknote": "RN-000455",
    "policy_no": "POL-000455",
    "client_no": "C-000127",
    "client_key": "fxck_…",
    "product_line": "standard"
}

Responses

StatusMeaning
201 Policy saved (same shape as motor save)
422 validation_failed, premium_mismatch, no_quote or domain_rule

Errors are problem documents; the common codes (401, 403 insufficient_scope, 422, 429) apply to every endpoint.