Analytics
Get Analytics
Changed onRetrieves revenue, orders, customers and estimated gross profit analytics in a given timeframe. Pass <code>products</code> to scope every figure to up to 5 products, counted from invoice items rather than whole invoices.
get/v1/shops/{shopId}/analytics
Request
- Base URLhttps://api.sellauth.com
- AuthHTTP bearer
- TypeScriptA function with typed inputs. Its response is checked against the schema.
Query parameters
productsobject[]
Up to 5 products to scope the analytics to, each as <code>product_id</code> plus an optional <code>variant_ids</code> array.
Response
Example response
{
"revenue": 14.99,
"previousRevenue": 0,
"revenueChange": 1499,
"orders": 3,
"previousOrders": 0,
"ordersChange": 300,
"customers": 2,
"previousCustomers": 0,
"customersChange": 200,
"cogs": 13.5,
"profit": 1.49,
"previousProfit": 0,
"profitChange": 149,
"costCoverage": 100,
"hasCosts": true
}Changes
- breaking
the
response's property type changed fromintegertonumberfor status
- breaking
- info
added the new optional
queryrequest parameterproducts
- info