Analytics

ClickHouse-backed payment audit read endpoint.

get/analytics/payment-audit

Request

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

Query parameters

connector_mismatchboolean

Only payments whose latest Decide Gateway or Hybrid Routing connector differs from a reported update connector in the selected window. Compares connector names without case or account suffixes. Keeps complete payment summaries and timelines; ignored for exact ID lookup.

rangestring
start_msinteger
end_msinteger
pageinteger
page_sizeinteger
payment_method_typestring
payment_methodstring
card_networkstring
card_is_instring
currencystring
countrystring
auth_typestring
gatewaystring

Payment audit: comma-separated to match payments that went through any of them.

payment_idstring
request_idstring
routestring

Payment audit: comma-separated to match payments that went through any of them.

statusstring

Matches payments with an event of exactly this status (e.g. FAILURE, CHARGED; success / failure also match routing calls). To filter by what happened to the payment, use outcome.

outcomestring
Example:failure,pending

The payment's outcome from its reported statuses: success (any attempt succeeded), failure (failed terminally, never succeeded) or pending (no terminal status yet). Comma-separated to match any of several, e.g. failure,pending.

min_amountnumber

Payment audit only: payments whose routed amount is at least this. Like currency, payment_method, payment_method_type, card_network and auth_type (which on the payment audit take comma-separated values and match any of them, case-insensitively), it matches the whole payment by its routing decision.

max_amountnumber

Payment audit only: payments whose routed amount is at most this.

payment_fieldsstring
Example:{"card_bin":"424242","metadata.segment":"premium"}

Payment audit only: a JSON object of payment field names to values; a payment must carry every value, matched case-insensitively. A field is a routing key from /config/routing-keys (other than a numeric one) or metadata.<key>, read from every endpoint's stored request. An unknown field returns 400.

flow_typestring
routing_approachstring
exclude_routing_approachstring
error_codestring

Payment audit: comma-separated to match payments that hit any of these error codes.

scope'all' | 'dynamic' | 'preview'

Which audit kinds to read: all (default, merged per payment), dynamic, or preview.

routing_kind'multi_objective' | 'auth_rate' | 'rule_based' | 'debit_routing' | 'hybrid'

List only payments whose trail holds this kind of event (the dashboard's Routing type filter): multi_objective (/decide and /routing/hybrid), auth_rate (/decide-gateway without debit routing), rule_based (/routing/evaluate) or debit_routing. hybrid, the older name, reads as multi_objective.

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

Payment audit

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 new optional query request parameter payment_fields

    • info

      added the new enum value auth_rate to the query request parameter routing_kind

    • info

      added the new optional query request parameter connector_mismatch