Easy Labs
SDKsNode.jsResources

Analytics

Analytics — methods, parameters, and examples for @easylabs/node.

Analytics endpoints aggregate transactions, disputes, settlements, revenue, and revenue-recovery activity over a date range. Each method accepts the same AnalyticsQuery and returns an open-ended JSON shape suitable for dashboards or warehouse loads.

Methods

easy.getTransactionAnalytics(params?);     // GET /analytics/transactions
easy.getDisputeAnalytics(params?);         // GET /analytics/disputes
easy.getSettlementAnalytics(params?);      // GET /analytics/settlements
easy.getRevenueAnalytics(params?);         // GET /analytics/revenue
easy.getRevenueRecoveryAnalytics(params?); // GET /analytics/revenue-recovery

AnalyticsQuery:

type AnalyticsQuery = {
  period?: "day" | "week" | "month";
  start_date?: string;   // ISO date or datetime
  end_date?: string;
};
const monthly = await easy.getRevenueAnalytics({
  period: "month",
  start_date: "2026-01-01",
  end_date: "2026-04-30",
});

const weekly = await easy.getDisputeAnalytics({
  period: "week",
  start_date: "2026-04-01",
});

Object shape

Each analytics method returns ApiResponse<Record<string, unknown>> — the SDK does not narrow the response shape because the aggregations are computed server-side and may include slice-specific fields. Refer to the API reference for the canonical schema of each report.

Examples

Daily revenue chart for the current quarter

const start = "2026-04-01";
const end = "2026-06-30";
const daily = await easy.getRevenueAnalytics({ period: "day", start_date: start, end_date: end });
// pipe daily.data into your charting library

Build a recovery-rate KPI

const recovery = await easy.getRevenueRecoveryAnalytics({
  period: "month",
  start_date: "2026-01-01",
  end_date: "2026-12-31",
});
// recovery.data shape is open — inspect once and code your KPI extractor against the live response.

Snapshot for a board deck

const [tx, disputes, settlements] = await Promise.all([
  easy.getTransactionAnalytics({ period: "month" }),
  easy.getDisputeAnalytics({ period: "month" }),
  easy.getSettlementAnalytics({ period: "month" }),
]);

On this page