Skip to content

Get the report schema

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

Lists every dataset a report can read, with the measures, dimensions and filters each one offers. Use it to build a valid report definition for the run and save routes. For a filter whose values belong to the store, such as sales channels, the allowed values and their display names are included.

Required scopes: read:analytics

storeRef
required
string

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

Media typeapplication/json
object
datasets
required

The datasets a report can read.

Array<object>
object
measures
required

Measures the dataset offers.

Array<object>
object
type
required

Measure type.

string
Allowed values: money integer
key
required

Measure key, used in measures.

string
label_key
required

Translation key of the label.

string
redundant_with

Dimension keys that make this measure meaningless, such as grouping a count by the thing it counts. Advice only; the report still runs.

Array<string>
dimensions
required

Dimensions the dataset offers.

Array<object>
object
type
required

Dimension type.

string
Allowed values: string date id
grains

Time grains a date dimension accepts.

Array<string>
Allowed values: day week month quarter year
key
required

Dimension key, used in dimensions.

string
label_key
required

Translation key of the label.

string
filters
required

Filters the dataset offers.

Array<object>
object
value_labels

Display names for values that are ids, keyed by value.

object
key
additional properties
string
key
required

Filter key, used as field in filters.

string
operators
required

Operators the filter accepts.

Array<string>
values

The values the filter accepts, when it has a fixed list or a list defined by the store.

Array<string>
key
required

Dataset key, used as dataset.

string
label_key
required

Translation key of the label.

string
time_bounded
required

False when date_range does not limit this dataset.

boolean

Example

{
"datasets": [
{
"measures": [
{
"type": "money"
}
],
"dimensions": [
{
"type": "string",
"grains": [
"day"
]
}
]
}
]
}

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"
}