Custom Metrics

Custom metric value

Calculates a single store-wide custom metric for the requested date range
and returns both the raw numeric value and a store-formatted display value.
Metrics that reference non-store-wide segments are rejected.

GET /api/v1/store/custom-metrics/{metric}/value

Custom metric value

curl --request GET \
  --url 'https://{baseUrl}/api/v1/store/custom-metrics/{METRIC}/value' \
  --header 'Authorization: Bearer YOUR_SECRET_TOKEN'
{
  "data": {
    "id": 101,
    "name": "Gross Sales Metric",
    "description": "Public gross sales.",
    "format": "money",
    "decimals": 2,
    "value": 1234.5,
    "formatted_value": "$1,234.50"
  },
  "meta": {
    "start_date": "2026-02-01",
    "end_date": "2026-02-28"
  }
}

No response description.

Authorizations

  • Authorization string required header

    Generate a store API key from the store's Metorik API settings in Metorik, and choose the scopes needed for the endpoints you want to call.

Path Parameters

  • metric integer required

    The custom metric ID. Example: 101

Query Parameters

  • end_date string required

    End date in the store timezone using YYYY-MM-DD format. Example: 2026-02-28

  • start_date string required

    Start date in the store timezone using YYYY-MM-DD format. Example: 2026-02-01

Headers

  • Accept string required

    Response format header. Example: application/json

Response

application/json
  • data object
    + Show Child Attributes
    • id integer
    • name string
    • description string
    • format string
    • decimals integer
    • value number
    • formatted_value string
  • meta object
    + Show Child Attributes
    • start_date string
    • end_date string