Available aggregations
| Category | Aggregation | Description |
|---|---|---|
| Spend | spend_12m | Total spend in the last 12 months |
| Spend | spend_all | Total lifetime spend |
| Spend | atv | Average transaction value |
| Frequency | shop_count | Total number of transactions |
| Frequency | purchase_frequency | Average days between purchases |
| Frequency | days_since_last_purchase | Days since last transaction |
| Preferences | preferred_location_id | Most frequently visited location |
| Preferences | preferred_channel | Primary shopping channel |
| Lifecycle | lifecycle_stage | Current stage in the customer journey |
Reading aggregations for a profile
Aggregations are returned as part of the standard profile response:aggregations key in the response body. If aggregations have not yet been calculated for a profile (e.g., a newly created profile with no transactions), the values will be null.
Browsing all aggregations
Using aggregations in reactions
Aggregation values are available as variables in reaction conditions and Twig templates. For example, you can trigger a reaction whenspend_12m crosses a threshold, or include a customer’s lifetime spend in a notification payload.
Notes
- Aggregations are recalculated on a schedule: they are not real-time. Allow for a short delay after a transaction is recorded before aggregation values update.
- Aggregations are read-only. You cannot write to them directly via the API.
- For real-time incentive balances (points, rewards), use the dedicated incentive endpoints rather than aggregations.