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 parameter | Type | Description |
|---|---|---|
scope | string | One of merchant or org. |
Available metrics
Pass any combination of these in the request metrics array:
| Metric | Type | Description |
|---|---|---|
payment_count | integer | Number of payments created in the window. |
payment_success_count | integer | Number of payments that reached succeeded. |
payment_success_rate | number (0–1) | payment_success_count / payment_count. |
payment_processed_amount | integer | Sum of amount_received across successful payments, in the lowest currency unit. |
avg_ticket_size | integer | Mean payment amount across successful payments. |
Available groupByNames
Group the result by any of these dimensions:
| Name | Description |
|---|---|
currency | Three-letter ISO currency. |
connector | Connector that processed the payment. |
payment_method | card, wallet, bank_redirect, etc. |
payment_method_type | credit, debit, apple_pay, pix, etc. |
status | Final payment status. |
profile_id | Business profile id. |
auth_type | three_ds / no_three_ds. |
Available filters
Restrict the rows that feed the aggregation. Each value is an array.
| Filter | Example |
|---|---|
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
}
]
}