API version 2026-10-24

Coopie API

Connect payroll, accounting and banking systems to your cooperative: read members, balances, loans and the ledger, record payments, and get webhooks when things change.

Overview

The Coopie API is a REST API over HTTPS. Requests and responses are JSON, every request is authenticated with an API key, and each key belongs to one cooperative: everything you read or write is that cooperative’s data.

Base URL
https://coopie.io/api/v1
  • Ids are UUIDs. Members, loans and transactions can also be looked up by their member number, loan number or reference.
  • Money is in major units (naira) as JSON numbers, with a currency field alongside.
  • Dates are ISO 8601 in UTC, e.g. 2026-10-24T11:02:13.000Z.
  • Versioning: the API is at version 2026-10-24. We add fields and endpoints without notice, so ignore fields you don’t know; anything that would break an integration gets a new dated version and an entry in the changelog. Every event carries an apiVersion field.

Quickstart

  1. Sign in as a cooperative admin and open the Developers page in the admin sidebar.
  2. Create a test key with the read and write scopes. Copy the secret (ck_test_…): it is shown once.
  3. Check it works by fetching your cooperative:
curl
curl "https://coopie.io/api/v1/cooperative" \
  -H "Authorization: Bearer ck_test_…"

Then record a payment against one of the sandbox members:

curl
curl -X POST "https://coopie.io/api/v1/transactions" \
  -H "Authorization: Bearer ck_test_…" \
  -H "Idempotency-Key: b7c1d9e0-3f2a-4b5c-8d6e-9f0a1b2c3d4e" \
  -H "Content-Type: application/json" \
  -d '{
  "memberNumber": "SBX000001",
  "kind": "CONTRIBUTION",
  "amount": 10000,
  "date": "2026-10-24",
  "method": "BANK_TRANSFER",
  "externalReference": "BANK-REF-88213"
}'

The response is the new transaction, and a payment.recorded webhook goes to any test endpoint subscribed to it. Or skip the terminal and use the API console on this page.

Authentication & keys

Send your key as a bearer token on every request (an x-api-key header works too):

Header
Authorization: Bearer ck_live_…
  • Test keys (ck_test_…) work against a sandbox copy of your cooperative and are available on every plan. Live keys (ck_live_…) work against your real data and need the Professional plan. Each response says which it used in the Coopie-Mode header (test or live).
  • Scopes: read allows every GET; write allows recording payments and inviting members. Give each integration only what it needs.
  • Keys can be given an expiry (30 days, 90 days, a year) and revoked at any time in the Developers page. A revoked or expired key is refused at once with 401.
API keys are secrets that act as your cooperative. Keep them on your server, in an environment variable or secret store. Never put one in a browser app, a mobile app or a git repository. If a key leaks, revoke it and create a new one.

Test mode

Test keys point at a sandbox: a private copy of your cooperative, created the first time a test key is used. It comes seeded with about eight fake members (member numbers SBX000001, SBX000002, …), their contributions, one active loan and one pending loan application, so every endpoint has something to return.

  • Nothing you do in test mode touches your live cooperative.
  • Test mode never sends email.
  • Inviting a member (POST /members) adds them to the sandbox at once with a sandbox email address; in live mode it emails a real invitation.
  • Test events go only to test webhook endpoints.
  • Reset the sandbox to its seeded state any time on the Developers page.

Errors

Coopie uses HTTP status codes: 2xx succeeded, 4xx means the request needs changing, 5xx is our fault and is safe to retry. Every error has the same shape, with a stable code to branch on and, for validation errors, the param at fault:

400 Bad Request
{
  "error": {
    "type": "invalid_request_error",
    "code": "validation_error",
    "message": "amount: Number must be greater than 0",
    "param": "amount"
  },
  "requestId": "req_4f1a9c2e7b3d5a6c8e0f1b2d"
}

Every response carries an X-Request-Id header (also requestId in error bodies). Include it when you contact support.

400
Code
validation_error
Meaning
A parameter or body field is missing or invalid (param names it)
400
Code
invalid_json
Meaning
The body isn't valid JSON
400
Code
payment_rejected
Meaning
The payment can't be recorded (e.g. unknown member, closed period, no running loan)
400
Code
idempotency_key_invalid
Meaning
The Idempotency-Key is longer than 255 characters
401
Code
missing_api_key
Meaning
No key was sent
401
Code
invalid_api_key
Meaning
The key doesn't exist
401
Code
api_key_revoked
Meaning
The key was revoked
401
Code
api_key_expired
Meaning
The key has expired
403
Code
insufficient_scope
Meaning
The key lacks the read or write scope
403
Code
plan_required
Meaning
Live API access isn't in the cooperative's plan
403
Code
cooperative_restricted
Meaning
The cooperative is suspended or unverified, so it can't make changes
403
Code
cooperative_inactive
Meaning
The cooperative is no longer active on Coopie
403
Code
no_admin
Meaning
The cooperative has no active admin to send invitations from
403
Code
member_limit
Meaning
The plan's (or sandbox's) member limit is reached
404
Code
resource_missing
Meaning
No such object in this cooperative
409
Code
duplicate
Meaning
This payment is already recorded
409
Code
member_exists
Meaning
Already a member
409
Code
invitation_pending
Meaning
An invitation is already waiting
409
Code
request_in_progress
Meaning
A request with this Idempotency-Key is still running
422
Code
idempotency_key_reused
Meaning
The Idempotency-Key was used with a different request
429
Code
rate_limited
Meaning
Too many requests; wait for Retry-After seconds
500
Code
internal_error
Meaning
Our fault. Retry; quote the request id to support

Rate limits

Each key can make 120 requests per 60 seconds. Responses include X-RateLimit-Limit. Over the limit you get 429 rate_limited with a Retry-After header: wait that many seconds, then retry. To move lots of payments, send them in one batch request (up to 500 rows) instead of one call each.

Idempotency

Networks fail. To retry a POST without recording a payment twice, send an Idempotency-Key header with a unique value (a UUID is ideal) and reuse it when you retry the same request.

curl
curl -X POST "https://coopie.io/api/v1/transactions" \
  -H "Authorization: Bearer $COOPIE_API_KEY" \
  -H "Idempotency-Key: b7c1d9e0-3f2a-4b5c-8d6e-9f0a1b2c3d4e" \
  -H "Content-Type: application/json" \
  -d '{
  "memberNumber": "SBX000001",
  "kind": "CONTRIBUTION",
  "amount": 10000,
  "date": "2026-10-24",
  "method": "BANK_TRANSFER",
  "externalReference": "BANK-REF-88213"
}'
  • Same key and same body within 24 hours: you get the stored response again, with Idempotent-Replayed: true. Nothing runs twice.
  • Same key with a different body or endpoint: 422 idempotency_key_reused.
  • Same key while the first request is still running: 409 request_in_progress. Retry shortly.
  • 5xx responses aren’t stored, so retrying with the same key runs the request again.
  • Keys are scoped to your cooperative and can be up to 255 characters.

Payments also have their own duplicate check: one identical to a payment already recorded (same member, kind, amount, date, external reference and loan) returns 409 duplicate, with or without a key.

Pagination

List endpoints take page (from 1) and limit (1–100, default 25) and return a list object. Keep requesting the next page while hasMore is true.

curl
curl "https://coopie.io/api/v1/members?page=2&limit=25" \
  -H "Authorization: Bearer $COOPIE_API_KEY"
Response
{
  "object": "list",
  "data": [
    "…"
  ],
  "page": 2,
  "limit": 25,
  "total": 61,
  "hasMore": true
}

API reference

Every endpoint, generated from the same definition the console uses. Examples use $COOPIE_API_KEY; set it in your shell with export COOPIE_API_KEY=ck_test_…. Try it loads an endpoint into the console.

Cooperative

Retrieve your cooperative

GET/api/v1/cooperative
Scope: read

The cooperative the key belongs to, whether it is live or test mode, and the key's own name and scopes. A quick way to check a key works.

Example request
curl "https://coopie.io/api/v1/cooperative" \
  -H "Authorization: Bearer $COOPIE_API_KEY"
Example response
{
  "object": "cooperative",
  "id": "9b2d4f6a-8c0e-4a1b-9c3d-5e7f9a1b3c5d",
  "name": "Lagos Health Workers Cooperative",
  "slug": "lagos-health",
  "email": "[email protected]",
  "currency": "NGN",
  "livemode": false,
  "createdAt": "2025-11-02T10:00:00.000Z",
  "apiKey": {
    "id": "1f2e3d4c-5b6a-4987-8a9b-0c1d2e3f4a5b",
    "name": "Payroll sync",
    "scopes": [
      "read",
      "write"
    ]
  }
}

Members

List members

GET/api/v1/members
Scope: read

Members in the order they joined. Filter by status, or search names, emails and member numbers.

Parameters
status
In
query
Type
ACTIVE | INACTIVE | SUSPENDED | DECEASED
Description
Only members with this status
search
In
query
Type
string
Description
Matches name, email or member number
page
In
query
Type
integer
Description
Page number, from 1 (e.g. 1)
limit
In
query
Type
integer
Description
Items per page, 1–100 (default 25) (e.g. 25)
Example request
curl "https://coopie.io/api/v1/members" \
  -H "Authorization: Bearer $COOPIE_API_KEY"
Example response
{
  "object": "list",
  "data": [
    {
      "object": "member",
      "id": "6f1c2b9e-1d0a-4f5e-9b1a-2c3d4e5f6a7b",
      "memberNumber": "LAG000042",
      "firstName": "Adaeze",
      "lastName": "Okafor",
      "email": "[email protected]",
      "phone": "+2348000000001",
      "role": "MEMBER",
      "status": "ACTIVE",
      "employerName": "Lagos State Ministry of Health",
      "employeeId": "EMP-1000",
      "joinedAt": "2026-01-12T10:00:00.000Z",
      "createdAt": "2026-01-12T10:00:00.000Z",
      "updatedAt": "2026-06-01T08:30:00.000Z"
    }
  ],
  "page": 1,
  "limit": 25,
  "total": 1,
  "hasMore": false
}

Retrieve a member

GET/api/v1/members/{id}
Scope: read

By id or member number.

Parameters
idrequired
In
path
Type
string
Description
Member id or member number (e.g. SBX000001)
Example request
curl "https://coopie.io/api/v1/members/SBX000001" \
  -H "Authorization: Bearer $COOPIE_API_KEY"
Example response
{
  "object": "member",
  "id": "6f1c2b9e-1d0a-4f5e-9b1a-2c3d4e5f6a7b",
  "memberNumber": "LAG000042",
  "firstName": "Adaeze",
  "lastName": "Okafor",
  "email": "[email protected]",
  "phone": "+2348000000001",
  "role": "MEMBER",
  "status": "ACTIVE",
  "employerName": "Lagos State Ministry of Health",
  "employeeId": "EMP-1000",
  "joinedAt": "2026-01-12T10:00:00.000Z",
  "createdAt": "2026-01-12T10:00:00.000Z",
  "updatedAt": "2026-06-01T08:30:00.000Z"
}

Retrieve a member's balance

GET/api/v1/members/{id}/balance
Scope: read

Savings, withdrawals, loans owed and what the member could withdraw today: the same figures the member's dashboard shows.

Parameters
idrequired
In
path
Type
string
Description
Member id or member number (e.g. SBX000001)
Example request
curl "https://coopie.io/api/v1/members/SBX000001/balance" \
  -H "Authorization: Bearer $COOPIE_API_KEY"
Example response
{
  "object": "balance",
  "member": {
    "id": "6f1c2b9e-1d0a-4f5e-9b1a-2c3d4e5f6a7b",
    "memberNumber": "LAG000042"
  },
  "currency": "NGN",
  "totalContributions": 60000,
  "totalWithdrawals": 0,
  "pendingWithdrawals": 0,
  "savingsBalance": 60000,
  "loanOutstanding": 180000,
  "heldForGuarantees": 0,
  "totalDividends": 0,
  "availableToWithdraw": 0,
  "asOf": "2026-10-24T12:00:00.000Z"
}

Invite a member

POST/api/v1/members
Scope: writeSupports Idempotency-Key

Live: emails an invitation, exactly like Invite member in the dashboard; member.created fires when they accept. Test: the member is added at once (with a sandbox email address that can't receive mail) and member.created fires immediately.

Body
emailrequired
Type
string
Description
Where the invitation goes
firstNamerequired
Type
string
Description
First name
lastNamerequired
Type
string
Description
Last name
phone
Type
string
Description
Phone number
employerName
Type
string
Description
Employer (test mode)
employeeId
Type
string
Description
Staff/payroll number (test mode)
Example request
curl -X POST "https://coopie.io/api/v1/members" \
  -H "Authorization: Bearer $COOPIE_API_KEY" \
  -H "Idempotency-Key: 8e4f2a1c-0d3b-4c5e-9f6a-7b8c9d0e1f2a" \
  -H "Content-Type: application/json" \
  -d '{
  "email": "[email protected]",
  "firstName": "Tobi",
  "lastName": "Adebayo"
}'
Example response
{
  "object": "invitation",
  "id": "7a8b9c0d-1e2f-4a3b-8c4d-5e6f7a8b9c0d",
  "email": "[email protected]",
  "firstName": "Tobi",
  "lastName": "Adebayo",
  "status": "pending",
  "expiresAt": "2026-10-31T12:00:00.000Z",
  "member": null
}

Services

List services

GET/api/v1/services
Scope: read

The cooperative's savings (contribution) and loan products.

Example request
curl "https://coopie.io/api/v1/services" \
  -H "Authorization: Bearer $COOPIE_API_KEY"
Example response
{
  "object": "list",
  "data": [
    {
      "object": "service",
      "id": "a2e4c6f8-0b1d-4f3a-8c5e-7d9f1b3d5f7a",
      "name": "Monthly Savings",
      "description": null,
      "kind": "contribution",
      "category": "SAVINGS",
      "mandatory": true,
      "active": true,
      "currency": "NGN",
      "minimumAmount": 5000,
      "maximumAmount": null,
      "interestRate": null,
      "repaymentPeriodMonths": null,
      "createdAt": "2025-11-02T10:00:00.000Z"
    }
  ],
  "page": 1,
  "limit": 25,
  "total": 1,
  "hasMore": false
}

Transactions

List transactions

GET/api/v1/transactions
Scope: read

The ledger, newest first by the day the money moved.

Parameters
member
In
query
Type
string
Description
Member id or member number
category
In
query
Type
CONTRIBUTION | LOAN_REPAYMENT | LOAN_DISBURSEMENT | SAVINGS_WITHDRAWAL | …
Description
Only this category
status
In
query
Type
PENDING | PROCESSING | COMPLETED | FAILED | REVERSED
Description
Only this status
from
In
query
Type
ISO 8601 date
Description
Effective on or after (e.g. 2026-01-01)
to
In
query
Type
ISO 8601 date
Description
Effective on or before (a date alone includes that whole day)
page
In
query
Type
integer
Description
Page number, from 1 (e.g. 1)
limit
In
query
Type
integer
Description
Items per page, 1–100 (default 25) (e.g. 25)
Example request
curl "https://coopie.io/api/v1/transactions?from=2026-01-01" \
  -H "Authorization: Bearer $COOPIE_API_KEY"
Example response
{
  "object": "list",
  "data": [
    {
      "object": "transaction",
      "id": "0b8f5c2e-7a61-4e0b-b0b9-5b1f0c3e9d21",
      "reference": "REC-3F9A1C2B7D4E5F60",
      "externalReference": "PAYROLL-2026-10",
      "type": "CREDIT",
      "category": "CONTRIBUTION",
      "amount": 10000,
      "currency": "NGN",
      "status": "COMPLETED",
      "method": "PAYROLL_DEDUCTION",
      "description": "Contribution — Adaeze Okafor",
      "member": {
        "id": "6f1c2b9e-1d0a-4f5e-9b1a-2c3d4e5f6a7b",
        "memberNumber": "LAG000042"
      },
      "service": {
        "id": "a2e4c6f8-0b1d-4f3a-8c5e-7d9f1b3d5f7a",
        "name": "Monthly Savings"
      },
      "loanId": null,
      "reverses": null,
      "effectiveDate": "2026-10-24T11:00:00.000Z",
      "createdAt": "2026-10-24T11:02:13.000Z",
      "updatedAt": "2026-10-24T11:02:13.000Z"
    }
  ],
  "page": 1,
  "limit": 25,
  "total": 1,
  "hasMore": false
}

Retrieve a transaction

GET/api/v1/transactions/{id}
Scope: read

By id or reference.

Parameters
idrequired
In
path
Type
string
Description
Transaction id or reference
Example request
curl "https://coopie.io/api/v1/transactions/0b8f5c2e-7a61-4e0b-b0b9-5b1f0c3e9d21" \
  -H "Authorization: Bearer $COOPIE_API_KEY"
Example response
{
  "object": "transaction",
  "id": "0b8f5c2e-7a61-4e0b-b0b9-5b1f0c3e9d21",
  "reference": "REC-3F9A1C2B7D4E5F60",
  "externalReference": "PAYROLL-2026-10",
  "type": "CREDIT",
  "category": "CONTRIBUTION",
  "amount": 10000,
  "currency": "NGN",
  "status": "COMPLETED",
  "method": "PAYROLL_DEDUCTION",
  "description": "Contribution — Adaeze Okafor",
  "member": {
    "id": "6f1c2b9e-1d0a-4f5e-9b1a-2c3d4e5f6a7b",
    "memberNumber": "LAG000042"
  },
  "service": {
    "id": "a2e4c6f8-0b1d-4f3a-8c5e-7d9f1b3d5f7a",
    "name": "Monthly Savings"
  },
  "loanId": null,
  "reverses": null,
  "effectiveDate": "2026-10-24T11:00:00.000Z",
  "createdAt": "2026-10-24T11:02:13.000Z",
  "updatedAt": "2026-10-24T11:02:13.000Z"
}

Record a payment

POST/api/v1/transactions
Scope: writeSupports Idempotency-Key

Record money the cooperative received: a contribution or a loan repayment. Send one payment, or up to 500 as { "rows": [...] } (each row reports recorded, duplicate or error). A payment identical to one already recorded (member, kind, amount, date, external reference and loan) is a duplicate and is never recorded twice: a single one returns 409 duplicate. Fires payment.recorded (and loan.repaid when it clears a loan).

Body
memberNumberrequired
Type
string
Description
The member's number
kindrequired
Type
CONTRIBUTION | LOAN_REPAYMENT
Description
What the money is for
amountrequired
Type
number
Description
In major units (naira), more than 0
daterequired
Type
YYYY-MM-DD
Description
The day the cooperative received it (not in the future)
method
Type
BANK_TRANSFER | CASH | PAYROLL_DEDUCTION
Description
Default BANK_TRANSFER
externalReference
Type
string
Description
Your reference (bank ref, payroll run). Part of the duplicate check
loanNumber
Type
string
Description
For repayments when the member has more than one running loan
note
Type
string
Description
Shown on the transaction
Example request
curl -X POST "https://coopie.io/api/v1/transactions" \
  -H "Authorization: Bearer $COOPIE_API_KEY" \
  -H "Idempotency-Key: 8e4f2a1c-0d3b-4c5e-9f6a-7b8c9d0e1f2a" \
  -H "Content-Type: application/json" \
  -d '{
  "memberNumber": "SBX000001",
  "kind": "CONTRIBUTION",
  "amount": 10000,
  "date": "2026-10-24",
  "method": "PAYROLL_DEDUCTION",
  "externalReference": "PAYROLL-2026-10"
}'
Example response
{
  "object": "transaction",
  "id": "0b8f5c2e-7a61-4e0b-b0b9-5b1f0c3e9d21",
  "reference": "REC-3F9A1C2B7D4E5F60",
  "externalReference": "PAYROLL-2026-10",
  "type": "CREDIT",
  "category": "CONTRIBUTION",
  "amount": 10000,
  "currency": "NGN",
  "status": "COMPLETED",
  "method": "PAYROLL_DEDUCTION",
  "description": "Contribution — Adaeze Okafor",
  "member": {
    "id": "6f1c2b9e-1d0a-4f5e-9b1a-2c3d4e5f6a7b",
    "memberNumber": "LAG000042"
  },
  "service": {
    "id": "a2e4c6f8-0b1d-4f3a-8c5e-7d9f1b3d5f7a",
    "name": "Monthly Savings"
  },
  "loanId": null,
  "reverses": null,
  "effectiveDate": "2026-10-24T11:00:00.000Z",
  "createdAt": "2026-10-24T11:02:13.000Z",
  "updatedAt": "2026-10-24T11:02:13.000Z"
}

Loans

List loans

GET/api/v1/loans
Scope: read

Loan applications and loans, newest application first.

Parameters
status
In
query
Type
PENDING | APPROVED | ACTIVE | COMPLETED | DEFAULTED | CANCELLED | WRITTEN_OFF
Description
Only this status
member
In
query
Type
string
Description
Member id or member number
page
In
query
Type
integer
Description
Page number, from 1 (e.g. 1)
limit
In
query
Type
integer
Description
Items per page, 1–100 (default 25) (e.g. 25)
Example request
curl "https://coopie.io/api/v1/loans" \
  -H "Authorization: Bearer $COOPIE_API_KEY"
Example response
{
  "object": "list",
  "data": [
    {
      "object": "loan",
      "id": "c3d9e1f2-4a5b-4c6d-8e7f-9a0b1c2d3e4f",
      "loanNumber": "C3D9E1F2",
      "status": "ACTIVE",
      "member": {
        "id": "6f1c2b9e-1d0a-4f5e-9b1a-2c3d4e5f6a7b",
        "memberNumber": "LAG000042"
      },
      "product": {
        "id": "d4e5f6a7-b8c9-4d0e-8f1a-2b3c4d5e6f70",
        "name": "Personal Loan"
      },
      "currency": "NGN",
      "requestedAmount": 200000,
      "approvedAmount": 200000,
      "interestRate": 10,
      "termMonths": 12,
      "monthlyRepayment": 18333.33,
      "totalRepayable": 220000,
      "totalPaid": 40000,
      "outstandingBalance": 180000,
      "rejectionReason": null,
      "appliedAt": "2026-06-20T09:00:00.000Z",
      "approvedAt": "2026-07-01T09:00:00.000Z",
      "disbursedAt": "2026-07-02T09:00:00.000Z",
      "repaymentStartDate": "2026-08-01T00:00:00.000Z",
      "repaymentEndDate": "2027-07-01T00:00:00.000Z",
      "completedAt": null,
      "updatedAt": "2026-10-01T11:00:00.000Z"
    }
  ],
  "page": 1,
  "limit": 25,
  "total": 1,
  "hasMore": false
}

Retrieve a loan

GET/api/v1/loans/{id}
Scope: read

By id or loan number (its first 8 characters).

Parameters
idrequired
In
path
Type
string
Description
Loan id or loan number
Example request
curl "https://coopie.io/api/v1/loans/c3d9e1f2-4a5b-4c6d-8e7f-9a0b1c2d3e4f" \
  -H "Authorization: Bearer $COOPIE_API_KEY"
Example response
{
  "object": "loan",
  "id": "c3d9e1f2-4a5b-4c6d-8e7f-9a0b1c2d3e4f",
  "loanNumber": "C3D9E1F2",
  "status": "ACTIVE",
  "member": {
    "id": "6f1c2b9e-1d0a-4f5e-9b1a-2c3d4e5f6a7b",
    "memberNumber": "LAG000042"
  },
  "product": {
    "id": "d4e5f6a7-b8c9-4d0e-8f1a-2b3c4d5e6f70",
    "name": "Personal Loan"
  },
  "currency": "NGN",
  "requestedAmount": 200000,
  "approvedAmount": 200000,
  "interestRate": 10,
  "termMonths": 12,
  "monthlyRepayment": 18333.33,
  "totalRepayable": 220000,
  "totalPaid": 40000,
  "outstandingBalance": 180000,
  "rejectionReason": null,
  "appliedAt": "2026-06-20T09:00:00.000Z",
  "approvedAt": "2026-07-01T09:00:00.000Z",
  "disbursedAt": "2026-07-02T09:00:00.000Z",
  "repaymentStartDate": "2026-08-01T00:00:00.000Z",
  "repaymentEndDate": "2027-07-01T00:00:00.000Z",
  "completedAt": null,
  "updatedAt": "2026-10-01T11:00:00.000Z"
}

Events

List events

GET/api/v1/events
Scope: read

Every event, whether or not a webhook endpoint received it, newest first; kept for 90 days. Use it to catch up after your endpoint was down.

Parameters
type
In
query
Type
string
Description
Only this event type, e.g. payment.recorded
from
In
query
Type
ISO 8601 datetime
Description
Created on or after
page
In
query
Type
integer
Description
Page number, from 1 (e.g. 1)
limit
In
query
Type
integer
Description
Items per page, 1–100 (default 25) (e.g. 25)
Example request
curl "https://coopie.io/api/v1/events" \
  -H "Authorization: Bearer $COOPIE_API_KEY"
Example response
{
  "object": "list",
  "data": [
    {
      "object": "event",
      "id": "5d6e7f80-9a1b-4c2d-8e3f-4a5b6c7d8e9f",
      "type": "payment.recorded",
      "livemode": false,
      "apiVersion": "2026-10-24",
      "createdAt": "2026-10-24T11:02:13.000Z",
      "data": {
        "object": {
          "object": "transaction",
          "id": "0b8f5c2e-7a61-4e0b-b0b9-5b1f0c3e9d21",
          "reference": "REC-3F9A1C2B7D4E5F60",
          "externalReference": "PAYROLL-2026-10",
          "type": "CREDIT",
          "category": "CONTRIBUTION",
          "amount": 10000,
          "currency": "NGN",
          "status": "COMPLETED",
          "method": "PAYROLL_DEDUCTION",
          "description": "Contribution — Adaeze Okafor",
          "member": {
            "id": "6f1c2b9e-1d0a-4f5e-9b1a-2c3d4e5f6a7b",
            "memberNumber": "LAG000042"
          },
          "service": {
            "id": "a2e4c6f8-0b1d-4f3a-8c5e-7d9f1b3d5f7a",
            "name": "Monthly Savings"
          },
          "loanId": null,
          "reverses": null,
          "effectiveDate": "2026-10-24T11:00:00.000Z",
          "createdAt": "2026-10-24T11:02:13.000Z",
          "updatedAt": "2026-10-24T11:02:13.000Z"
        }
      }
    }
  ],
  "page": 1,
  "limit": 25,
  "total": 1,
  "hasMore": false
}

Retrieve an event

GET/api/v1/events/{id}
Scope: read

By id (the Coopie-Event-Id header of a webhook).

Parameters
idrequired
In
path
Type
string
Description
Event id
Example request
curl "https://coopie.io/api/v1/events/5d6e7f80-9a1b-4c2d-8e3f-4a5b6c7d8e9f" \
  -H "Authorization: Bearer $COOPIE_API_KEY"
Example response
{
  "object": "event",
  "id": "5d6e7f80-9a1b-4c2d-8e3f-4a5b6c7d8e9f",
  "type": "payment.recorded",
  "livemode": false,
  "apiVersion": "2026-10-24",
  "createdAt": "2026-10-24T11:02:13.000Z",
  "data": {
    "object": {
      "object": "transaction",
      "id": "0b8f5c2e-7a61-4e0b-b0b9-5b1f0c3e9d21",
      "reference": "REC-3F9A1C2B7D4E5F60",
      "externalReference": "PAYROLL-2026-10",
      "type": "CREDIT",
      "category": "CONTRIBUTION",
      "amount": 10000,
      "currency": "NGN",
      "status": "COMPLETED",
      "method": "PAYROLL_DEDUCTION",
      "description": "Contribution — Adaeze Okafor",
      "member": {
        "id": "6f1c2b9e-1d0a-4f5e-9b1a-2c3d4e5f6a7b",
        "memberNumber": "LAG000042"
      },
      "service": {
        "id": "a2e4c6f8-0b1d-4f3a-8c5e-7d9f1b3d5f7a",
        "name": "Monthly Savings"
      },
      "loanId": null,
      "reverses": null,
      "effectiveDate": "2026-10-24T11:00:00.000Z",
      "createdAt": "2026-10-24T11:02:13.000Z",
      "updatedAt": "2026-10-24T11:02:13.000Z"
    }
  }
}

API console

Send real requests to https://coopie.io/api/v1 from your browser. Use a test key unless you mean to change real data.

Webhooks

Webhooks tell your server the moment something happens in your cooperative, so you don’t have to poll. Coopie sends an HTTP POST with a JSON event to each endpoint subscribed to that event type.

Add an endpoint

  1. In the dashboard, open Developers → Webhooks and choose Test or Live.
  2. Add the endpoint’s URL and pick the events it should receive (or all of them).
  3. Copy its signing secret (whsec_…), shown once, into your server’s configuration.
  4. Use Send test event to deliver a webhook.ping event and check your handler answers 2xx.

Live endpoints must use https://. Test endpoints may use plain http://, but every endpoint must be reachable on the public internet: to receive events on your laptop, expose it with a tunnel such as ngrok. Test events only go to test endpoints, and live events only to live endpoints.

The payload

Every event has the same envelope. data.object is the API object as it is now (the same shape the API returns); *.updated events also carry data.previousAttributes with the old values of the fields that changed.

payment.recorded
{
  "object": "event",
  "id": "5d6e7f80-9a1b-4c2d-8e3f-4a5b6c7d8e9f",
  "type": "payment.recorded",
  "livemode": true,
  "apiVersion": "2026-10-24",
  "createdAt": "2026-10-24T11:02:13.000Z",
  "data": {
    "object": {
      "object": "transaction",
      "id": "0b8f5c2e-7a61-4e0b-b0b9-5b1f0c3e9d21",
      "reference": "REC-3F9A1C2B7D4E5F60",
      "externalReference": "PAYROLL-2026-10",
      "type": "CREDIT",
      "category": "CONTRIBUTION",
      "amount": 10000,
      "currency": "NGN",
      "status": "COMPLETED",
      "method": "PAYROLL_DEDUCTION",
      "description": "Contribution — Adaeze Okafor",
      "member": {
        "id": "6f1c2b9e-1d0a-4f5e-9b1a-2c3d4e5f6a7b",
        "memberNumber": "LAG000042"
      },
      "service": {
        "id": "a2e4c6f8-0b1d-4f3a-8c5e-7d9f1b3d5f7a",
        "name": "Monthly Savings"
      },
      "loanId": null,
      "reverses": null,
      "effectiveDate": "2026-10-24T11:00:00.000Z",
      "createdAt": "2026-10-24T11:02:13.000Z",
      "updatedAt": "2026-10-24T11:02:13.000Z"
    }
  }
}
member.updated
{
  "object": "event",
  "id": "e1f2a3b4-c5d6-4e7f-8a9b-0c1d2e3f4a5b",
  "type": "member.updated",
  "livemode": true,
  "apiVersion": "2026-10-24",
  "createdAt": "2026-10-24T12:00:00.000Z",
  "data": {
    "object": {
      "object": "member",
      "id": "6f1c2b9e-1d0a-4f5e-9b1a-2c3d4e5f6a7b",
      "status": "SUSPENDED",
      "…": "…"
    },
    "previousAttributes": {
      "status": "ACTIVE"
    }
  }
}

Headers

Content-Type
Value
application/json
Coopie-Signature
Value
t=<unix seconds>,v1=<hex HMAC-SHA256>. Verify it (below).
Coopie-Event-Id
Value
The event's id. Dedupe on this.
Coopie-Event-Type
Value
e.g. payment.recorded
Coopie-Delivery-Id
Value
This delivery attempt's id; quote it to support
User-Agent
Value
Coopie-Webhooks/1.0 (+https://coopie.io/developers)

Event types

member.created
When it fires
A member joined: accepted an invitation, or was added
member.updated
When it fires
A member's details or status changed (e.g. suspended, reactivated)
payment.recorded
When it fires
Money was credited: a contribution or loan repayment was recorded (dashboard, upload, API or online payment)
payment.reversed
When it fires
A recorded payment was reversed
loan.applied
When it fires
A member applied for a loan
loan.approved
When it fires
A loan application was approved
loan.rejected
When it fires
A loan application was rejected
loan.disbursed
When it fires
An approved loan was paid out to the member
loan.repaid
When it fires
A loan was repaid in full
loan.defaulted
When it fires
A loan was marked defaulted for missed repayments
loan.written_off
When it fires
A loan's remaining balance was written off
withdrawal.requested
When it fires
A member asked to withdraw savings
withdrawal.completed
When it fires
A savings withdrawal was paid out
withdrawal.rejected
When it fires
A savings withdrawal request was rejected

webhook.ping is sent only by Send test event; endpoints can’t subscribe to it.

Responding, retries and ordering

  • Any 2xx status within 10 seconds is a success. Anything else, a timeout or a redirect (redirects aren’t followed) is a failure.
  • Respond quickly and do the work afterwards: put the event on a queue, answer 200, then process it.
  • Failed deliveries are retried with exponential backoff, up to 12 attempts over roughly three days.
  • If 5 events in a row run out of retries, the endpoint is turned off and your admins can see why under Developers → Webhooks. Fix it, turn it back on, and catch up on what you missed with the events API.
  • Delivery is at least once: the same event can arrive twice (for example when your server answered too slowly). Record each Coopie-Event-Id you’ve handled and skip repeats.
  • Events can arrive out of order. Use createdAt, or fetch the object from the API, when order matters.

Catching up

Every event is kept for 90 days whether or not an endpoint received it. After an outage, list what you missed and process anything you haven’t seen:

curl
curl "https://coopie.io/api/v1/events?from=2026-10-23T00:00:00Z&limit=100" \
  -H "Authorization: Bearer $COOPIE_API_KEY"

Verifying signatures

Check every request’s Coopie-Signature header before trusting it, so nobody else can post fake events to your endpoint:

Coopie-Signature
Coopie-Signature: t=1793271733,v1=5257a869e7ecebeda32affa62cdca3fa51cad7e77a0e56ff536d0ce8e108d8bd
  1. Split the header on , and each part on the first =: t is the Unix time it was signed, v1 the signature.
  2. Compute HMAC-SHA256 of <t>.<raw body> (the timestamp, a dot, then the request body exactly as received), using the endpoint’s whole secret including the whsec_ prefix as the key, and hex-encode it.
  3. Compare it with v1 using a constant-time comparison.
  4. Reject the request if t is more than 300 seconds from your clock, so a captured request can’t be replayed later.
Verify against the raw body. Parsing the JSON and serializing it again changes the bytes and the signature won’t match.
server.js (Express)
// npm install express
const crypto = require("crypto");
const express = require("express");

const SECRET = process.env.COOPIE_WEBHOOK_SECRET; // the endpoint's whsec_… secret
const TOLERANCE_SEC = 300;

function verify(rawBody, header) {
  const parts = {};
  for (const pair of (header || "").split(",")) {
    const i = pair.indexOf("=");
    if (i > 0) parts[pair.slice(0, i).trim()] = pair.slice(i + 1).trim();
  }
  const t = Number(parts.t);
  if (!Number.isInteger(t) || Math.abs(Date.now() / 1000 - t) > TOLERANCE_SEC) {
    return false; // missing, malformed or too old: possibly a replay
  }
  const expected = crypto
    .createHmac("sha256", SECRET)
    .update(parts.t + ".")
    .update(rawBody) // the exact bytes received, not re-serialized JSON
    .digest("hex");
  const given = parts.v1 || "";
  return (
    given.length === expected.length &&
    crypto.timingSafeEqual(Buffer.from(given), Buffer.from(expected))
  );
}

const app = express();

// express.raw keeps the body as a Buffer; express.json() would break the signature.
app.post("/webhooks/coopie", express.raw({ type: "application/json" }), (req, res) => {
  if (!verify(req.body, req.get("Coopie-Signature"))) {
    return res.status(400).send("Invalid signature");
  }
  const event = JSON.parse(req.body.toString("utf8"));
  res.sendStatus(200); // answer fast, then work
  queue.add(event); // your job queue: skip event.id if you've already handled it
});

app.listen(3001);

Changelog

2026-10-24Initial release

Members, balances, services, transactions (including batch payment recording), loans and events; test mode with a sandbox cooperative; idempotency keys; signed webhooks for member, payment, loan and withdrawal events.

Questions or something missing? See the Help Center.