Polarex.Metrics (Polarex v0.2.8)

View Source

Provides API endpoints related to metrics

Summary

Types

t()

@type t() :: %Polarex.Metrics{
  active_subscriptions: Polarex.Metric.t(),
  active_user_by_event: Polarex.Metric.t(),
  average_order_value: Polarex.Metric.t(),
  average_revenue_per_user: Polarex.Metric.t(),
  canceled_subscriptions: Polarex.Metric.t(),
  canceled_subscriptions_customer_service: Polarex.Metric.t(),
  canceled_subscriptions_low_quality: Polarex.Metric.t(),
  canceled_subscriptions_missing_features: Polarex.Metric.t(),
  canceled_subscriptions_other: Polarex.Metric.t(),
  canceled_subscriptions_switched_service: Polarex.Metric.t(),
  canceled_subscriptions_too_complex: Polarex.Metric.t(),
  canceled_subscriptions_too_expensive: Polarex.Metric.t(),
  canceled_subscriptions_unused: Polarex.Metric.t(),
  cashflow: Polarex.Metric.t(),
  checkouts: Polarex.Metric.t(),
  checkouts_conversion: Polarex.Metric.t(),
  churn_rate: Polarex.Metric.t(),
  committed_monthly_recurring_revenue: Polarex.Metric.t(),
  cost_per_user: Polarex.Metric.t(),
  costs: Polarex.Metric.t(),
  cumulative_costs: Polarex.Metric.t(),
  cumulative_revenue: Polarex.Metric.t(),
  gross_margin: Polarex.Metric.t(),
  gross_margin_percentage: Polarex.Metric.t(),
  monthly_recurring_revenue: Polarex.Metric.t(),
  net_average_order_value: Polarex.Metric.t(),
  net_cumulative_revenue: Polarex.Metric.t(),
  net_revenue: Polarex.Metric.t(),
  new_subscriptions: Polarex.Metric.t(),
  new_subscriptions_net_revenue: Polarex.Metric.t(),
  new_subscriptions_revenue: Polarex.Metric.t(),
  one_time_products: Polarex.Metric.t(),
  one_time_products_net_revenue: Polarex.Metric.t(),
  one_time_products_revenue: Polarex.Metric.t(),
  orders: Polarex.Metric.t(),
  renewed_subscriptions: Polarex.Metric.t(),
  renewed_subscriptions_net_revenue: 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.
  • timezone: Timezone to use for the timestamps. Default is UTC.
  • 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