Skip to main content

Analytics, Logs & Utility APIs

This page groups the reporting and utility controllers: store analytics, per-product analytics, system logs, email logs, the public mini-cart, and bundle purchaser sync. Most are admin-gated (manage_options); the mini-cart and log listing are public.

All paths are relative to /wp-json/storeengine/v1.

Store analytics

analytics.php, base analytics, admin-only.

MethodPathPurpose
GET/analyticsStore-wide metrics over a date range
ParamTypeDefaultNotes
fromstring1 month agoRange start (Y-m-d).
tostringtodayRange end (Y-m-d).
compareinteger30Compare against the previous N days.
currencystringbase currencyISO-4217 filter. currencies_in_period in the response lists the currencies that actually have orders in range.
curl "https://your-store.example/wp-json/storeengine/v1/analytics?from=2026-06-01&to=2026-06-30" \
-u "admin:APPLICATION_PASSWORD"

Product analytics

product-analytics.php, base product-analytics, admin-only.

MethodPathPurpose
GET/product-analyticsPer-product performance list
GET/product-analytics/<id>Analytics for one product

List parameters: from, to (Y-m-d), currency, search, page (default 1), per_page (default 20, max 100). The single-product route takes the same from/to range.

curl "https://your-store.example/wp-json/storeengine/v1/product-analytics?search=license&per_page=20" \
-u "admin:APPLICATION_PASSWORD"

Logs

logs.php, base logs. Reading is public; mutating and settings require manage_options.

MethodPathPurposeAuth
GET/logsList log entriesPublic
DELETE/logsDelete entries by idmanage_options
GET/logs/settingsRead cleanup settingsmanage_options
POST/logs/settingsSave cleanup settingsmanage_options

GET /logs supports page, per_page, and a status filter. DELETE /logs requires an ids array:

curl -X DELETE https://your-store.example/wp-json/storeengine/v1/logs \
-u "admin:APPLICATION_PASSWORD" \
-H "Content-Type: application/json" \
-d '{ "ids": [12, 13, 14] }'

Email logs

email-log.php, base email-logs, admin-only.

MethodPathPurpose
GET/email-logsList email log entries
GET/email-logs/<id>Get one entry
DELETE/email-logs/<id>Delete one entry
GET/email-logs/settingsRead retention settings
POST/email-logs/settingsSave retention settings
POST/email-logs/purgePurge now
GET/email-logs/resendable-typesEmail types that can be resent
POST/email-logs/<id>/resendResend a logged email

POST /email-logs/settings requires retention_days_sent and retention_days_failed (both integers).

curl -X POST https://your-store.example/wp-json/storeengine/v1/email-logs/1042/resend \
-u "admin:APPLICATION_PASSWORD"

Mini cart

mini-cart.php, base mini-cart, public.

MethodPathPurpose
GET/mini-cart/currentLightweight header-cart summary
ParamTypeDefaultNotes
renderbooleantrueWhen true, includes rendered cart_items_html. Set false for a JSON-only summary.

The response includes is_empty, subtotal, total, tax breakdown, cart_items_count, cart_items, and the cart/checkout/shop URLs. The whole payload is filterable via storeengine/api/mini_cart_response. This is the endpoint a themed header cart polls after a Cart mutation.

curl "https://your-store.example/wp-json/storeengine/v1/mini-cart/current?render=false"

Bundle sync

bundle-sync.php, base bundle, admin-only.

MethodPathPurpose
POST/bundle/<id>/sync-purchasersGrant new bundle items to past purchasers

When products are added to an existing bundle, this endpoint walks past paid orders containing the bundle (one page at a time), grants download permissions for the newly-added products, and fires an action addons can listen to. Paginate with page (default 1) and per_page (default 25, max 100) until the response reports no more work.

curl -X POST https://your-store.example/wp-json/storeengine/v1/bundle/88/sync-purchasers \
-u "admin:APPLICATION_PASSWORD" \
-H "Content-Type: application/json" \
-d '{ "page": 1, "per_page": 25 }'