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¤cy=example_string" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_TOKEN"
import requests
import json
url = "https://mythic-analytics.gulp.workers.dev/client/v1/data/commerce/summary?event=purchase&date_from=example_string&date_to=example_string¤cy=example_string"
headers = {
"Content-Type": "application/json",
"Authorization": "Bearer YOUR_API_TOKEN"
}
response = requests.get(url, headers=headers)
print(response.json())
const response = await fetch("https://mythic-analytics.gulp.workers.dev/client/v1/data/commerce/summary?event=purchase&date_from=example_string&date_to=example_string¤cy=example_string", {
method: "GET",
headers: {
"Content-Type": "application/json",
"Authorization": "Bearer YOUR_API_TOKEN"
}
});
const data = await response.json();
console.log(data);
package main
import (
"fmt"
"net/http"
)
func main() {
req, err := http.NewRequest("GET", "https://mythic-analytics.gulp.workers.dev/client/v1/data/commerce/summary?event=purchase&date_from=example_string&date_to=example_string¤cy=example_string", nil)
if err != nil {
panic(err)
}
req.Header.Set("Content-Type", "application/json")
req.Header.Set("Authorization", "Bearer YOUR_API_TOKEN")
client := &http.Client{}
resp, err := client.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
fmt.Println("Response Status:", resp.Status)
}
require 'net/http'
require 'json'
uri = URI('https://mythic-analytics.gulp.workers.dev/client/v1/data/commerce/summary?event=purchase&date_from=example_string&date_to=example_string¤cy=example_string')
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
request = Net::HTTP::Get.new(uri)
request['Content-Type'] = 'application/json'
request['Authorization'] = 'Bearer YOUR_API_TOKEN'
response = http.request(request)
puts response.body
{
"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"
}
}
{
"error": "Bad Request",
"message": "The request contains invalid parameters or malformed data",
"code": 400,
"details": [
{
"field": "email",
"message": "Invalid email format"
}
]
}
{
"error": "Unauthorized",
"message": "Authentication required. Please provide a valid API token",
"code": 401
}
{
"error": "Service Unavailable",
"message": "The service is temporarily unavailable. Please try again later",
"code": 503
}
/commerce/summary
Target server for requests. Edit to use your own host.
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.
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.
Commerce event name. Default purchase.
ISO date (YYYY-MM-DD) or timestamp. Default 30 days ago.
ISO date or timestamp, inclusive.
ISO 4217 code. Pin one to get window totals on a multi-currency store.
Request Preview
Response
Response will appear here after sending the request
Authentication
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
Commerce event name. Default purchase.
ISO date (YYYY-MM-DD) or timestamp. Default 30 days ago.
ISO date or timestamp, inclusive.
ISO 4217 code. Pin one to get window totals on a multi-currency store.