What I want to create:
I am building a Google Apps Script integration to pull total revenue values into a Google Sheet for specific timelines: Last 7 Days, Month to Date, and Last 30 Days.
The Issue:
I have successfully connected to the metric-aggregates endpoint and I am retrieving data, but the totals are consistently lower than what I see on my Klaviyo Dashboard.
-
Dashboard (Australia/Sydney): ~$255k AUD
-
API Response: ~$250k AUD
It looks like the API is cutting off a specific chunk of time (likely due to the timezone offset), missing either the start or the end of the window.
My Setup:
-
Account Timezone: Australia/Sydney
-
Metric: "Placed Order"
-
Endpoint: https://a.klaviyo.com/api/metric-aggregates (Revision 2024-10-15)
What I’ve Tried:
I am using Google Apps Script to fetch the data. I have tried forcing the dates to align with Sydney Midnight (00:00:00) and converting them to ISO strings with the timezone offset (+11:00), but the discrepancy persists.
Here is the JSON payload logic I am currently using:
{
"data": {
"type": "metric-aggregate",
"attributes": {
"metric_id": "MY_METRIC_ID",
"measurements": ["sum_value"],
"interval": "day",
"filter": [
"greater-or-equal(datetime,2025-12-23T00:00:00+11:00)",
"less-than(datetime,2025-12-31T00:00:00+11:00)"
],
"timezone": "Australia/Sydney"
}
}
}
Here is a polished, professional post tailored for the Klaviyo Community Developer Forum. It follows the structure of the sample you provided but includes the technical details necessary for a developer to actually solve your problem.
Subject:
Discrepancy in "Placed Order" Revenue: API vs. Dashboard (Timezone/Aggregation Issue)
Body:
What I want to create:
I am building a Google Apps Script integration to pull total revenue values into a Google Sheet for specific timelines: Last 7 Days, Month to Date, and Last 30 Days.
The Issue:
I have successfully connected to the metric-aggregates endpoint and I am retrieving data, but the totals are consistently lower than what I see on my Klaviyo Dashboard.
-
Dashboard (Australia/Sydney): ~$255k AUD
-
API Response: ~$250k AUD
It looks like the API is cutting off a specific chunk of time (likely due to the timezone offset), missing either the start or the end of the window.
My Setup:
-
Account Timezone: Australia/Sydney
-
Metric: "Placed Order"
-
Endpoint: https://a.klaviyo.com/api/metric-aggregates (Revision 2024-10-15)
What I’ve Tried:
I am using Google Apps Script to fetch the data. I have tried forcing the dates to align with Sydney Midnight (00:00:00) and converting them to ISO strings with the timezone offset (+11:00), but the discrepancy persists.
Here is the JSON payload logic I am currently using:
JSON code
{
"data": {
"type": "metric-aggregate",
"attributes": {
"metric_id": "MY_METRIC_ID",
"measurements": ["sum_value"],
"interval": "day",
"filter": [
"greater-or-equal(datetime,2025-12-23T00:00:00+11:00)",
"less-than(datetime,2025-12-31T00:00:00+11:00)"
],
"timezone": "Australia/Sydney"
}
}
}The Question:
Does anyone know exactly how the Klaviyo Dashboard calculates "Last 7 Days"?
-
Does it strictly use the Account Timezone (Sydney) for the midnight cutoff?
-
When passing the filter in the API, should I be converting the time to UTC (Z) or keeping the offset (+11:00)?
-
Is there a specific "Anchor" time I should use to ensure I match the Dashboard numbers exactly?
I suspect the API is interpreting my "Sydney Midnight" as "UTC Midnight" somewhere in the chain, causing me to lose ~11 hours of data per request.
Any help on aligning these timestamps would be appreciated

