Skip to content

Get the revenue time series

GET
/stores/{storeRef}/analytics/time-series
curl --request GET \
--url 'https://apibase.ecomweb.app/api/v1/stores/example/analytics/time-series?period=day' \
--header 'x-api-key: <x-api-key>'

Returns revenue, orders and customers per day, week, month or year, oldest first, for charting trends. Empty buckets are included with zeros. The period parameter sets both the bucket size and how far back the series goes.

Required scopes: read:analytics

storeRef
required
string

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

period
required
string
default: day
Allowed values: day week month year

Bucket size and window: day returns the last 30 days, week the last 12 weeks, month the last 12 months and year the last 5 years.

Media typeapplication/json
Array<object>
object
date
required

Start of the bucket: YYYY-MM-DD for day, IYYY-IW (ISO year and week) for week, YYYY-MM for month and YYYY for year.

string
revenue
required

Revenue of the bucket, in the store currency.

number
orders
required

Orders placed in the bucket.

number
customers
required

Distinct customers who ordered in the bucket.

number

Example generated

[
{
"date": "example",
"revenue": 1,
"orders": 1,
"customers": 1
}
]

The request is malformed or failed validation.

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