> For the complete documentation index, see [llms.txt](https://help.openloyalty.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.openloyalty.io/api-reference/data-analytics/retrieve-general-overview.md).

# Retrieve general overview

Management\
\
The endpoint is used to retrieve a general overview of the analytics dashboard. To use the endpoint, you must provide a "dataType" parameter that specifies the type of data you want to retrieve. Additionally, you can provide optional query parameters to filter the data.

You can specify an "aggregationType" parameter to group the data by day, week, month, or year. You can also specify an "intervalStartDate" and "intervalEndDate" parameter to retrieve data for a specific time range.

If you don't specify the "aggregationType" parameter, aggregation will be based on interval:

* 1-30 - days daily aggregation
* 31-90 - days weekly aggregation
* 91-360 - days monthly aggregation
* over 360 - days annual aggregation

If you don't provide any optional query parameters and don't specify an interval, it will return all data from the beginning to today.

"intervalEndDate" may run one day past the server's date, so that a client whose local calendar date is ahead of UTC is not rejected; beyond that the request returns 400. "intervalStartDate" carries no such upper bound. Either date later than the current server time is clamped to it and reported back clamped in the response.

````json
{"openapi":"3.0.0","info":{"title":"Open Loyalty","version":"0.0.1"},"tags":[{"name":"Data Analytics","description":"These endpoints will allow you to retrieve data for analytical dashboards and graphs"}],"servers":[{"url":"http://openloyalty.localhost"}],"security":[{"Bearer":[]},{"token":[]}],"components":{"securitySchemes":{"Bearer":{"type":"http","description":"Open Loyalty has the JWT authorization.\nTo learn what a JSON Web Token is and how it works, check out Introduction to JSON Web Tokens <https://jwt.io/introduction/>\n\n### Obtain an access token\n\nSend a request with the parameters username and password\n\n#### Definition\n\n`POST /api/admin/login_check` [Go to definition](#operation/adminLoginCheck)\n\n#### Example\n\n```bash\ncurl {HOST}/api/admin/login_check\n    -H 'Content-Type: application/json;charset=UTF-8'\n    -H 'Accept: application/json, text/plain, */*'\n    --data-binary '{\"username\":\"admin\",\"password\":\"password\"}'\n```\n\n#### Example Response\n\n```json\n{\n    \"token\":\"eyJhbGciOiJSUzI1NiIsInR5cCI6...\",\n    \"refresh_token\":\"0558f8bb29948c4e54c443f...\"\n}\n```\n\n### Using JSON Web Token\n\nAdd authorization header to each request\\\n`Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6...`\\\nYou can now access any API method you want under the /api prefix.\n\n#### Example\n```bash\ncurl {HOST}/api/{storeCode}/analytics/members\n    -H 'Accept: application/json'\n    -H 'Content-type: application/x-www-form-urlencoded'\n    -H 'Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6...'\n```\n\n### Refresh JSON Web Token\nYou can refresh token using refresh_token that was given during login.\\\nTo refresh admin token `POST /api/token/refresh` [Go to definition](#operation/tokenRefresh)\n","bearerFormat":"JWT","scheme":"bearer"},"token":{"type":"apiKey","name":"X-AUTH-TOKEN","in":"header","description":"Send the admin API key in this header. The `?auth_token=` query parameter is deprecated and is being switched off environment by environment — credentials in URLs land in access logs, proxies and browser history — so do not rely on it.\n"}},"parameters":{"storeCode":{"name":"storeCode","in":"path","description":"Store code","required":true,"schema":{"type":"string"}}},"schemas":{"GeneralOverview":{"properties":{"intervalStartDate":{"type":"string","format":"date"},"intervalEndDate":{"type":"string","format":"date"},"header":{"$ref":"#/components/schemas/GeneralOverviewHeader"},"data":{"type":"object","additionalProperties":true},"comparativePeriodData":{"type":"object","deprecated":true,"additionalProperties":true}},"type":"object"},"GeneralOverviewHeader":{"properties":{"registeredMembers":{"type":"integer"},"activeMembers":{"type":"integer"},"revenue":{"type":"number","format":"float"},"avgSpending":{"type":"number","format":"float"},"transactions":{"type":"integer"},"avgTransactionValue":{"type":"number","format":"float"},"avgNumberOfTransactions":{"type":"number","format":"float"},"returnTransactions":{"type":"integer"},"totalReturns":{"type":"number","format":"float"},"avgReturnValue":{"type":"number","format":"float"},"avgNumberOfReturnTransactions":{"type":"number","format":"float"}},"type":"object"},"ExpiredToken":{"required":["code","message"],"properties":{"code":{"type":"string"},"message":{"type":"string"}},"type":"object"},"InvalidToken":{"required":["code","message"],"properties":{"code":{"type":"string"},"message":{"type":"string"}},"type":"object"},"Unauthorized":{"required":["code","message"],"properties":{"code":{"type":"integer"},"message":{"type":"string"}},"type":"object"}},"responses":{"BadRequest":{"description":"Bad request.","content":{"application/json":{"schema":{"required":["code","message","errors"],"properties":{"code":{"type":"integer"},"message":{"type":"string"},"errors":{"type":"array","items":{"required":["message","parameters","plural","code","path"],"properties":{"message":{"type":"string"},"parameters":{},"plural":{"type":"integer","nullable":true},"code":{"type":"string"},"path":{"type":"string"}},"type":"object"}}},"type":"object"}}}},"AccessDenied":{"description":"Forbidden.","content":{"application/json":{"schema":{"required":["code","message"],"properties":{"code":{"type":"integer"},"message":{"type":"string"}},"type":"object"}}}},"NotFound":{"description":"Not found.","content":{"application/json":{"schema":{"required":["code","message"],"properties":{"code":{"type":"integer"},"message":{"type":"string"}},"type":"object"}}}}}},"paths":{"/api/{storeCode}/analytics/dashboard/general-overview":{"get":{"tags":["Data Analytics"],"summary":"Retrieve general overview","description":"<label style=\"background-color: #D4EDBC;padding:5px;\">Management</label><br><br>\nThe endpoint is used to retrieve a general overview of the analytics dashboard.\nTo use the endpoint, you must provide a \"dataType\" parameter that specifies the type of data you want to retrieve.\nAdditionally, you can provide optional query parameters to filter the data.\n\nYou can specify an \"aggregationType\" parameter to group the data by day, week, month, or year. You can also specify an \"intervalStartDate\" and \"intervalEndDate\" parameter to retrieve data for a specific time range.\n\nIf you don't specify the \"aggregationType\" parameter, aggregation will be based on interval:\n\n- 1-30 - days daily aggregation\n- 31-90 - days weekly aggregation\n- 91-360 - days monthly aggregation\n- over 360 - days annual aggregation\n\nIf you don't provide any optional query parameters and don't specify an interval, it will return all data from the beginning to today.\n\n\"intervalEndDate\" may run one day past the server's date, so that a client whose local calendar date is ahead of UTC is not rejected; beyond that the request returns 400. \"intervalStartDate\" carries no such upper bound. Either date later than the current server time is clamped to it and reported back clamped in the response.\n","operationId":"dataAnalyticsGetGeneralOverview","parameters":[{"name":"dataType","in":"query","required":true,"schema":{"type":"string","enum":["registeredMembers","revenue","avgSpending","transactions","avgTransactionValue","avgNumberOfTransactions","returnTransactions","totalReturns","avgReturnValue","avgNumberOfReturnTransactions"]}},{"name":"aggregationType","in":"query","required":false,"schema":{"type":"string","enum":["day","week","month","year"]}},{"name":"intervalStartDate","in":"query","required":false,"schema":{"type":"string","format":"date"}},{"name":"intervalEndDate","in":"query","required":false,"schema":{"type":"string","format":"date"}},{"$ref":"#/components/parameters/storeCode"}],"responses":{"200":{"description":"Data for general overview dashboard","content":{"application/json":{"schema":{"type":"object","allOf":[{"$ref":"#/components/schemas/GeneralOverview"},{"properties":{"aggregationType":{"type":"string","enum":["day","week","month","year"]},"dataType":{"type":"string","enum":["registeredMembers","revenue","avgSpending","transactions","avgTransactionValue","avgNumberOfTransactions","activeMembers","returnTransactions","totalReturns","avgReturnValue","avgNumberOfReturnTransactions"]}},"type":"object"}]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"description":"Unauthorized.","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ExpiredToken"},{"$ref":"#/components/schemas/InvalidToken"},{"$ref":"#/components/schemas/Unauthorized"}]}}}},"403":{"$ref":"#/components/responses/AccessDenied"},"404":{"$ref":"#/components/responses/NotFound"}}}}}}
````


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://help.openloyalty.io/api-reference/data-analytics/retrieve-general-overview.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
