Analytics Routing Stats
August 3, 2026 ยท View on GitHub
Use case
Returns connector share, rule hits, score filters, and routing-stat chart data for the Analytics page.
Authentication
Protected. Send either Authorization: Bearer <jwt_token> or x-api-key: <api_key>. In sandbox, also send x-feature: decision-engine.
For local development, start with:
export BASE_URL=http://localhost:8080
export AUTH_HEADER="Authorization: Bearer <jwt_token>"
export TENANT_HEADER="x-tenant-id: public"
# Sandbox only:
# export BASE_URL=https://sandbox.hyperswitch.io
# export FEATURE_HEADER="x-feature: decision-engine"
Request
- Method and path:
GET /analytics/routing-stats - Parameters:
x-tenant-id(header, required, string) โ see Environment setup.range(query, optional, string)start_ms(query, optional, integer)end_ms(query, optional, integer)page(query, optional, integer)page_size(query, optional, integer)payment_method_type(query, optional, string)payment_method(query, optional, string)card_network(query, optional, string)card_is_in(query, optional, string)currency(query, optional, string)country(query, optional, string)auth_type(query, optional, string)gateway(query, optional, string)payment_id(query, optional, string)request_id(query, optional, string)route(query, optional, string)status(query, optional, string)flow_type(query, optional, string)routing_approach(query, optional, string)exclude_routing_approach(query, optional, string)error_code(query, optional, string)
- Body: Optional query parameters include
range,gateway,payment_method_type,payment_method,country, androuting_approach.
Example
Routing stats
curl "$BASE_URL/analytics/routing-stats?range=1d&payment_method_type=CARD" \
--header "$AUTH_HEADER" \
--header "$TENANT_HEADER"
Response
{
"merchant_id": "merchant_demo",
"range": "1d",
"gateway_share": [
{ "bucket_ms": 1808624000000, "gateway": "adyen", "count": 7 },
{ "bucket_ms": 1808624000000, "gateway": "stripe", "count": 3 }
],
"top_rules": [
{ "rule_name": "priority rule", "count": 12 }
],
"sr_trend": [
{
"bucket_ms": 1808624000000,
"merchant_id": "merchant_demo",
"payment_method_type": "CARD",
"payment_method": "CREDIT",
"gateway": "adyen",
"score_value": 0.831
}
],
"available_filters": {
"dimensions": [
{ "key": "payment_method_type", "label": "Payment Method Type", "values": ["CARD"] },
{ "key": "payment_method", "label": "Payment Method", "values": ["CREDIT", "DEBIT"] }
],
"missing_dimensions": [],
"gateways": ["adyen", "stripe"]
}
}
Notes
- Analytics reads are ClickHouse-backed and merchant-scoped by the authenticated context.
- Use
range=15m|1h|12h|1d|1worstart_msplusend_msfor a custom window. gateway_shareandsr_trendare scoped by the same dimension andgatewayfilters so selected volume can be compared against the matching success-rate slice.- The dashboard uses this for both auth-rate based analytics and rule/volume decision activity.