Report on purchase spend
Admin, branch manager, or auditor. Returns batch spend grouped by supplier and medicine. The window defaults to the last thirty days, and a branch_id scopes it to one branch.
GET
/api/v1/reports/purchasesAuthorization
AuthorizationBearer token (JWT) · headerrequiredJWT from POST /api/v1/auth/login sent as Authorization Bearer.
Query parameters
from_datestringFirst day of the window, YYYY-MM-DD. Defaults to thirty days ago.
to_datestringLast day of the window, YYYY-MM-DD. Defaults to today.
branch_idstringScope the report to one branch. Empty reports every branch together.
Responses
200
The purchase report
from_datestringrequiredto_datestringrequiredtotal_spendstringrequiredby_supplierobject[]requiredShow propertiesHide properties
Array of
objectsupplier_namestring | nullrequiredbatch_countintegerrequiredmin -9007199254740991 · max 9007199254740991
total_spendstringrequiredby_medicineobject[]requiredShow propertiesHide properties
Array of
objectmedicine_namestring | nullrequiredbatch_countintegerrequiredmin -9007199254740991 · max 9007199254740991
total_unitsintegerrequiredmin -9007199254740991 · max 9007199254740991
total_spendstringrequired400
from_date or to_date is not a valid YYYY-MM-DD date, or from_date is after to_date
detailstringrequired401
Not authenticated
detailstringrequired403
Caller is not an admin, branch manager, or auditor
detailstringrequired