Analytics Log Summaries

August 3, 2026 ยท View on GitHub

Use case

Returns error aggregates and recent failed event samples for the selected merchant window.

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/log-summaries
  • 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, status=failure, error_code, gateway, and routing dimensions.

Example

Failure summaries

curl "$BASE_URL/analytics/log-summaries?range=1d&status=failure" \
  --header "$AUTH_HEADER" \
  --header "$TENANT_HEADER"

Response

{
  "merchant_id": "merchant_demo",
  "range": "1d",
  "total_errors": 2,
  "errors": [
    {
      "route": "decide_gateway",
      "error_code": "processor_declined",
      "error_message": "Card declined by issuer",
      "count": 2,
      "last_seen_ms": 1808624000000
    }
  ],
  "samples": [
    {
      "route": "decide_gateway",
      "merchant_id": "merchant_demo",
      "payment_id": "pay_001",
      "request_id": "req_...",
      "global_request_id": null,
      "trace_id": null,
      "gateway": "stripe",
      "routing_approach": "SR_SELECTION_V3_ROUTING",
      "status": "failure",
      "error_code": "processor_declined",
      "error_message": "Card declined by issuer",
      "flow_type": "gateway_decided",
      "created_at_ms": 1808624000000
    }
  ],
  "page": 1,
  "page_size": 10
}

Notes

  • Analytics reads are ClickHouse-backed and merchant-scoped by the authenticated context.
  • Use range=15m|1h|12h|1d|1w or start_ms plus end_ms for a custom window.
  • Use this to diagnose failure spikes before opening individual audit trails.