# Top customers by spend
Source: https://docs.lomi.africa/api/customers/CustomersController_topBySpend

Top customers by spend

***

title: "Top customers by spend"
description: "Top customers by spend"
full: true
method: get
path: /customers/top
operationId: CustomersController\_topBySpend
--------------------------------------------

## Overview

Top customers by spend

Ranks customers by completed payment volume already converted into the organization currency. Card checkouts in EUR or USD are included.

### When to use this

Use when you need who spent the most. Do not add transaction or checkout amounts across currencies.

### See also

[List transactions](/api/transactions/TransactionsController_findAll)

## Authentication

Merchant routes require an API key in the `X-API-KEY` header (see [Integration overview](/api)). Use a **test** key against `https://sandbox.api.lomi.africa` and a **live** key against `https://api.lomi.africa`.

## Endpoint

`GET /customers/top`

Base URLs:

* `https://sandbox.api.lomi.africa`
* `https://api.lomi.africa`

## Request

### Path parameters

*No path parameters beyond the URL pattern.*

### Query parameters

| Name    | Required | Schema | Description                           |
| ------- | -------- | ------ | ------------------------------------- |
| `limit` | No       | number | How many customers to return (max 50) |

### Headers

| Name           | In     | Required | Schema | Description                                                                                                                                          |
| -------------- | ------ | -------- | ------ | ---------------------------------------------------------------------------------------------------------------------------------------------------- |
| `Lomi-Account` | header | No       | -      | Optional lomi. Network account id (`acct_...`). When present, the API key acts as the Operator and the request targets the connected Member Account. |

## Responses

| Status | Description                          |
| ------ | ------------------------------------ |
| `200`  | Customers ordered by converted spend |
| `401`  | Invalid or missing API key           |

## Errors

Errors follow the standard JSON error format (status code and machine-readable message). **401** indicates a missing or invalid key.

## Example

```bash
curl -sS -X GET "https://sandbox.api.lomi.africa/customers/top?limit=10" \
  -H "X-API-KEY: $LOMI_SECRET_KEY"
```

## OpenAPI

* **operationId**: `CustomersController_topBySpend`
* **Operation**: `GET /customers/top`

Full schemas and **Try it**: [API reference](/api). Machine-readable contract: repo `apps/docs/openapi.json`.
