---
title: "Preview Metric Results"
method: POST
path: "/v2/reporting/metrics/preview"
tags: ["Reporting"]
---

# Preview Metric Results

`POST /v2/reporting/metrics/preview`

Executes a metric calculation on the fly without saving it to the database. Useful for testing parameters or ad-hoc analysis.

## Request body

- PreviewMetricRequest — Request to preview a metric calculation without saving
  - `template` 'GROSS_VOLUME' | 'TRANSACTION_COUNT' | 'NEW_USERS', required — Metric template name
  - `params` MetricParams, required — Metric parameters. Structure varies by template, but common fields include: - Date range filters - Calculation interval - Breakdown dimensions - Template-specific filters Additional properties may be present based on the metric template. Each template may define template-specific parameters.
    - `createdAfter` string, date — Filter transactions created after this date (ISO 8601)
    - `createdBefore` string, date — Filter transactions created before this date (ISO 8601)
    - `calculationInterval` 'day' | 'week' | 'month' — Time interval for aggregation
    - `userIds` string[] — Filter by specific user IDs
    - `transactionTypes` string[] — Filter by transaction types
    - `transactionStatuses` string[] — Filter by transaction statuses
    - `breakdowns` string[] — Dimensions to group results by. Maximum 2 breakdowns allowed. Field names in response data will match these dimension names.
    - `limit` integer — Maximum number of records to return

## Response `200`

Metric calculation results

- MetricCalculationResponse — Response from metric calculation endpoints. The structure of `data` array items varies based on the `breakdowns` parameter in the request. **Base structure (no breakdowns):** - Each item has: `periodStart`, plus metric-specific fields (e.g., `grossVolume`, `transactionCount`) **With breakdowns:** - Each item includes breakdown dimension fields (e.g., `transactionType`, `transactionStatus`, `userId`) - Field names match the breakdown dimension names from the request **Example without breakdowns:**

## Other responses

- `400` — Bad request - validation error
- `401` — Unauthorized
- `404` — Resource not found
- `500` — Internal Server Error

---

[API](https://skmtc.net/hifi/apis/hifi-api.md) · [All operations](https://skmtc.net/hifi/apis/hifi-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/hifi/hifi-api/revisions/15a39c342fd1/schema)
