Analytics

ClickHouse-backed rule preview trace read endpoint.

get/analytics/preview-trace

Request

  • Base URL
    http://localhost:8080
  • URL
    http://localhost:8080/analytics/preview-trace
  • Auth
    • HTTP bearer
    • or API key in header x-api-key

Query parameters

rangestring
start_msinteger
end_msinteger
pageinteger
page_sizeinteger
payment_method_typestring
payment_methodstring
card_networkstring
card_is_instring
currencystring
countrystring
auth_typestring
gatewaystring
payment_idstring
request_idstring
routestring
statusstring
flow_typestring
routing_approachstring
exclude_routing_approachstring
error_codestring

Headers

x-tenant-idstring required

Tenant to resolve. The shipped config files define only the "public" tenant. No fallback — omitting this fails with TE_03.

Response

Decision trace

merchant_idstring
rangestring
payment_idstring nullable
request_idstring nullable
gatewaystring nullable
routestring nullable
statusstring nullable
flow_typestring nullable
routing_approachstring nullable
error_codestring nullable
pageinteger
page_sizeinteger
total_resultsinteger
total_successinteger
total_failureinteger
scopestring

all | dynamic | preview

routing_kindstring nullable

Example response

{
  "merchant_id": "merchant_demo",
  "range": "1d",
  "page": 1,
  "page_size": 20,
  "total_results": 1,
  "total_success": 1,
  "results": [
    {
      "lookup_key": "pay_sr_001",
      "payment_id": "pay_sr_001",
      "event_count": 2,
      "latest_status": "success",
      "latest_gateway": "stripe",
      "latest_stage": "gateway_decided",
      "experiments": [
        {
          "experiment_id": "routing_dd6ec3ad-aac4-4c8c-b6f7-03c732163f90",
          "arm": "variant",
          "endpoint": "hybrid_routing"
        }
      ]
    }
  ],
  "timeline": [
    {
      "id": "evt_...",
      "flow_type": "decision",
      "event_stage": "gateway_decided",
      "route": "decide_gateway",
      "payment_method_type": "CARD",
      "payment_method": "CREDIT",
      "gateway": "stripe",
      "status": "success",
      "score_value": 0.94,
      "created_at_ms": 1808624000000
    }
  ]
}

Changes

    • info

      added the optional property // to the response with the status

    • info

      added the optional property // to the response with the status

    • info

      added the optional property to the response with the status

    • info

      added the optional property to the response with the status