Skip to content

List report presets

GET
/stores/{storeRef}/reports/presets
curl --request GET \
--url https://apibase.ecomweb.app/api/v1/stores/example/reports/presets \
--header 'x-api-key: <x-api-key>'

Returns the built-in reports. Each preset carries a definition you can run as it is after replacing its placeholder date_range. last_viewed_at and pinned are personal to the user the API key acts as.

Required scopes: read:analytics

storeRef
required
string

The store’s ref, as returned by GET /stores.

Media typeapplication/json
object
data
required

The presets.

Array<object>
object
category
required

Group the preset belongs to.

string
Allowed values: sales products fulfilment inventory customers
definition
required

The preset’s definition. Its date_range is a placeholder: replace it with the days you want before running it.

object
dimensions
required

Dimensions to group by.

Array<object>
object
grain

Time grain for a date dimension: day, week, month, quarter or year.

string
Allowed values: day week month quarter year
field
required

Key of a dimension of the report’s dataset.

string
filters
required

Conditions that narrow the rows.

Array<object>
object
operator
required

How the values are compared.

string
Allowed values: is is_not gte lte
field
required

Key of a filter of the report’s dataset.

string
values
required

The values to compare with. is and is_not match any of the values.

Array<string>
date_range
required

The days the report covers.

object
start
required

First day, inclusive, as YYYY-MM-DD in the store’s time zone.

string
end
required

Last day, inclusive, as YYYY-MM-DD in the store’s time zone.

string
sort
required

How the rows are sorted.

Array<object>
object
order
required

Sort direction.

string
Allowed values: asc desc
key
required

Key of a selected measure or dimension.

string
visualization

How the dashboard draws the report. It does not change the rows.

string
Allowed values: table line bar
v
required

Version of the definition format.

number
dataset
required

Key of the dataset the report reads, such as orders.

string
measures
required

Keys of the measures to calculate.

Array<string>
limit
required

Maximum number of rows.

number
key
required

Stable preset key.

string
name_key
required

Translation key of the preset’s name.

string
last_viewed_at
required

When the user behind the key last viewed the preset, as an ISO 8601 timestamp, or null.

string
nullable
pinned
required

Whether that user pinned the preset.

boolean

Example

{
"data": [
{
"category": "sales",
"definition": {
"dimensions": [
{
"grain": "day"
}
],
"filters": [
{
"operator": "is"
}
],
"sort": [
{
"order": "asc"
}
],
"visualization": "table"
}
}
]
}

The key is missing, invalid, revoked or expired.

Media typeapplication/json
One of:
object
statusCode
required

The HTTP status code.

number
message
required

What went wrong; validation failures list one message per problem.

One of:
string
error

The HTTP status text, such as Bad Request.

string

Example generated

{
"statusCode": 1,
"message": [
"example"
],
"error": "example"
}

The key may not do this: a missing scope, a readonly key, a publishable key on a Store API route, or a disallowed origin.

Media typeapplication/json
One of:
object
statusCode
required

The HTTP status code.

number
message
required

What went wrong; validation failures list one message per problem.

One of:
string
error

The HTTP status text, such as Bad Request.

string

Example generated

{
"statusCode": 1,
"message": [
"example"
],
"error": "example"
}