Easy Labs
SDKsRubyResources

Analytics

Analytics — methods, parameters, and examples for easy-sdk (gem).

Aggregator endpoints for dashboards and reporting. Each method returns a pre-aggregated payload over a time window — no need to walk every underlying record yourself.

Every method accepts the same query shape: period:, start_date:, end_date: (plus per-endpoint extras the API supports).

Accessed via client.analytics.

Methods

transactions(**query)

GET /analytics/transactions.

client.analytics.transactions(period: "month")
client.analytics.transactions(start_date: "2026-04-01", end_date: "2026-04-30")

disputes(**query)

GET /analytics/disputes.

client.analytics.disputes(period: "quarter")

settlements(**query)

GET /analytics/settlements.

client.analytics.settlements(period: "month")

revenue(**query)

GET /analytics/revenue.

client.analytics.revenue(period: "year")

revenue_recovery(**query)

GET /analytics/revenue-recovery. Aggregates the dunning + recovery funnel — recovered amounts, retry success rate, automation hits.

client.analytics.revenue_recovery(period: "month")

Object shape

Each endpoint returns a per-bucket aggregation: :buckets keyed by period, each with :gross, :net, :count, :currency, … plus top-line totals.

Examples

Build a monthly revenue chart

data = client.analytics.revenue(period: "month")
data[:buckets].each do |bucket|
  puts "#{bucket[:period_start]}: #{bucket[:gross]} #{bucket[:currency]}"
end

Surface dispute-rate spikes

disputes  = client.analytics.disputes(period: "month")
txns      = client.analytics.transactions(period: "month")
rate      = disputes[:total_count].to_f / txns[:total_count]
alert! if rate > 0.01

On this page