Get reports (development in progress)

Get a store's statistic information in the read-only format used for reports creation in Ecwid control panel.

📘

Access scopes required: read_store_stats

Headers

NameTypeDescription
AuthorizationstringoAuth token with mandatory Bearer before it. Example: Bearer e***s0, where e***s0 should be replaced with your oAuth token.

Path parameters

NameTypeDescription
storeIdstringEcwid store ID
report_typestringName of report. See all types of report below.

Report types (WIP)

Report categoryName of report (report_type)Сhart type
Visitors
allTrafficchart
newVsReturningVisitors not readypiechart
visitorsByCities not readypiechart
visitorsByCountry not readybarchart OR piechart
visitorsByDevice not readypiechart
visitorsByLanguage not readypiechart
Conversions
salesFunnelbarchart
topOfCategoriesByViews not readytable
topOfProductsByViews not readytable
topOfProductsByAddingToCart not readytable
Orders
allOrders not readychart
newOrdersVsRepeatOrders not readypiechart
topOfProductsByOrders not readytable
topOfCustomersByOrders not readytable
topOfPaymentMethodsByOrders not readytable
topOfShippingMethodsByOrders not readytable
topOfProductsByAvailability not readytable
Financies
allRevenue not readychart
allExpenses not readytable
allProfit not readychart
topOfProductsByProfit not readytable
tips not readytable
Marketing
topOfMarketingSources not readypiechart
abandonedCarts not readytable
automatedEmails not readytable
acceptMarketing not readypiechart
mailchimpCampaigns not readytable
topOfCouponsByOrders not readytable
topOfDiscountsByOrders not readytable
giftCards not readypiechart

Query parameters

FieldTypeDescription
startedFromnumberLower bound of time interval a report is generated for. If not set, report is generated from store creation date. Supported value: UNIX timestamp, example: 1591646400
endedAtnumberUpper bound of time interval a report is generated for. If not set, upper bound is the request creation time. Supported value: UNIX timestamp, example: 1591732800
timeScaleValuestringValue for the time axis interval in chart. Allows to select the chart detailization level. Supported values: hour, day, week, month, year
comparePeriodstringPeriod the responses will compare and calculate the periodOverPeriod metrics. Supported values:
  • noComparePeriod(default value)
  • similarPeriodInPreviousWeek
  • similarPeriodInPreviousMonth
  • similarPeriodInPreviousYear
  • previousPeriod

Response

A JSON object containing the statistic information with the following fields:

FieldTypeDescription
reportTypestringName of report
startedFromnumberLower bound of time interval passed in the request parameter
endedAtnumberUpper bound of time interval passed in the request parameter
timeScaleValuestringValue for the time axis interval in chart passed in the request parameter
aggregatedData<AggregatedData>Array of objects containing metric values aggregated for the set period
dataset<DataSet>Array of objects containing ordered metrics

AggregatedData

FieldTypeDescription
dataIdstringID of the passed metric
dataValuenumberMetric value

DataSet

FieldTypeDescription
orderBynumberOrdinal number of graph point, segment of a pie chart or position number in the top
datapointIdstringName of graph point, segment of a pie chart or position number in the top (time, date, date range)

Errors

In case of error, Ecwid responds with an error HTTP status code and, optionally, JSON-formatted body containing error description

HTTP codes

HTTP StatusDescription
400Request parameters are malformed
403Access token doesn't have read_store_stats scope
404The info is not found
405Method not allowed. Can occur when using POST instead of GET HTTP request method
415Unsupported content-type: expected application/json or text/json
500Cannot retrieve the info because of an error on the server

Error response body (optional)

FieldTypeDescription
errorMessagestringError message
Language
Authorization
Query