Docs
Dashboard

Analytics

Read-only reporting endpoints that aggregate real transaction, fee, order, and checkout data into the metrics that power the merchant dashboard: revenue, platform fees, payment-rail breakdown, revenue time series, conversion rate, store order stats, and top products.

Authentication

Every Analytics endpoint requires a valid JWT or API key sent as Authorization: Bearer <token> — with one exception: GET /analytics/platform-stats is public and unauthenticated (platform-wide aggregates only, no per-merchant data). The base URL for all requests is https://gullypay.xyz/api. All figures are computed live from the database — there is no caching layer in front of these queries.

Endpoints

GET/analytics/platform-statsPublic platform-wide aggregates (no auth)
GET/analytics/merchants/:merchantId/revenueTotal revenue and transaction count (auth required)
GET/analytics/merchants/:merchantId/feesTotal platform fees (auth required)
GET/analytics/merchants/:merchantId/railsPayment-rail (provider) breakdown (auth required)
GET/analytics/merchants/:merchantId/timeseriesDaily revenue time series (auth required)
GET/analytics/merchants/:merchantId/conversionsCheckout conversion metrics (auth required)
GET/analytics/stores/:storeId/ordersStore order count and GMV (auth required)
GET/analytics/stores/:storeId/top-productsTop products by revenue (auth required)

Platform Stats

GET/analytics/platform-statsPublic platform-wide aggregates

Public — no authentication required. Returns platform-wide, non-sensitive aggregates for the marketing landing page. Every value is computed live from real tables; there are no fabricated figures. On a freshly provisioned platform the counts and processed volume are legitimately 0.

  • merchants — total merchant accounts.
  • totalProcessedCents — sum of settled (status = 'succeeded') transaction amounts, in minor units (cents).
  • transactions — count of settled transactions.
  • chainsSupported — mainnet settlement chains the facilitator accepts today (Base, Ethereum, BSC, Solana). Gully Chain Testnet (chain id 485590) is extra and not counted; it shows in the networks list of GET /public/stats with enabled set by the server flag.
Response
{
"merchants": 128,
"totalProcessedCents": 1284900,
"transactions": 512,
"chainsSupported": 4
}

Merchant Revenue

GET/analytics/merchants/:merchantId/revenueTotal revenue and transaction count

Sums all transaction amounts for the merchant and counts them.

Response
{
"totalRevenue": 1284900,
"transactionCount": 512
}

Merchant Fees

GET/analytics/merchants/:merchantId/feesTotal platform fees

Sums all fee-ledger entries for the merchant.

Response
{
"totalFees": 38547
}

Payment Rail Breakdown

GET/analytics/merchants/:merchantId/railsPayment-rail (provider) breakdown

Groups the merchant's transactions by payment provider, returning transaction count and volume per rail.

Response
[
{ "rail": "stripe", "transactions": 320, "volume": 890400 },
{ "rail": "x402", "transactions": 192, "volume": 394500 }
]

Revenue Time Series

GET/analytics/merchants/:merchantId/timeseriesDaily revenue time series

Returns daily transaction volume and count over the trailing window. Pass ?days=<n> (default 30).

Response
[
{ "date": "2026-06-08", "volume": 42100, "count": 18 },
{ "date": "2026-06-09", "volume": 51200, "count": 21 }
]
QueryTypeRequiredDescription
daysnumberNoTrailing window in days (default: 30)

Conversion Metrics

GET/analytics/merchants/:merchantId/conversionsCheckout conversion metrics

Computes the checkout conversion rate from checkout sessions — completed sessions divided by total sessions, as a percentage.

Response
{
"totalSessions": 640,
"completedSessions": 512,
"conversionRate": 80.0
}

Store Order Stats

GET/analytics/stores/:storeId/ordersStore order count and GMV

Counts orders for the store and sums their totals (gross merchandise value).

Response
{
"totalOrders": 418,
"totalGmv": 1102300
}

Top Products

GET/analytics/stores/:storeId/top-productsTop products by revenue

Returns the store's best-selling product variants by revenue, joining order items to orders. Pass ?limit=<n> (default 10).

Response
[
{ "variantId": "var_abc123", "totalSold": 240, "totalRevenue": 358000 },
{ "variantId": "var_def456", "totalSold": 190, "totalRevenue": 271500 }
]
QueryTypeRequiredDescription
limitnumberNoMax products to return (default: 10)
Amounts are in minor units

Revenue, fee, volume, and GMV figures are integer amounts in the smallest currency unit (e.g. cents for USD), matching how transactions and orders are stored.

Next Steps