---
title: "Get the Sales By User report"
method: GET
path: "/public/v1/reports/sales-by-user"
tags: ["SalesByUser"]
---

# Get the Sales By User report

`GET /public/v1/reports/sales-by-user`

## Request

- Base URL: `https://app.distru.com`
- URL: `https://app.distru.com/public/v1/reports/sales-by-user`
- Auth: HTTP bearer

Returns the Sales By User leaderboard: one row per user (sales rep) with their leaderboard rank, order count, pre-tax sales, and total sales over the reported date range. Rows are always ranked by total sales and returned in that order, with the top seller at rank 1 — this ordering is fixed and cannot be changed by the caller.

This is a read-only aggregate of the orders already in your account; it creates nothing and changes no inventory, compliance, or order state. Each order is attributed to the user set as its sales rep, and the money columns are net of returns — a return lowers that rep's pre-tax and total sales. Both money columns reflect the same set of orders; `total_sales` includes tax while `sales_pre_tax` excludes it.

Scope of what is counted:
• Date range — orders are included by their order date. When `order_datetime` is omitted, the report covers the last 30 days (from the start of the day 30 days ago through the end of today), resolved in the account's time zone.
• Status — canceled orders are excluded by default. To count them, pass `CANCELED` in the `status` filter; passing `status` at all replaces the default set entirely, so list every status you want counted.
• Users — every sales rep with at least one qualifying order appears; deactivated users are omitted. Use `user_ids` to restrict the leaderboard to specific reps.

Response values mirror the report's CSV export with numeric cells returned as strings, so `leaderboard_rank`, `order_count`, and the two money columns come back as strings (currency and comma formatting stripped), matching the rest of the API. Report-level context — the resolved human-readable date range and the column definitions — is returned under `meta`.

Each row also carries `user_id`, the ID of the user it ranks, right after the `user` column, so a row can be followed to the user endpoints without a name lookup. The CSV export leaves this ID column out.

Requires the "view the sales by user report" permission on the API key's user.

## Query parameters

- `status` string[]
- `order_datetime` string
- `search` string
- `user_ids` string[]

## Response `200`

The Sales By User report

- SalesByUserReport: The Sales By User report
  - `data` SalesByUserReportRow[], required: The report rows
    - `leaderboard_rank` string, required: The user's rank by total sales within this report, starting at 1 for the top seller. Rows are always returned in this order.
    - `order_count` string, required: How many of the user's orders fall in the report's date range and status set.
    - `sales_pre_tax` string, required: The user's pre-tax sales total for the counted orders, net of returns. Excludes tax; a returned order lowers this figure.
    - `total_sales` string, required: The user's total sales for the counted orders, net of returns. Same orders as `sales_pre_tax` but including tax.
    - `user` string, required: The user's (sales rep's) name
    - `user_id` string, required: The user's ID — the `id` [GET /public/v1/users](#get-users) returns and the value `user_ids` filters on.
  - `meta` SalesByUserReportMeta, required: Report-level metadata
    - `columns` SalesByUserReportColumn[], required: Definitions for every column in each data row, in order: the `key` matches a field name on the row objects and `label` is its display name.
      - `key` string, required: The key used for this column in each data row; matches a field name on the row objects (for example `leaderboard_rank`, `sales_pre_tax`).
      - `label` string, required: The human-readable label of the column, suitable for a table header (for example `Sales (Pre-Tax)`).
    - `date_range` string, required: The resolved date range the report covers, as a human-readable label (reflects the `order_datetime` filter, or the default last-30-days window when it was omitted).
    - `report` string, required: The report identifier, always `sales_by_user`.

## Other responses

- `400`: Invalid parameters
- `401`: Missing or invalid API token
- `403`: The API token lacks the required permission, or team restrictions hide the record

## Changes

- **2026-10-07** `e8639f7dafed`: 1 info
  - added the required property `data/items/user_id` to the response with the `200` status

[Operation history](https://skmtc.dev/distru/apis/distru-api/changes/public/v1/reports/sales-by-user/get.md)

---

[API](https://skmtc.dev/distru/apis/distru-api.md) - [All operations](https://skmtc.dev/distru/apis/distru-api/llms.txt) - [OpenAPI document](https://skmtc.dev/distru/apis/distru-api/revisions/9d851a88e82f?raw)
