Sales analytics
Query sales across locations and read published historical checkout data with a Trellis API credential.
Use the Analytics API to pull sales by business date, location, hour, channel, category, or item. The API returns the report in the GET response.
Get access
An owner or admin can create or edit a credential in Integrations → API access. Select Sales reports and historical sales (reports:sales:read) and the locations the integration should see. An empty location list grants access to every location in the credential's tenant. You can add the scope to an existing active credential without rotating its token.
Send the tpk_live_… token in the Authorization: Bearer header and omit tenant, location, and staff identity headers. Trellis resolves the tenant from the credential. Select locations in the query string.
curl --fail-with-body 'https://api.trellispos.com/analytics/v1/locations' \
-H "Authorization: Bearer ${TRELLIS_API_KEY}"The location list returns each permitted location's code (id), UUID (canonicalId), name, and time zone.
Query sales
curl --fail-with-body --get 'https://api.trellispos.com/analytics/v1/sales' \
-H "Authorization: Bearer ${TRELLIS_API_KEY}" \
--data-urlencode 'kind=sales-by-location-day' \
--data-urlencode 'locationIds=fourth-street,south-creek' \
--data-urlencode 'start=2026-11-01' \
--data-urlencode 'end=2026-11-08' \
--data-urlencode 'limit=100'- Send one to twenty comma-separated location codes or UUIDs. The credential needs access to every requested location.
- Use
YYYY-MM-DDbusiness dates.startis inclusive andendis exclusive. A request can cover up to 366 days. - Choose
sales-summary,sales-by-day,sales-by-location-day,sales-by-hour,sales-by-channel,sales-by-location,sales-by-daypart,sales-by-revenue-center,sales-by-category,sales-by-employee,sales-by-employee-hour,product-mix,item-net-sales, ortop-modifiers. Employee breakdowns include staff IDs and display names. - Read
columnsto interpret the fields inrows. Money columns use the currency's minor units. Thelocationfield insales-by-location-dayis the canonical UUID. This grouping returns rows for location dates with recorded sales activity, including qualifying refunds. - Use
limit(1–500, default 100) andoffset(default 0) to page through results. Compareoffset + rows.lengthwithtotalRowsto see whether another page is available.
Read the Aloha archive
curl --fail-with-body --get 'https://api.trellispos.com/analytics/v1/history/recorded-checkout' \
-H "Authorization: Bearer ${TRELLIS_API_KEY}" \
--data-urlencode 'locationId=fourth-street' \
--data-urlencode 'start=2026-04-01' \
--data-urlencode 'end=2026-05-01'GET /analytics/v1/history/recorded-checkoutreads the published Aloha archive for Fourth Street. Each row includes its source and availability, an exact source decimal where available, and USD cents when the value can be represented exactly. Missing or unverified dates return null amounts.GET /analytics/v1/history/comparisonuses the same parameters and includes existing Trellis operational sales where available. It returns409when the sources overlap or their currencies are incompatible. The historical recorded-checkout basis can include deferred amounts and should be used for operational comparison only.- Query native historical sales imports, including South Creek ShopKeep data, through
/analytics/v1/salesfor the relevant location and business dates.
The same credential can call the sales kinds under GET /reports/operational, the location list under GET /reports/operational/locations, and the Aloha sales endpoints under /reports/aloha-history. Staff sessions continue to use their role and location permissions.
Errors and rate limits
| Status | Meaning |
|---|---|
400 | Invalid filters or dates, or a context header was sent with an API key |
401 | Missing, invalid, expired, or revoked credential |
403 | Missing sales scope or location access, or the report kind requires staff access |
409 | The selected location has no Aloha archive, or the comparison has overlapping dates or incompatible currency |
429 | The credential reached its rate limit. Wait for Retry-After seconds before retrying. |
Analytics shares the 120 requests-per-minute window per credential with the Trellis Tables API. Authenticated requests return X-RateLimit-Limit, X-RateLimit-Remaining, and X-RateLimit-Reset (UTC timestamp).