Skip to main content

Analytics

Revenue and payment analytics. All endpoints require authentication.

GET /analytics/summary

Get an aggregated dashboard summary for a date range.

curl "https://api.paylinks.ro/api/v1/analytics/summary?from=2026-01-01&to=2026-02-17" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "X-Currency: RON"

Query Parameters:

ParameterTypeDescription
fromdate/timeStart datetime (optional)
todate/timeEnd datetime (optional)

Response (200):

{
"summary": {
"revenueGrossMinor": 499900,
"revenueNetMinor": 487000,
"refundedMinor": 12000,
"successCount": 100,
"disputesCount": 2,
"newCustomers": 85,
"avgProcessingMs": 1800
}
}

GET /analytics/revenue

Get revenue data over time.

curl "https://api.paylinks.ro/api/v1/analytics/revenue?from=2026-01-01&to=2026-02-17&interval=day" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "X-Currency: RON"

Query Parameters:

ParameterTypeDefaultDescription
fromdate/timenow - 30 daysStart datetime
todate/timenowEnd datetime
intervalstringdayday or month

Response (200):

{
"series": [
{ "label": "1 ian.", "revenueMinor": 14999 },
{ "label": "2 ian.", "revenueMinor": 9998 },
{ "label": "3 ian.", "revenueMinor": 24997 }
]
}

GET /analytics/mrr

Get monthly recurring revenue data.

curl "https://api.paylinks.ro/api/v1/analytics/mrr?from=2025-01-01&to=2026-02-17" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "X-Currency: RON"

Response (200):

{
"currentMrrMinor": 49990,
"activeSubscriptions": 10,
"series": [
{ "label": "ian. 2026", "mrrMinor": 48990 },
{ "label": "feb. 2026", "mrrMinor": 49990 }
]
}

GET /analytics/payment-methods

Get payment method usage breakdown.

curl "https://api.paylinks.ro/api/v1/analytics/payment-methods?from=2026-01-01&to=2026-02-17" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "X-Currency: RON"

Response (200):

{
"items": [
{ "brand": "visa", "count": 85, "pct": 71 },
{ "brand": "mastercard", "count": 30, "pct": 25 },
{ "brand": "unknown", "count": 5, "pct": 4 }
]
}

POST /analytics/reconcile

Trigger reconciliation of local transactions with Stripe charges.

curl -X POST "https://api.paylinks.ro/api/v1/analytics/reconcile?from=2026-01-01&to=2026-02-17" \
-H "Authorization: Bearer YOUR_TOKEN"

Response (200):

{
"ok": true,
"updated": 37
}