---
search:
  tags:
    - Reports
    - GET
seo:
  description: >-
    Admin, branch manager, or auditor. Returns batch spend grouped by supplier…
    Reference for the GET /api/v1/reports/purchases endpoint in the PharmaFlow
    API.
sidebar:
  label: Report on purchase spend
  badge: GET
title: Report on purchase spend
type: openapi-operation
---
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/purchases`

**Responses**

- `200` — The purchase report
- `400` — from\_date or to\_date is not a valid YYYY-MM-DD date, or from\_date is after to\_date
- `401` — Not authenticated
- `403` — Caller is not an admin, branch manager, or auditor

Response example, 200:

```json
{
  "from_date": "string",
  "to_date": "string",
  "total_spend": "string",
  "by_supplier": [
    {
      "supplier_name": "string",
      "batch_count": -9007199254740991,
      "total_spend": "string"
    }
  ],
  "by_medicine": [
    {
      "medicine_name": "string",
      "batch_count": -9007199254740991,
      "total_units": -9007199254740991,
      "total_spend": "string"
    }
  ]
}
```
