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

ERP exports

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

Insurance Cloud's ERP endpoints, record for record, for integrators syncing an accounting or ERP system: {status, <records>[], meta, links} with page/per_page. Amounts are whole shillings. Visibility: staff tokens see every record; agents (actor with own-records visibility, or X-Agent-Code/X-Agent-Key) see records they created, records of clients they are the salesperson for, and claims on policies they created. agents[] lists the agents attached to a record (its creator and the client's salesperson, when they are agents).

MethodPathSummaryScope
GET /api/v1/erp/clients Export clients read
GET /api/v1/erp/policies Export policies read
GET /api/v1/erp/claims Export claims read
GET /api/v1/erp/clients

Export clients

Scope
read
Authentication
Bearer token
Rate limit
5 requests per minute per API client (Insurance Cloud parity), on top of the platform limit
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)
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.

Parameters

NameInTypeRequiredDescription
page query integer No Default 1.
per_page query integer No Default 15, max 100.

Example

Request cURL
curl -X GET 'https://flexysure.intrepidprojects.co.ke/api/v1/erp/clients' \
  -H "Authorization: Bearer $ACCESS_TOKEN" \
  -H 'Accept: application/json' \
  -H 'X-Agent-Code: KK01' \
  -H "X-Agent-Key: $AGENT_KEY"
Response JSON
{
    "status": "success",
    "clients": [
        {
            "id": 42,
            "client_no": "C-00042",
            "name": "Wanjiru Kamau",
            "phone": "0712345678",
            "email": "wanjiru@example.com",
            "idno": "27845123",
            "pin": "A001234567Z",
            "sales_person": "Kevin Kiprop",
            "agents": [
                {
                    "id": 4,
                    "name": "Kevin Kiprop",
                    "code": "KK01"
                }
            ]
        }
    ],
    "meta": {
        "current_page": 1,
        "per_page": 15,
        "total": 1,
        "last_page": 1
    },
    "links": {
        "next": null,
        "prev": null
    }
}

Responses

StatusMeaning
200 Clients
429 More than 5 calls in a minute

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

GET /api/v1/erp/policies

Export policies

Status mapping: 1 = active (active); 0 = inactive (awaiting payment, cancelled, expired, renewed, void); 2 = all (default). In the response status is 1 or 0 and status_label carries Flexysure's status. starting/ending filter on the cover start date. transaction is "New business" or "Renewal"; receipted is what has been paid against the policy's debit notes and balance what is still owed.

Scope
read
Authentication
Bearer token
Rate limit
5 requests per minute per API client (Insurance Cloud parity), on top of the platform limit
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)
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.

Parameters

NameInTypeRequiredDescription
status query integer No 0 inactive, 1 active, 2 all (default). One of: 0, 1, 2
starting query string No Cover starting on or after (Y-m-d).
ending query string No Cover starting on or before (Y-m-d).
page query integer No Default 1.
per_page query integer No Default 15, max 100.

Example

Request cURL
curl -X GET 'https://flexysure.intrepidprojects.co.ke/api/v1/erp/policies' \
  -H "Authorization: Bearer $ACCESS_TOKEN" \
  -H 'Accept: application/json' \
  -H 'X-Agent-Code: KK01' \
  -H "X-Agent-Key: $AGENT_KEY"
Response JSON
{
    "status": "success",
    "policies": [
        {
            "id": 123,
            "uuid": "1a2b…",
            "status": 1,
            "status_label": "Active",
            "transaction": "New business",
            "policy_no": "SG/MP/2026/000123",
            "product_id": null,
            "insurer": "Savanna General",
            "client": "Wanjiru Kamau",
            "client_no": "C-00042",
            "product": "Comprehensive",
            "product_line": "motor",
            "start_date": "2026-10-14",
            "end_date": "2027-10-13",
            "risk_note": "RN-00123",
            "premium": 35587,
            "receipted": 35587,
            "balance": 0,
            "sales_person": "Kevin Kiprop",
            "agents": [
                {
                    "id": 4,
                    "name": "Kevin Kiprop",
                    "code": "KK01"
                }
            ]
        }
    ],
    "meta": {
        "current_page": 1,
        "per_page": 15,
        "total": 1,
        "last_page": 1
    },
    "links": {
        "next": null,
        "prev": null
    }
}

Responses

StatusMeaning
200 Policies
429 More than 5 calls in a minute

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

GET /api/v1/erp/claims

Export claims

claim_type is Insurance Cloud's Legal / Non Legal; cause is the kind of loss. starting/ending filter on the reported date. claim_amount is the estimate, paid_amount what has been paid.

Scope
read
Authentication
Bearer token
Rate limit
5 requests per minute per API client (Insurance Cloud parity), on top of the platform limit
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)
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.

Parameters

NameInTypeRequiredDescription
type query string No One of: Legal, Non Legal
starting query string No Reported on or after (Y-m-d).
ending query string No Reported on or before (Y-m-d).
page query integer No Default 1.
per_page query integer No Default 20, max 100.

Example

Request cURL
curl -X GET 'https://flexysure.intrepidprojects.co.ke/api/v1/erp/claims' \
  -H "Authorization: Bearer $ACCESS_TOKEN" \
  -H 'Accept: application/json' \
  -H 'X-Agent-Code: KK01' \
  -H "X-Agent-Key: $AGENT_KEY"
Response JSON
{
    "status": "success",
    "claims": [
        {
            "id": 12,
            "uuid": "5c2e…",
            "claim_no": "CLM/2026/00012",
            "policy_no": "SG/MP/2026/000123",
            "incident_date": "2026-10-10",
            "claim_type": "Non Legal",
            "cause": "Accidental damage",
            "product": "Motor",
            "item": "KDA 123A",
            "status": "Under assessment",
            "client": {
                "name": "Wanjiru Kamau",
                "client_no": "C-00042"
            },
            "insurer": "Savanna General",
            "currency": "KES",
            "claim_amount": 150000,
            "paid_amount": 0,
            "sales_person": "Kevin Kiprop",
            "agents": [
                {
                    "id": 4,
                    "name": "Kevin Kiprop",
                    "code": "KK01"
                }
            ]
        }
    ],
    "meta": {
        "current_page": 1,
        "per_page": 20,
        "total": 1,
        "last_page": 1
    },
    "links": {
        "next": null,
        "prev": null
    }
}

Responses

StatusMeaning
200 Claims
429 More than 5 calls in a minute

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