← API Index

Use the Stats API

The /api/stats/ method family exposes the shop's statistics counters: what happens in the shop (logons, orders, carts, subscriptions, ...), what happened with mail sendouts (deliveries, opens, bounces, clicks) and how often tracked shop links were clicked.

It is the same data the admin area's status pages ("Status" / "Serienmails") are built on.

Access

All stats methods require an authenticated admin session (see use-api for the session model): perform a logon with an account that has admin rights, then call the stats methods within that session. Without admin access the methods respond with 403 and the X-oekobox-error: not_auth header (stats/eventtypes1 is the exception — it only lists event metadata and needs no session).

Methods

Method Data Response Type
stats/eventtypes1 all known event codes with localized descriptions EventType
stats/events1 per-day (or per-hour) counts of one event code EventStat
stats/links1 per-day click counts for tracked shop links LinkStat
stats/mailcampaigns all mail sendouts (Serienmails) with delivery/engagement numbers MailCampaign
stats/mailopens opens over time (per hour/day) after one sendout MailOpenStat
stats/campaign1 per-week statistics of one mail campaign CampaignStat
stats/mailcampaigns1 all message series on every channel (mail, push, sms) with delivery/engagement numbers; adds channel, delivered and a channel filter MailCampaign v2
stats/push1 recent push notification sends, one row per delivery channel PushSend
stats/pushsummary1 per-day / per-channel push totals (sends, failed, accepted, delivered, opened) PushDayStat
stats/pushdevices1 devices registered for platform-side push, per platform and app PushDeviceStat

How the methods relate

The methods link into each other via shared (global) parameters — the HTML documentation (?oo-rf=html) renders these as clickable cross references:

Notes on the data:

Ideas — what to build with this data

Getting started

# logon (admin account)
GET <base>/api/logon4?cid=<email>&pass=<password>

# list the sendouts
GET <base>/api/stats/mailcampaigns?oo-rf=json

# opens curve of one sendout
GET <base>/api/stats/mailopens?sid=<serieref>&p=h&oo-rf=json

# per-week campaign details
GET <base>/api/stats/campaign1?campaignid=<id>&oo-rf=json

Use ?oo-rf=html on any method to explore its parameters, error codes and response schema interactively.