Events & ExportDaily ecommerce totals

Daily ecommerce totals

Orders, revenue, average order value, units and buyers per day, for clients emitting the Mythic ecommerce spec. Shopify emits it automatically.

Two revenue figures, and the difference is not rounding. revenue here is the sum of ORDER totals — the spec's value, which includes shipping and tax. item_revenue alongside it is sum(unit price x quantity) across line items. The gap between them is shipping, tax and rounding. GET /commerce/items reports the line-item figure, so the two endpoints will not agree, and each labels which basis it used in revenue_basis.

Currencies are never summed together. Rows are one per (day, currency), because adding USD to EUR gives a number that is wrong in both. totals is therefore null on a multi-currency store unless you pass currency.

buyers is a per-day unique count and deliberately absent from totals — summing daily uniques double-counts anyone who bought on two days.

curl -X GET "https://mythic-analytics.gulp.workers.dev/client/v1/data/commerce/summary?event=purchase&date_from=example_string&date_to=example_string&currency=example_string" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_TOKEN"
{
  "success": true,
  "data": {
    "event": "purchase",
    "currencies": [
      "USD"
    ],
    "revenue_basis": "order_totals",
    "daily": [
      {
        "event_date": "2024-12-25",
        "currency": "USD",
        "orders": 8,
        "buyers": 7,
        "revenue": 1000,
        "item_revenue": 940,
        "units": 20,
        "average_order_value": 125,
        "units_per_order": 2.5
      }
    ],
    "totals": {
      "currency": "USD",
      "orders": 10,
      "revenue": 1200,
      "item_revenue": 1120,
      "units": 24,
      "average_order_value": 120,
      "units_per_order": 2.4
    },
    "note_on_revenue": "example_string"
  }
}
GET
/commerce/summary
GET
Base URLstring

Target server for requests. Edit to use your own host.

Bearer Token
Bearer Tokenstring
Required

Agency key (ak_) or location secret key (sk_) as a bearer token. Format: Bearer ak_... or Bearer sk_.... Scoped keys (mcp_) are accepted too and need the read scope of the family the route belongs to (people, events, sessions, replays, exceptions, heatmaps or bigquery_export). See Using an mcp_ key over HTTP.

Agency key (ak_) or location secret key (sk_) as a bearer token. Format: Bearer ak_... or Bearer sk_.... Scoped keys (mcp_) are accepted too and need the read scope of the family the route belongs to (people, events, sessions, replays, exceptions, heatmaps or bigquery_export). See Using an mcp_ key over HTTP.
query
eventstring

Commerce event name. Default purchase.

query
date_fromstring

ISO date (YYYY-MM-DD) or timestamp. Default 30 days ago.

query
date_tostring

ISO date or timestamp, inclusive.

query
currencystring

ISO 4217 code. Pin one to get window totals on a multi-currency store.

Min length: 3 • Max length: 3
Request Preview
Response

Response will appear here after sending the request

Authentication

header
Authorizationstring
Required

Bearer token. Agency key (ak_) or location secret key (sk_) as a bearer token. Format: Bearer ak_... or Bearer sk_.... Scoped keys (mcp_) are accepted too and need the read scope of the family the route belongs to (people, events, sessions, replays, exceptions, heatmaps or bigquery_export). See Using an mcp_ key over HTTP.

Query Parameters

eventstring

Commerce event name. Default purchase.

date_fromstring

ISO date (YYYY-MM-DD) or timestamp. Default 30 days ago.

date_tostring

ISO date or timestamp, inclusive.

currencystring

ISO 4217 code. Pin one to get window totals on a multi-currency store.

Responses

successboolean
dataobject