read
analytics

One read-only question across every store this connection covers, answered from the numbers Magistry has already joined

Changed on

One read-only question across every store this connection covers, answered from the numbers Magistry has already joined and reconciled: orders, revenue ex VAT, ad spend, transaction costs, refunds and profit as the Profit page computes them; disputes; ad performance per platform and campaign; orders placed, gross sales and average order value per sales channel; Shopify Payments payouts; new and returning customers (counts only); and expenses per category. Suited to totals, trends and comparisons across stores ("profit per store last month", "ad spend per platform this week, all shops", "orders and payouts per store last week"). Takes metrics, group_by (store, day, week, month; ad_platform and campaign apply to ad_* metrics only, channel to orders metrics, payout_status to payouts metrics, expense_category to expenses metrics) and a date range (default the last 30 days, at most 731 days). Without store_ids it covers every store of the grant. Money is never added across currencies: currency is part of every row and totals has one row per currency. A null is unknown, never 0, and unknown says why. Days are UTC dates, as on the Profit page, except orders and payouts metrics, which count the day in the store's own timezone; expenses count their booking date. Metrics: orders (profit): Orders (not cancelled, not test). revenue_ex_vat (profit): Revenue excluding VAT; null on a day whose VAT could not be read. ad_spend (profit): All-platform ad spend in the store currency; null on a day a connected paid source was unread or unconverted. transaction_costs (profit): Payment transaction costs. refunds_ex_vat (profit): Refunds booked on the day, excluding VAT; null on a day holding a refund with no exchange rate to the store currency. profit (profit): Revenue ex VAT x 90-day gross margin, minus ad spend, transaction costs and refunds: the Profit page figure. profit_measured (profit): Profit from measured order contributions only; null on a day any order lacked a measured contribution. roas (profit): revenue_ex_vat / ad_spend over the group; null when either is unknown or spend is 0. disputes_opened (disputes): Chargebacks/disputes opened. disputes_amount (disputes): Disputed amount, in the dispute currency. disputes_won (disputes): Of those opened, now won. disputes_lost (disputes): Of those opened, now lost or accepted. disputes_lost_amount (disputes): Amount of those lost or accepted. ad_platform_spend (ads): Spend as the ad platform reports it, in the ad account currency. ad_impressions (ads): Impressions. ad_clicks (ads): Clicks. ad_conversions (ads): Conversions as the platform reports them. ad_conversion_value (ads): Conversion value as the platform reports it. ad_platform_roas (ads): ad_conversion_value / ad_platform_spend over the group. ad_ctr (ads): ad_clicks / ad_impressions over the group. ad_cpc (ads): ad_platform_spend / ad_clicks over the group. orders_placed (orders): Orders placed (not test, not cancelled, not deleted), on the store-timezone day; can differ from the profit-family orders by a day at the edges, which counts UTC days. gross_sales (orders): Order totals before returns and refunds, incl. VAT and shipping, in the order currency; the Profit page shows revenue ex VAT after refunds instead. Null when an order in the group has no gross total synced (marketplace and custom-API orders). average_order_value (orders): gross_sales / orders_placed over the group (gross, incl. VAT); null when gross_sales is unknown. payouts_count (payouts): Shopify Payments payouts issued; group by payout_status to separate paid, scheduled, failed and canceled. payouts_amount (payouts): Net payout amount (after Shopify fees, refunds and chargebacks), in the payout currency; all statuses unless grouped by payout_status. new_customers (customers): Customers whose first real order at the store fell on the day (by platform customer id, else e-mail); each customer is new once. Bounded by the first synced order: see unknown. returning_customers (customers): Customers ordering on the day who had ordered at the store before; summed over days, so a customer returning on two days counts twice. unidentified_orders (customers): Real orders with neither a customer id nor an e-mail synced: neither new nor returning can be told for them. expenses_total (expenses): Expense transactions booked on the store, in the transaction currency; group by expense_category for the split. Workspace-wide expenses the Profit page spreads over stores count on the store they are booked on. expenses_count (expenses): Number of expense transactions booked on the store.

post/api/v1/tools/magistry_query

Request

  • Base URL
    https://app.magistry.io
  • Auth
    • HTTP bearer
    • or OAuth 2
      Authorization codehttps://app.magistry.io/api/oauth/authorize
      Token URLhttps://app.magistry.io/api/oauth/token
      Scopesanalytics:read

Request body

object required
metrics, string[] required

What to measure.

group_by, string[]

Dimensions; default ["store"]. [] gives one total per currency. ad_platform and campaign work with ad_* metrics only, channel with orders metrics, payout_status with payouts metrics, expense_category with expenses metrics.

date_from, string date

First day (UTC), inclusive. Default 29 days before date_to.

date_to, string date

Last day (UTC), inclusive. Default today.

store_ids, string[]

A subset of this connection's stores. Default: all of them.

Response

Tool result

object required
ok, boolean required
result, unknown required

Changes

    • warning

      added the new method_not_allowed enum value to the error response property for the response status

    • warning

      added the new method_not_allowed enum value to the error response property for the response status

    • warning

      added the new method_not_allowed enum value to the error response property for the response status

    11 more changes in this revision