List Aggregated Reports
Pending
GET
https://api.mpc.dev.placewise.com/v1/operations/revenue_reporting/reports/aggregated
API Permit:Operations:Api:RevenueReportingTaxCategories:List
API Context:Loyalty Club
Authorizations:UserToken
Query Parameters
subject
s:store
floor
- no. of floor the store is located atzone
- name of store zonecategory
- store categoryday
- day of the reportParameter | Type | Default | Description |
---|---|---|---|
subject | enum: ["store", "floor", "location", "category", "day"] | n/a | |
date_from | date | n/a | Start of the period to query |
date_to | date | n/a | End of the period to query |
complete | boolean | null | If true, returns only completed reports. If false, only non-completed. When null, returns all |
category | string | null | When given, returns only results for given category |
floor | string | null | When given, returns only results for given floor |
zone | string | null | When given, returns only results for given zone |
store_id | integer | null | When given, returns only results for given store |
tax_category_id | integer | null | When given, returns only results for given tax category |
sort_by | enum (see below) | Defines how subject s should be sorted | |
sort_direction | enum: ["asc", "desc"] | "asc" | Defines how subject s should be sorted |
Sorting options
subject
s by following attributes:name
value_cents
value_cents_growth
value_cents_avg
value_cents_avg_growth
value_cents_avg_per_area
value_cents_avg_per_area_growth
transaction_count
transaction_count_growth
Response Body
Key | Type | Description |
---|---|---|
total | AggregationRecord | Total data |
subperiods[] | AggregationRecord[] | Data grouped by subperiod |
subjects[] | AggregationRecord[] | Data grouped by subject |
meta | AggregationMeta |
AggregationMeta
Key | Type | Description |
---|---|---|
period_available.starts_at | date | Start date of range for which the data is available for querying |
period_available.ends_at | date | End date of range for which the data is available for querying |
period_selected.type | enum: ["year", "quarter", "month", "week", "day", "custom"] | Period detected from selected range |
period_selected.current.starts_at | date | Start date of queried range |
period_selected.current.ends_at | date | End date of queried range |
period_selected.current.definition | Object | Definition of queried range. Format depends on recognized type |
period_selected.previous.starts_at | date | Start date of parallel period of previous year |
period_selected.previous.ends_at | date | End date of parallel period of previous year |
period_selected.previous.definition | Object | Definition of queried range. Format depends on recognized type |
AggregationRecord
Key | Type | Description |
---|---|---|
name | String | Name of the record (empty for total aggregation) |
current | AggregationResult[] | Values for current period |
previous | AggregationResult[] | Values for parallel period of previous year |
growth | Object | Growth percentage for each value |
AggregationResult
Key | Type | Description |
---|---|---|
value_cents[] | Object | Contains aggregations of value_cents |
value_cents[].sum | Integer | |
value_cents[].avg | Float | |
value_cents[].per_area | Float | |
transaction_count[] | Object | Contains aggregations of transaction_count |
transaction_count[].sum | Integer | |
transaction_count[].avg | Float | |
transaction_count[].per_area | Float | |
last_updated_at | datetime | Last report update in the grouping |
last_user_id | String | ID of user that most recently updated report in the grouping |
complete | Boolean | Are all reports completed? |
Example
{
"total": {
"current": {
"value_cents": { "sum": 1200000, "avg": 171428.57, "per_area": 2400.0 },
"transaction_count": { "sum": 5300, "avg": 757.14, "per_area": 26.5 },
"last_updated_at": "2021-08-17T11:24:03.088Z",
"last_user_id": "0fc0891e-e345-48bb-a9b8-0bb248583680",
"complete": false
},
"previous": {
"value_cents": { "sum": 1000000, "avg": 142857.14, "per_area": 2000 },
"transaction_count": { "sum": 5000, "avg": 714.28, "per_area": 25 },
"last_updated_at": "2021-08-17T11:24:03.088Z",
"last_user_id": "0fc0891e-e345-48bb-a9b8-0bb248583680",
"complete": true
},
"growth": {
"value_cents": { "sum": 20.0, "avg": 20.0, "per_area": 20.0 },
"transaction_count": { "sum": 6.0, "avg": 6.0, "per_area": 6.0 }
}
},
"subperiods": [
{
"name": "1",
"current": {
"value_cents": { "sum": 138900, "avg": 46300.0, "per_area": 771.0 },
"transaction_count": { "sum": 5556, "avg": 1852.0, "per_area": 30.0 },
"last_updated_at": "2021-08-17T11:24:03.088Z",
"last_user_id": "0fc0891e-e345-48bb-a9b8-0bb248583680",
"complete": false
},
"previous": {
"value_cents": { "sum": 39800, "avg": 9950.0, "per_area": 153.0 },
"transaction_count": { "sum": 1592, "avg": 398.0, "per_area": 6.0 },
"last_updated_at": "2021-08-17T11:24:03.088Z",
"last_user_id": "0fc0891e-e345-48bb-a9b8-0bb248583680",
"complete": false
},
"growth": {
"value_cents": { "sum": 20.0, "avg": 20.0, "per_area": 20.0 },
"transaction_count": { "sum": 6.0, "avg": 6.0, "per_area": 6.0 }
}
},
// ...
{
"name": "7",
"current": {
"value_cents": { "sum": 187800, "avg": 46950.0, "per_area": 722.0 },
"transaction_count": { "sum": 7512, "avg": 1878.0, "per_area": 28.0 },
"last_updated_at": "2021-08-17T11:24:03.088Z",
"last_user_id": "0fc0891e-e345-48bb-a9b8-0bb248583680",
"complete": false
},
"previous": {
"value_cents": { "sum": 53000, "avg": 10600.0, "per_area": 203.0 },
"transaction_count": { "sum": 2120, "avg": 424.0, "per_area": 8.0 },
"last_updated_at": "2021-08-17T11:24:03.088Z",
"last_user_id": "0fc0891e-e345-48bb-a9b8-0bb248583680",
"complete": false
},
"growth": {
"value_cents": { "sum": 20.0, "avg": 20.0, "per_area": 20.0 },
"transaction_count": { "sum": 6.0, "avg": 6.0, "per_area": 6.0 }
}
}
],
"subjects": [
{
"name": 1,
"current": {
"value_cents": { "sum": 325500, "avg": 46500.0, "per_area": 6510.0 },
"transaction_count": { "sum": 13020, "avg": 1860.0, "per_area": 260.0 },
"last_updated_at": "2021-08-17T11:24:03.088Z",
"last_user_id": "0fc0891e-e345-48bb-a9b8-0bb248583680",
"complete": false
},
"previous": {
"value_cents": { "sum": 70700, "avg": 10100.0, "per_area": 1414.0 },
"transaction_count": { "sum": 2828, "avg": 404.0, "per_area": 56.0 },
"last_updated_at": "2021-08-17T11:24:03.088Z",
"last_user_id": "0fc0891e-e345-48bb-a9b8-0bb248583680",
"complete": false
},
"growth": {
"value_cents": { "sum": 20.0, "avg": 20.0, "per_area": 20.0 },
"transaction_count": { "sum": 6.0, "avg": 6.0, "per_area": 6.0 }
}
},
// ...
{
"name": 52,
"current": {
"value_cents": { "sum": 46800, "avg": 46800.0, "per_area": null },
"transaction_count": { "sum": 1872, "avg": 1872.0, "per_area": null },
"last_updated_at": "2021-08-17T11:24:03.088Z",
"last_user_id": "0fc0891e-e345-48bb-a9b8-0bb248583680",
"complete": false
},
"previous": {
"value_cents": { "sum": 21100, "avg": 10550.0, "per_area": null },
"transaction_count": {"sum": 844, "avg": 422.0, "per_area": null },
"last_updated_at": "2021-08-17T11:24:03.088Z",
"last_user_id": "0fc0891e-e345-48bb-a9b8-0bb248583680",
"complete": false
},
"growth": {
"value_cents": { "sum": 20.0, "avg": 20.0, "per_area": 20.0 },
"transaction_count": { "sum": 6.0, "avg": 6.0, "per_area": 6.0 }
}
}
],
"meta": {
"period_available": {
"starts_at": "2020-03-23",
"ends_at": "2021-08-17"
},
"period_selected": {
"type": "week",
"current": {
"starts_at": "2021-08-02",
"ends_at": "2021-08-08",
"definition": {
"year": 2021,
"week": 31
}
},
"previous": {
"starts_at": "2020-08-02",
"ends_at": "2020-08-08",
"definition": {
"year": 2020,
"week": 31
}
}
}
}
}
Request
Header Params
X-Loyalty-Club-Slug
stringÂ
required
Default:
{{LOYALTY_CLUB_SLUG}}
X-Client-Authorization
stringÂ
optional
Default:
{{API_TOKEN}}
Request samples
Responses
Modified at 2024-05-07 15:49:13