Skip to main content

Members API

Look up cooperative members by National ID (NID). The same person can legitimately belong to more than one cooperative — for example, a coffee coop and a savings coop — so the canonical member endpoint returns one consolidated record per NID with a memberships[] array.

Get member by NID (aggregate)

GET /members/{nid}/

Returns every cooperative the NID belongs to, plus optional financial blocks per membership.

Required scope: members:read. Add members:financials to populate production_summary, loan_history, and savings_summary (otherwise those fields are returned as null).

Request

curl -X GET "https://api.copa.rw/api/v1/members/{NID_PLACEHOLDER}/" \
-H "Authorization: Bearer YOUR_API_KEY"

Path parameters

ParameterTypeDescription
nidstringRwandan national ID (16 digits).

Response

{
"identity_card": "NID_PLACEHOLDER",
"primary_full_name": "FULL_NAME_PLACEHOLDER",
"name_variants": ["NAME_VARIANT_1"],
"gender": "Male",
"date_of_birth": "YYYY-MM-DD",
"mobile": "PHONE_PLACEHOLDER",
"memberships": [
{
"cooperative": { "id": "COOP_ID_PLACEHOLDER", "code": "COOP_CODE_1", "name": "Cooperative One" },
"member_code": "MEMBER_CODE_PLACEHOLDER",
"full_name": "FULL_NAME_PLACEHOLDER",
"first_name": "FIRST_NAME_PLACEHOLDER",
"last_name": "LAST_NAME_PLACEHOLDER",
"role": "MEMBER",
"status": "active",
"registration_date": "YYYY-MM-DDTHH:MM:SS+00:00",
"mobile": "PHONE_PLACEHOLDER",
"production_summary": {
"window_days": 365,
"entries_count": 42,
"total_kg": "1180.500",
"last_delivery_at": "YYYY-MM-DDTHH:MM:SS+00:00"
},
"loan_history": [
{
"id": "LOAN_ID_PLACEHOLDER",
"amount": "50000.00",
"interest_rate": "5.00",
"status": "approved",
"paid_amount": "20000.00",
"loan_start_date": "YYYY-MM-DDTHH:MM:SS+00:00",
"loan_end_date": "YYYY-MM-DDTHH:MM:SS+00:00",
"approved_at": "YYYY-MM-DDTHH:MM:SS+00:00"
}
],
"savings_summary": {
"accounts_count": 1,
"total_contributions_rwf": "75000.00",
"total_withdrawals_rwf": "0.00",
"last_transaction_at": "YYYY-MM-DDTHH:MM:SS+00:00"
}
},
{
"cooperative": { "id": "COOP_ID_PLACEHOLDER_2", "code": "COOP_CODE_2", "name": "Cooperative Two" },
"member_code": "MEMBER_CODE_PLACEHOLDER_2",
"role": "MEMBER",
"status": "active",
"production_summary": null,
"loan_history": null,
"savings_summary": null
}
]
}

Top-level fields

FieldTypeDescription
identity_cardstringThe NID you queried.
primary_full_namestringName from the most recent registration.
name_variantsarray<string>All distinct full-name spellings across coops. Useful for flagging mismatches.
gender, date_of_birth, mobilestring | nullBest-effort across memberships.
membershipsarrayOne entry per cooperative the NID belongs to.

Membership fields

FieldTypeNotes
cooperativeobject{id, code, name}
member_codestringThe cooperative's own code for the member.
role, status, registration_datevaries
production_summaryobject | nullLast-365-days entries_count, total_kg, last_delivery_at. Requires members:financials.
loan_historyarray | nullLatest 10 loans with paid_amount. Requires members:financials.
savings_summaryobject | nullaccounts_count, total contributions / withdrawals, last transaction date. Requires members:financials.

Errors

StatusDescription
404No active membership found for that NID anywhere in the system.

Get member in a specific cooperative

GET /cooperatives/{coop_id}/members/{nid}/

Returns a single canonical membership when you already know which cooperative you're querying. Useful for partners that only service one coop and don't need the cross-coop view.

Required scope: members:read. members:financials unlocks the production / loans / savings blocks.

Request

curl -X GET "https://api.copa.rw/api/v1/cooperatives/{COOP_ID_PLACEHOLDER}/members/{NID_PLACEHOLDER}/" \
-H "Authorization: Bearer YOUR_API_KEY"

Response

The response is the single membership object described above (cooperative, member_code, role, status, financial blocks). Same field semantics as a single entry of memberships[] in the aggregate endpoint.

Errors

StatusDescription
404No active membership for that NID inside the supplied cooperative.

List members filtered by NID

GET /members/?identity_card={nid}

Pre-aggregation list view that returns one row per (NID × cooperative). Use the aggregate endpoint above when you want the consolidated record.

Required scope: members:read.

Request

curl -X GET "https://api.copa.rw/api/v1/members/?identity_card={NID_PLACEHOLDER}" \
-H "Authorization: Bearer YOUR_API_KEY"

Query parameters

ParameterTypeDescription
identity_cardstringFilter by NID. Optional but recommended — without it the endpoint returns every member, paginated.
pageintegerPage number.
page_sizeintegerItems per page.

Response

{
"count": 2,
"next": null,
"previous": null,
"results": [
{
"id": "MEMBER_ID_PLACEHOLDER",
"member_code": "MEMBER_CODE_PLACEHOLDER",
"full_name": "FULL_NAME_PLACEHOLDER",
"identity_card": "NID_PLACEHOLDER",
"mobile": "PHONE_PLACEHOLDER",
"gender": "Male",
"role": "MEMBER",
"status": "active",
"cooperative": { "id": "COOP_ID_PLACEHOLDER", "name": "Cooperative One", "code": "COOP_CODE_1" },
"registration_date": "YYYY-MM-DDTHH:MM:SS+00:00"
}
]
}