# Metrics API

## Getting started

- [Welcome to Metrics API](/metrics/welcome.md): Why a Metrics API by Commerce Layer and how to get started with it
- [API specification](/metrics/getting-started/api-specification.md): Basic info about endpoints and access tokens, request types and headers, payload and response structure
- [Queries](/metrics/getting-started/queries.md): All the available Commerce Layer Metrics API query types and the supported operators
- [Breakdown](/metrics/getting-started/queries/breakdown.md): How to perform a breakdown query and how it works
- [Date breakdown](/metrics/getting-started/queries/date-breakdown.md): How to perform a date breakdown query and how it works
- [Stats](/metrics/getting-started/queries/stats.md): How to perform a stats query and how it works
- [Search](/metrics/getting-started/queries/search.md): How to perform a search query and how it works
- [Filters](/metrics/getting-started/filters.md): How you can filter the query results by date or any other available field
- [Analysis](/metrics/getting-started/analysis.md): All the available Commerce Layer Metrics API helper endpoints
- [FBT](/metrics/getting-started/analysis/fbt.md): How to perform an FBT query and how it works
- [Errors](/metrics/getting-started/errors.md): The complete list of response codes you can get, how the errors object is structured, and all the information about rate limits
- [Use cases](/metrics/getting-started/use-cases.md): A list of the most common application scenarios of Commerce Layer Metrics API
- [Orders by currency](/metrics/getting-started/use-cases/orders-by-currency.md): How to use the Metrics API to get the total number of orders of your organization, grouped by different currencies
- [Orders by status and payment status](/metrics/getting-started/use-cases/orders-by-status-and-payment-status.md): How to use the Metrics API to get the total number of orders of your organization, grouped by their status and the related payment status
- [Orders by repeat customer](/metrics/getting-started/use-cases/orders-by-repeat-customer.md): How to use the Metrics API to get the total number of orders of your organization, grouped by customers that bought from you more than once
- [Orders by bundle](/metrics/getting-started/use-cases/orders-by-bundle.md): How to use the Metrics API to get the total number of orders containing a bundle, grouped by  the bundle name
- [Orders by shipment status and shipping method name](/metrics/getting-started/use-cases/orders-by-shipment-status-and-shipping-method-name.md): How to use the Metrics API to get the total number of orders of your organization, grouped by the associated shipment status and the related shipping method name
- [Orders paid with gift cards](/metrics/getting-started/use-cases/orders-paid-with-gift-cards.md): How to use the Metrics API to get the total number of orders that were paid using a gift card
- [Orders associated with a specific promotion](/metrics/getting-started/use-cases/orders-associated-with-a-specific-promotion.md): How to use the Metrics API to get the total number of orders that triggered a specific promotion
- [Number of products per order by country](/metrics/getting-started/use-cases/number-of-products-per-order-by-country.md): How to use the Metrics API to get mixed stats about the number of SKUs included in the orders of your organization, grouped by different countries
- [Best-selling products by market](/metrics/getting-started/use-cases/best-selling-products-by-market.md): How to use the Metrics API to get the Top 5 best-selling products for each of your organization's market
- [Customers that bought a specific product](/metrics/getting-started/use-cases/customers-that-bought-a-specific-product.md): How to use the Metrics API to get the total number of customers that bought a specific product or bundle
- [Shipments average time in picking](/metrics/getting-started/use-cases/shipments-average-time-in-picking.md): How to use the Metrics API to get the average time your shipments stay in picking status before being packed
- [Top 10 spenders by currency](/metrics/getting-started/use-cases/top-10-spenders-by-currency.md): How to use the Metrics API to get the Top 10 spenders among your customers and know how their total purchase amount is divided by currency.
- [Orders by day](/metrics/getting-started/use-cases/orders-by-day.md): How to use the Metrics API to get the total number of orders of your organization, grouped by day
- [Returns per year by destination city](/metrics/getting-started/use-cases/returns-per-year-by-destination-city.md): How to use the Metrics API to get the total number of returns requested for your orders, grouped by year and destination city
- [Refunds by country and currency](/metrics/getting-started/use-cases/refunds-by-country-and-currency.md): How to use the Metrics API to get the total number of refunds of your organization, grouped by the different countries and currencies
- [Latest carts with a specific product from a specific market](/metrics/getting-started/use-cases/last-carts-with-a-specific-product-from-a-specific-market.md): How to use the Metrics API to get the most recently created carts containing a specific SKU, from a specific market
- [Orders by resource error code and message](/metrics/getting-started/use-cases/orders-by-resource-error-code-and-message.md): How to use the Metrics API to check the errors associated with the orders of your organization (if any) .
- [Latest archived orders](/metrics/getting-started/use-cases/latest-archived-orders.md): How to use the Metrics API to get the most recently archived orders
- [Latest placed orders from customers with specific email domains](/metrics/getting-started/use-cases/latest-placed-orders-from-customers-with-specific-email-domains.md): How to use the Metrics API to get the last placed orders containing specific email domains in the aggregated details
- [Frequently bought together products](/metrics/getting-started/use-cases/frequently-bought-together-products.md): How to use the Metrics API to get the products that have been most frequently bought together with other ones

## API reference

- [Introduction](/metrics/api-reference-m/readme.md): A detailed list of all the resources on which you can do statistics using Commerce Layer Metrics API
- [Orders](/metrics/api-reference-m/resources/orders.md): A comprehensive list of the order resource's fields and attributes
- [Breakdown](/metrics/api-reference-m/resources/orders/breakdown.md): A comprehensive list of the breakdown query keys, allowed fields values, and operators for the order resource
- [Date breakdown](/metrics/api-reference-m/resources/orders/date-breakdown.md): A comprehensive list of the date breakdown query keys, allowed fields values, and operators for the order resource
- [Stats](/metrics/api-reference-m/resources/orders/stats.md): A comprehensive list of the stats query keys, allowed fields values, and operators for the order resource
- [Search](/metrics/api-reference-m/resources/orders/search.md): A comprehensive list of the search query keys and allowed fields values for the order resource
- [Filters](/metrics/api-reference-m/resources/orders/filters.md): A comprehensive list of the allowed fields values you can use to filter the results of the queries on the order resource
- [Examples](/metrics/api-reference-m/resources/orders/examples.md): How to perform Metrics API queries on the order resource
- [Returns](/metrics/api-reference-m/resources/returns.md): A comprehensive list of the return resource's fields and attributes
- [Breakdown](/metrics/api-reference-m/resources/returns/breakdown.md): A comprehensive list of the breakdown query keys, allowed fields values, and operators for the return resource
- [Date breakdown](/metrics/api-reference-m/resources/returns/date-breakdown.md): A comprehensive list of the date breakdown query keys, allowed fields values, and operators for the return resource
- [Stats](/metrics/api-reference-m/resources/returns/stats.md): A comprehensive list of the stats query keys, allowed fields values, and operators for the return resource
- [Search](/metrics/api-reference-m/resources/returns/search.md): A comprehensive list of the search query keys and allowed fields values for the return resource
- [Filters](/metrics/api-reference-m/resources/returns/filters.md): A comprehensive list of the allowed fields values you can use to filter the results of the queries on the return resource
- [Examples](/metrics/api-reference-m/resources/returns/examples.md): How to perform Metrics API queries on the return resource
- [Carts](/metrics/api-reference-m/resources/carts.md): A comprehensive list of the cart resource's fields and attributes
- [Breakdown](/metrics/api-reference-m/resources/carts/breakdown.md): A comprehensive list of the breakdown query keys, allowed fields values, and operators for the cart resource
- [Date breakdown](/metrics/api-reference-m/resources/carts/date-breakdown.md): A comprehensive list of the date breakdown query keys, allowed fields values, and operators for the cart resource
- [Stats](/metrics/api-reference-m/resources/carts/stats.md): A comprehensive list of the stats query keys, allowed fields values, and operators for the cart resource
- [Search](/metrics/api-reference-m/resources/carts/search.md): A comprehensive list of the search query keys and operators for the cart resource
- [Filters](/metrics/api-reference-m/resources/carts/filters.md): A comprehensive list of the allowed fields values you can use to filter the results of the queries on the cart resource
- [Examples](/metrics/api-reference-m/resources/carts/examples.md): How to perform Metrics API queries on the cart resource
