Analytics

Get business overview

Changed on

Account-wide business pulse in one call: revenue, orders, leads, new contacts, and live-site traffic over a date range, each compared against the immediately preceding period of equal length. Defaults to the last 7 days; the range cannot exceed 366 days. Use this as the starting point for any business review — drill into a specific site with GET /sites/{id}/analytics, and into records with the orders/contacts list endpoints.

get/analytics

Request

  • Base URL
    https://api.crevio.co/v1
  • Auth
    API key in header Authorization

Query parameters

start_date, string date

Start of the date range (inclusive), as an ISO-8601 date (YYYY-MM-DD). Defaults to 6 days before end_date, so the default range is the last 7 days including today.

end_date, string date

End of the date range (inclusive), as an ISO-8601 date (YYYY-MM-DD). Defaults to today.

Response

Business overview for the requested period

object required
object, 'business_overview' required
period, object required

The resolved date range the metrics cover.

previous_period, object required

The comparison period: the range of equal length immediately before period.start_date.

currency, string required

Lowercase ISO currency code all monetary amounts are expressed in (the account's display currency).

lifetime_revenue, integer required

All-time revenue in the account currency, in the smallest currency unit (cents for USD). Net of refunds: live orders that succeeded or were partly refunded, less what was refunded. Test purchases and disputed charges are left out.

revenue, object required

Revenue in the account currency, in the smallest currency unit (cents for USD), with the preceding period of equal length for comparison and a per-day time series. Net of refunds: live orders that succeeded or were partly refunded, less what was refunded. Test purchases and disputed charges are left out.

orders, object required

Period totals with the preceding period of equal length for comparison and a per-day time series.

leads, object required

Period totals with the preceding period of equal length for comparison and a per-day time series.

new_contacts, object required

Period totals with the preceding period of equal length for comparison.

refunds, object required

Orders created in the period that have since been refunded or partially refunded. Attribution is by order date (refund timestamps are not tracked); amounts are in the account currency, in the smallest currency unit.

top_products, object[] required

Top products by units sold over the period (units, not revenue — per-item revenue attribution is not tracked). Empty when nothing sold.

traffic, object nullable required

Traffic for the account's live site, or for its main site before that site is first published (which keeps any history imported from its earlier crevio.co page). Null only when the account has no site. Zeros may also mean analytics collection is temporarily degraded.

Changes

    • warning

      added the new idempotency_error enum value to the error/type response property for the response status

    • warning

      added the new idempotency_error enum value to the error/type response property for the response status

    • warning

      added the new idempotency_error enum value to the error/type response property for the response status