Skip to main content

Stock entries

Paginated production-record log for cooperative deliveries. Each entry links to a member, a product, and a cooperative, and carries quantity (kg), unit_cost, plus a server-computed estimated_value (quantity × unit_cost).

List stock entries

GET /stock-entries/

Required scope: production:read.

Request

curl -X GET \
"https://api.copa.rw/api/v1/stock-entries/?cooperative_id=73mcoo8tg&from=2026-02-01&to=2026-04-30&page_size=50" \
-H "Authorization: Bearer YOUR_API_KEY"

Query parameters

ParameterTypeDescription
cooperative_idstringOptional. Filter to one cooperative. Omit to query system-wide.
member_identity_cardstringOptional. Filter to one member's deliveries.
entry_typestringOptional. One of PRODUCTION, PURCHASE, ADJUSTMENT, RETURN, OPENING_BALANCE.
fromstringStart date (ISO YYYY-MM-DD). Defaults to 30 days ago.
tostringEnd date (ISO YYYY-MM-DD). Defaults to now.
pageintegerPage number (1-indexed).
page_sizeintegerItems per page. Default 50, max 200.
Window cap

The endpoint enforces a 90-day window cap. Requests with a wider from/to range are rejected with 400. Paginate or narrow the range for longer histories.

Response

{
"count": 66,
"next": "https://api.copa.rw/api/v1/stock-entries/?cooperative_id=73mcoo8tg&from=2026-04-01&page=2&page_size=50&to=2026-04-30",
"previous": null,
"results": [
{
"id": "48vfmtigw",
"entry_type": "PRODUCTION",
"entry_date": "2026-04-29T20:20:01.415218+02:00",
"quantity": "123.000",
"unit_cost": "400.00",
"estimated_value": "49200.00",
"product": { "id": "3hkfckqc6", "name": "Amata" },
"member": {
"id": "MEMBER_ID_PLACEHOLDER",
"identity_card": "NID_PLACEHOLDER",
"member_code": "MEMBER_CODE_PLACEHOLDER",
"full_name": "FULL_NAME_PLACEHOLDER"
},
"cooperative": { "id": "COOP_ID_PLACEHOLDER", "code": "COOP_CODE_1", "name": "Cooperative One" }
}
]
}

Fields

FieldTypeNotes
entry_typestringOne of the values listed above.
entry_datedatetimeWhen the produce was recorded.
quantitydecimal stringNet kg (or units of the product's unit_of_measure).
unit_costdecimal string | nullRWF per unit at the time of recording.
estimated_valuedecimal string | nullquantity × unit_cost. Null if either input is missing.
productobject{id, name}.
memberobject | null{id, identity_card, member_code, full_name}. Null for non-PRODUCTION entries.
cooperativeobject{id, code, name}.

Errors

StatusDescription
400Invalid date format or window exceeds the 90-day cap.
403Key does not have production:read.