---
title: "reports__getSalesByClient"
method: GET
path: "/tools/reports__getSalesByClient"
tags: ["Reports"]
---

# reports__getSalesByClient

`GET /tools/reports__getSalesByClient`

Obtiene una lista de clientes con sus datos de compras/transacciones. Muestra las métricas de compra de cada cliente

## Request body

- object
  - `from` string, date, required — Fecha inicio (YYYY-MM-DD)
  - `to` string, date, required — Fecha fin (YYYY-MM-DD)
  - `start` string, required — Offset de paginación
  - `limit` string, required — Cantidad de clientes devueltos por llamada. Por defecto 10.
  - `optionalParams` object, nullable — Opcional. Envía un objeto (no un texto con JSON escapado).<br>• clientName — deja solo el cliente cuyo nombre coincida<br>• order_field — ordenar por totalDocuments, subTotal o total<br>• order_direction — ASC o DESC; úsalo junto con order_field
    - `clientName` string — Filtrar por nombre de cliente.
    - `order_direction` 'ASC' | 'DESC' — Dirección de orden (junto con order_field).
    - `order_field` 'totalDocuments' | 'subTotal' | 'total' — Campo de orden (totalDocuments, subTotal, total).

## Response `200`

Lista de clientes con sus compras

## Other responses

- `401` — No autorizado

---

[API](https://skmtc.net/alegra/apis/ingresos.md) · [All operations](https://skmtc.net/alegra/apis/ingresos/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/alegra/ingresos/revisions/cd52d3f68f1b/schema)
