---
title: "Get Sales Report"
method: GET
path: "/api/reports/sales"
tags: ["Reports"]
---

# Get Sales Report

`GET /api/reports/sales`

Closed sales for the dashboard's map and the listing beside it.

"Closed sale" here is `Viatura.fechado = 1` AND `Contratos.IDestado = 2` —
a car actually sold on a closed contract, both flags written atomically by
`close_vehicle_with_contract`. It is NOT the CRM's "lead ganha": a lead
cannot be won without a contract, but plenty of sales (walk-ins, imported
history) never had a lead at all, and those are sales too.

Takes the dashboard's own filters (year, month, PV, team), all multi-select
and all "empty means everything".

Returns `{items, summary}`. **Nothing is filtered out** — a sale whose buyer
has no readable postal code is still a sale; it lands in the "Desconhecido"
bucket, appears in the listing, and is counted in the totals (and in
`summary.sem_localizacao`). Hiding it would make this card disagree with
the sales figures on the rest of the dashboard.

Not cached — same reason as the `/detail` endpoints above: `items` is an
unbounded `fetchall()` and a large entry evicts the auth cache.

## Query parameters

- `ano` integer[]
- `mes` integer[]
- `ponto_venda_id` integer[]
- `team_id` integer[]

## Headers

- `x-api-token` string, nullable

## Response `200`

Successful Response

- unknown

## Other responses

- `422` — Validation Error

## Changes

- **2026-09-26** `b65cead3236b` — 1 info
  - endpoint added

[Change history](https://skmtc.dev/multigest/apis/multigest-protected-api/changes/api/reports/sales/get.md)

---

[API](https://skmtc.dev/multigest/apis/multigest-protected-api.md) · [All operations](https://skmtc.dev/multigest/apis/multigest-protected-api/llms.txt) · [OpenAPI document](https://skmtc.dev/multigest/apis/multigest-protected-api/revisions/447243444af4?raw)
