---
title: "Query stats on returns"
method: POST
path: "/returns/stats"
tags: ["returns"]
---

# Query stats on returns

`POST /returns/stats`

Stats are aggregations that summarize your data within an operator (depending of the field, some of them could not be available), such as: value_count, cardinality, avg, min, max, sum or stats (which returns avg, min, max, sum) computed on the field specificed. When performing a stats query on the Metrics API endpoint you get in the response the value of the computation (based on the selected operator) on the selected field.

Stats request

`{
	 "stats": {
        "field": "return_line_items.line_item_total_amount",
        "operator": "stats"
    }
}`

## Response `200`

The stats result from returns

---

[API](https://skmtc.dev/commercelayer/apis/commerce-layer-metrics-api.md) · [All operations](https://skmtc.dev/commercelayer/apis/commerce-layer-metrics-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/commercelayer/commerce-layer-metrics-api/revisions/01043d675bc3/schema)
