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

# Query stats on carts

`POST /carts/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": "order.total_amount_cents",
        "operator": "stats"
    }
}`

## Response `200`

The stats result from carts

---

[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)
