Skip to main content
POST
/
v2
/
reporting
/
metrics
/
preview
curl --request POST \
  --url https://production.hifibridge.com/v2/reporting/metrics/preview \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "template": "GROSS_VOLUME",
  "params": {
    "createdAfter": "2025-11-01",
    "createdBefore": "2025-11-07",
    "calculationInterval": "day",
    "transactionDirections": [
      "onramp",
      "offramp"
    ]
  }
}
'
{
"status": "success",
"data": [
{
"periodStart": "2025-11-06",
"grossVolume": 0
},
{
"periodStart": "2025-11-05",
"grossVolume": 0
},
{
"periodStart": "2025-11-04",
"grossVolume": 0
},
{
"periodStart": "2025-11-03",
"grossVolume": 0
},
{
"periodStart": "2025-11-02",
"grossVolume": 0
},
{
"periodStart": "2025-11-01",
"grossVolume": 0
}
],
"metadata": {
"template": "GROSS_VOLUME",
"recordCount": 6,
"projectedRowCount": null,
"filledCount": 6,
"calculationInterval": "day",
"dateRange": {
"start": "2025-11-01",
"end": "2025-11-07"
},
"filters": {
"createdAfter": {
"applied": "subset",
"specified": true,
"values": "2025-11-01"
},
"createdBefore": {
"applied": "subset",
"specified": true,
"values": "2025-11-07"
},
"calculationInterval": {
"applied": "subset",
"specified": true,
"values": "day"
},
"transactionDirections": {
"applied": "subset",
"specified": true,
"count": 2,
"values": [
"onramp",
"offramp"
]
},
"userIds": {
"applied": "all",
"specified": false,
"count": 1000,
"note": "1000 total (list omitted for brevity)"
}
},
"breakdowns": null
}
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json

Request to preview a metric calculation without saving

template
enum<string>
required

Metric template name

Available options:
GROSS_VOLUME,
TRANSFERS,
NEW_CUSTOMERS
params
object
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.

Response

Metric calculation results

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, transferCount)

With breakdowns:

  • Each item includes breakdown dimension fields (e.g., transactionDirection, transferStatus, userId)
  • Field names match the breakdown dimension names from the request

Example without breakdowns:

{
"status": "success",
"data": [
{ "periodStart": "2025-01-01T00:00:00Z", "grossVolume": 1000.50 },
{ "periodStart": "2025-01-02T00:00:00Z", "grossVolume": 2000.75 }
],
"metadata": { ... }
}

Example with breakdowns: ["transactionDirection"]:

{
"status": "success",
"data": [
{ "periodStart": "2025-01-01T00:00:00Z", "transactionDirection": "onramp", "grossVolume": 500.25 },
{ "periodStart": "2025-01-01T00:00:00Z", "transactionDirection": "offramp", "grossVolume": 500.25 }
],
"metadata": { ... }
}
status
enum<string>

Response status

Available options:
success
data
object[]

Array of metric calculation results. Each object structure depends on:

  1. The metric template (determines metric value fields)
  2. The breakdowns parameter (adds dimension fields)
metadata
object

Metadata about the metric calculation