API Docs
Analytics
API ReferenceAnalyticsPayments

Payment Metrics

Returns aggregated payment metrics over a time window. The full request shape, scopes, and response envelope are documented in Analytics overview.

POST /analytics/v1/{scope}/metrics/payments

Path parameterTypeDescription
scopestringOne of merchant or org.

Available metrics

Pass any combination of these in the request metrics array:

MetricTypeDescription
payment_countintegerNumber of payments created in the window.
payment_success_countintegerNumber of payments that reached succeeded.
payment_success_ratenumber (0–1)payment_success_count / payment_count.
payment_processed_amountintegerSum of amount_received across successful payments, in the lowest currency unit.
avg_ticket_sizeintegerMean payment amount across successful payments.

Available groupByNames

Group the result by any of these dimensions:

NameDescription
currencyThree-letter ISO currency.
connectorConnector that processed the payment.
payment_methodcard, wallet, bank_redirect, etc.
payment_method_typecredit, debit, apple_pay, pix, etc.
statusFinal payment status.
profile_idBusiness profile id.
auth_typethree_ds / no_three_ds.

Available filters

Restrict the rows that feed the aggregation. Each value is an array.

FilterExample
currency["USD", "EUR"]
connector["stripe", "adyen"]
payment_method["card"]
payment_method_type["credit", "debit"]
status["succeeded", "failed"]
profile_id["pro_xxx"]

Request Example

curl -X POST 'https://api.v2.paychtec.com/analytics/v1/merchant/metrics/payments' \  -H "Content-Type: application/json" \  -H "api-key: snd_YOUR_API_KEY" \  -d '[  {    "timeRange": {      "startTime": "2024-01-15T00:00:00Z",      "endTime": "2024-01-22T23:59:59Z"    },    "metrics": [      "payment_count",      "payment_success_rate",      "payment_processed_amount"    ],    "source": "BATCH",    "delta": true,    "timeSeries": {      "granularity": "G_ONE_DAY"    },    "groupByNames": [      "currency"    ],    "filters": {      "currency": [        "USD"      ]    }  }]'

Response

{
  "queryData": [
    {
      "currency": "USD",
      "payment_count": 1245,
      "payment_success_rate": 0.942,
      "payment_processed_amount": 8423500,
      "time_bucket": "2024-01-15"
    }
  ],
  "metaData": [
    {
      "total_payment_processed_amount": 8423500,
      "current_period_payment_count": 1245,
      "previous_period_payment_count": 1018
    }
  ]
}