Polarex.Metrics (Polarex v0.2.3)

View Source

Provides API endpoints related to metrics

Summary

Types

t()

@type t() :: %Polarex.Metrics{
  active_subscriptions: Polarex.Metric.t(),
  average_order_value: Polarex.Metric.t(),
  checkouts: Polarex.Metric.t(),
  checkouts_conversion: Polarex.Metric.t(),
  cumulative_revenue: Polarex.Metric.t(),
  monthly_recurring_revenue: Polarex.Metric.t(),
  new_subscriptions: Polarex.Metric.t(),
  new_subscriptions_revenue: Polarex.Metric.t(),
  one_time_products: Polarex.Metric.t(),
  one_time_products_revenue: Polarex.Metric.t(),
  orders: Polarex.Metric.t(),
  renewed_subscriptions: Polarex.Metric.t(),
  renewed_subscriptions_revenue: Polarex.Metric.t(),
  revenue: Polarex.Metric.t(),
  succeeded_checkouts: Polarex.Metric.t()
}

Functions

metrics_get(opts \\ [])

@spec metrics_get(keyword()) ::
  {:ok, Polarex.MetricsResponse.t()} | {:error, Polarex.HTTPValidationError.t()}

Get Metrics

Get metrics about your orders and subscriptions.

Currency values are output in cents.

Scopes: metrics:read

Options

  • start_date: Start date.
  • end_date: End date.
  • interval: Interval between two timestamps.
  • organization_id: Filter by organization ID.
  • product_id: Filter by product ID.
  • billing_type: Filter by billing type. recurring will filter data corresponding to subscriptions creations or renewals. one_time will filter data corresponding to one-time purchases.
  • customer_id: Filter by customer ID.

metrics_limits(opts \\ [])

@spec metrics_limits(keyword()) :: {:ok, Polarex.MetricsLimits.t()} | :error

Get Metrics Limits

Get the interval limits for the metrics endpoint.

Scopes: metrics:read