Aggregate

GET{{api_url}}/shop/reportstore/aggregate?report_key=wayfair_ad_spend&period_from=2026-09-01&period_to=2026-10-31&group_by=sku&sum=ad_spend,wasted_spend

Totals number columns across the saved runs of one report, without reading their rows.

Send report_key, a period_from and period_to range (runs whose period_start falls in it), sum with the number columns to total, and optionally group_by with the text columns to break the totals down by.

Returns a plain list with one row per saved run per group. Each row carries report_store_run_id, period_start, the group_by columns, and each sum column as a decimal string. Without group_by there is one row per run: that run's total.

Totals are per run, never across runs. Wayfair Ad Spend over September and October with group_by=sku returns each SKU once for September and once for October; add the rows up for a total across the whole range.

Only slotted columns from Definition Get can be used. group_by takes text columns (d1 to d8) and sum takes number columns (n1 to n12). A column with no slot, or one of the wrong kind, returns an error.

The result is not paged.

Authorization

Bearer token, sent in the Authorization header. Inherited from the collection.

Query Parameters

KeyValueDescription
report_keywayfair_ad_spendThe report to total, the report_key from Definition List, for example wayfair_ad_spend.
period_from2026-09-01Runs whose period_start is on or after this date. Format: 2026-09-01
period_to2026-10-31Runs whose period_start is on or before this date. Format: 2026-10-31
group_byskuText column keys to break the totals down by, comma separated, for example sku. Each must have a d slot in Definition Get. Omit for one total row per run.
sumad_spend,wasted_spendNumber column keys to total, comma separated, for example ad_spend,wasted_spend. Each must have an n slot in Definition Get.

Example Request

curl --location --request GET '{{api_url}}/shop/reportstore/aggregate?report_key=wayfair_ad_spend&period_from=2026-09-01&period_to=2026-10-31&group_by=sku&sum=ad_spend,wasted_spend' \
--header 'Authorization: Bearer {{auth_token}}'

Example Responses

Aggregate

Request

curl --location --request GET '{{api_url}}/shop/reportstore/aggregate?report_key=wayfair_ad_spend&period_from=2026-09-01&period_to=2026-10-31&group_by=sku&sum=ad_spend,wasted_spend' \
--header 'Authorization: Bearer YOUR_API_KEY'

Response 200 OK

[
    {
        "report_store_run_id": 4,
        "period_start": "2026-10-01",
        "sku": "WF-CHAIR-OAK",
        "ad_spend": "228.9000",
        "wasted_spend": "0.0000"
    },
    {
        "report_store_run_id": 4,
        "period_start": "2026-10-01",
        "sku": "WF-LAMP-BRS",
        "ad_spend": "96.1500",
        "wasted_spend": "43.4200"
    },
    {
        "report_store_run_id": 4,
        "period_start": "2026-10-01",
        "sku": "WF-SOFA-GRY",
        "ad_spend": "412.3700",
        "wasted_spend": "79.1000"
    }
]