---
title: "Klientet kryesore"
operation_id: "api.v1.reports.top-clients"
method: GET
path: "/api/v1/reports/top-clients"
group: "Raportet"
api_version: "v1"
authenticated: true
canonical: "https://fature.al/api-reference/endpoints/api-v1-reports-top-clients.html"
---

# Klientet kryesore

Part of the [fature.al API](/api-reference/index.html) documentation.

## GET /api/v1/reports/top-clients

Klientet e renditur sipas vleres se faturuar ne periudhe.

`limit` pranon nga `1` deri ne `500`. Klientet e rastit, pra faturat pa klient te emeruar, nuk
hyjne ne renditje.     *
`from` dhe `to` jane te detyrueshme, ne formatin `YYYY-MM-DD`, dhe periudha kthehet e
konfirmuar ne `period` te pergjigjes.

Full URL: `https://fature.al/api/v1/reports/top-clients`

API version: `v1`.

Authentication: required (bearer token).

### Example request

```bash
curl -X GET 'https://fature.al/api/v1/reports/top-clients' \
  -H 'Authorization: Bearer YOUR_TOKEN' \
  -H 'X-Client-Id: YOUR_CLIENT_ID' \
  -H 'X-Client-Secret: YOUR_CLIENT_SECRET' \
  -H 'Accept: application/json'
```

### Responses

**200** — OK

| Field | Type | Description |
| --- | --- | --- |
| `status` | boolean |  |
| `data` | object |  |
| `data.period` | object |  |
| `data.period.from` | string | Start date (YYYY-MM-DD), inclusive |
| `data.period.to` | string | End date (YYYY-MM-DD), inclusive |
| `data.limit` | integer |  |
| `data.items` | array |  |
| `data.items[].id_client` | integer, nullable |  |
| `data.items[].name` | string |  |
| `data.items[].nipt` | string, nullable |  |
| `data.items[].invoices` | integer |  |
| `data.items[].gross` | number |  |

```json
{
    "status": true,
    "data": {
        "period": {
            "from": "from",
            "to": "to"
        },
        "limit": 25,
        "items": [
            {
                "id_client": 1,
                "name": "Jane Doe",
                "nipt": "nipt",
                "invoices": 1,
                "gross": 19.99
            }
        ]
    }
}
```

**422** — Datat mungojne ose nuk jane ne formatin YYYY-MM-DD.

| Field | Type | Description |
| --- | --- | --- |
| `success` | boolean | Always false |
| `message` | string | A single summary line, the same for every validation failure |
| `errors` | object | The failing fields, each with the messages for it. Dotted keys point into nested objects and array items, e.g. `lines.0.quantity` |

```json
{
    "success": true,
    "message": "Hello there",
    "errors": []
}
```

**429** — Kufiri i kerkesave u arrit: 30 raporte ne minute.

| Field | Type | Description |
| --- | --- | --- |
| `status` | boolean | Always false. A successful response carries `status: true` and a `data` object instead |
| `message` | string | The exception message. Empty when the failure carries no exception of its own |
| `errors` | array | Messages to show the operator or to log. Absent when the failure has nothing to add beyond `message` |

```json
{
    "status": true,
    "message": "Hello there",
    "errors": [
        "errors"
    ]
}
```
