---
search:
  tags:
    - Reports
    - GET
seo:
  description: >-
    Admin and branch manager. Returns revenue, VAT, day and payment splits, top…
    Reference for the GET /api/v1/reports/sales endpoint in the PharmaFlow API.
sidebar:
  label: Report on sales
  badge: GET
title: Report on sales
type: openapi-operation
---
Admin and branch manager. Returns revenue, VAT, day and payment splits, top sellers, sales. Gross profit uses the cost frozen on each line, so a later cost change never rewrites it.

`GET /api/v1/reports/sales`

**Responses**

- `200` — The sales 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_revenue": "string",
  "total_vat": "string",
  "total_count": -9007199254740991,
  "by_day": [
    {
      "day": "string",
      "total": "string",
      "count": -9007199254740991
    }
  ],
  "by_payment": [
    {
      "method": "string",
      "count": -9007199254740991,
      "total": "string"
    }
  ],
  "top_selling": [
    {
      "medicine_id": "string",
      "medicine_name": "string",
      "units_sold": -9007199254740991,
      "revenue": "string",
      "total_cost": "string",
      "gross_profit": "string",
      "margin_pct": 0
    }
  ],
  "recent": [
    {
      "id": "string",
      "invoice_number": "string",
      "total_amount": "string",
      "vat_amount": "string",
      "payment_method": "string",
      "sold_at": "string",
      "pharmacist_name": "string"
    }
  ]
}
```
