> ## Documentation Index
> Fetch the complete documentation index at: https://docs.omneo.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Read Aggregations

> A `GET` to the `/profiles/{profileId}/aggregations` endpoint allows your application to retrieve a Profiles Aggregations.

```json theme={null}
{
  "profile_id": "922fafaf-1115-2221-a33-fed3333397",
  "shop_days": null,
  "spend_12m": 2000,
  "spend_all": 2000,
  "spend_atv_12m": 2000,
  "spend_atv_all": 2000,
  "spend_first_date": "2020-12-07 13:04:30",
  "spend_last_date": "2020-12-07 13:04:30",
  "dimension_frequency": "F1",
  "dimension_recency": "RC",
  "dimension_join": "JN",
  "channel": null,
  "shop_count": 1,
  "store_join": {
      "id": 1,
      "type": null,
      "name": "Omneo Store",
      "description": null,
      "phone": "1131131",
      "email": null,
      "timezone": null,
      "external_id": "M10",
      "external_code": "10",
      "is_published": true,
      "is_permanently_closed": false,
      "address": null,
      "normal_hours": [],
      "special_hours": [],
      "tags": [],
      "custom_fields": [],
      "created_at": "2020-05-18 08:52:49",
      "updated_at": "2020-08-25 08:59:51"
  },
  "likely_country": null,
  "likely_country_score": null,
  "purchased_brands": [
      "transaction-created"
  ],
  "most_transacted_location": {
      "id": 1,
      "type": null,
      "name": "Omneo Store",
      "description": null,
      "phone": "1131131",
      "email": null,
      "timezone": null,
      "external_id": "M10",
      "external_code": "10",
      "is_published": true,
      "is_permanently_closed": false,
      "address": null,
      "normal_hours": [],
      "special_hours": [],
      "tags": [],
      "custom_fields": [],
      "created_at": "2020-05-18 08:52:49",
      "updated_at": "2020-08-25 08:59:51"
  }
}
```

<Note>
  **Refreshing calculations**

  Aggregations are automatically recalculated with every transaction made against the profile.
  All calculations against a profile are refreshed at once.
</Note>

## Aggregation Properties

| Attribute                           | Description                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| ----------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| profile\_id `READ_ONLY`             | The profile\_id of the profile the aggregation belongs to                                                                                                                                                                                                                                                                                                                                                                                    |
| shop\_days `INTEGER`                | Average days between shops this represents the average of days between the customers purchases.                                                                                                                                                                                                                                                                                                                                              |
| spend\_12m `FLOAT`                  | The total dollar value spent over 12 months from the last recalculation date.                                                                                                                                                                                                                                                                                                                                                                |
| spend\_all `FLOAT`                  | The total dollar value spent since the profile was created                                                                                                                                                                                                                                                                                                                                                                                   |
| spend\_atv\_12m `FLOAT`             | The average transaction value over 12 months from the last recalculation date                                                                                                                                                                                                                                                                                                                                                                |
| spend\_atv\_all `FLOAT`             | The average transaction value since the profile was created                                                                                                                                                                                                                                                                                                                                                                                  |
| spend\_first\_date `DATE-TIME`      | Records the date of the Profiles first transaction converted to UTC timezone.                                                                                                                                                                                                                                                                                                                                                                |
| spend\_last\_date `DATE-TIME`       | Records the last date of the Profiles transacted converted to UTC timezone.                                                                                                                                                                                                                                                                                                                                                                  |
| dimension\_frequency `STRING`       | A two character code that denotes the frequency the customer shops. F0 = Never shopped F1 = Shopped once F2 = Shopped twice FL = Shopped +3 times & frequency between shops is greater than 30 days FH = Shopped +3 times & frequency between shops is less than 30 days                                                                                                                                                                     |
| dimension\_recency `STRING`         | A two character code that denotes how recent the customer has shopped R0 - Never shopped RC - Shopped within the last 3 months RS - Shopped within the last 6 months RA - Shopped within the last 12 months RI - Shopped over 12 months ago.                                                                                                                                                                                                 |
| dimension\_join `STRING`            | A two character code that denotes the profiles join lifecycle stage. JN = New, where join date is less than or equal to 90 days ago JC = Current, where join date is greater than 90 days but less than or equal to 365 days ago J1 = represents 1 year, where join date is greater than 365 days but less or equal to 730 days J2 = represents 2 years, where join date is greater than 730 days but less or equal to 1095 days J3, J4, etc |
| channel `STRING`                    | A two character code that denotes the channels the customer has used to shop CM - Point of Sale, and Website CF - Point of Sale only CO- Website Only                                                                                                                                                                                                                                                                                        |
| shop\_count `INTEGER`               | The count of total profile transactions, with transactions greater than \$0                                                                                                                                                                                                                                                                                                                                                                  |
| store\_join `STRING`                | the store of the profiles first transaction. This is the first store the profile shopped at                                                                                                                                                                                                                                                                                                                                                  |
| likely\_country `STRING`            | The likely country of this profile. This is the result of an internal calculation of recent transactions, joined location, preferred location and stored addresses                                                                                                                                                                                                                                                                           |
| likely\_country\_score `INTEGER`    | This is a numerical score given to the strength of the prediction. with 1 being the highest                                                                                                                                                                                                                                                                                                                                                  |
| purchased\_brands `ARRAY`           | An array representing all brands of all products the customer has purchased.                                                                                                                                                                                                                                                                                                                                                                 |
| most\_transacted\_location `STRING` | The store with the most transactions in the last 2 years. If no transactions have been placed in the last 2 years, this is instead a calculation of transactions for all time                                                                                                                                                                                                                                                                |


## OpenAPI

````yaml get /v3/profiles/{profile}/aggregations
openapi: 3.1.0
info:
  title: Omneo
  version: 0.0.1
servers:
  - url: https://api.{tenant}.getomneo.com/api
    variables:
      tenant:
        default: example
security: []
paths:
  /v3/profiles/{profile}/aggregations:
    get:
      tags:
        - Profile Aggregation
      summary: Read Aggregations
      description: >-
        A `GET` to the `/profiles/{profileId}/aggregations` endpoint allows your
        application to retrieve a Profiles Aggregations.
      operationId: profileAggregation.show
      parameters:
        - name: profile
          in: path
          required: true
          description: The profile ID
          schema:
            type: string
            format: uuid
      responses:
        '200':
          description: '`ProfileAggregation`'
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/ProfileAggregation'
                required:
                  - data
        '401':
          $ref: '#/components/responses/AuthenticationException'
        '403':
          $ref: '#/components/responses/AuthorizationException'
        '404':
          $ref: '#/components/responses/ModelNotFoundException'
components:
  schemas:
    ProfileAggregation:
      type: object
      properties:
        profile_id:
          type: string
        shop_days:
          type: string
        spend_12m:
          type: string
        spend_12m_now:
          type: string
        spend_all:
          type: string
        spend_atv_12m:
          type: string
        spend_atv_all:
          type: string
        discount_avg:
          type: string
        spend_first_date:
          type: string
        spend_last_date:
          type: string
        dimension_frequency:
          type: string
        dimension_recency:
          type: string
        dimension_join:
          type: string
        channel:
          type: string
        shop_count:
          type: string
        total_referred:
          type: string
        store_join:
          $ref: '#/components/schemas/Location'
        likely_country:
          type: string
        likely_country_score:
          type: string
        purchased_brands:
          type: string
        total_shop_days:
          type: string
        first_shop_days:
          type: string
        second_shop_days:
          type: string
        latest_shop_days:
          type: string
        average_shop_days:
          type: string
        second_shop_date:
          type: string
        previous_shop_date:
          type: string
        at_risk_date:
          type: string
        most_transacted_location:
          $ref: '#/components/schemas/Location'
        most_spend_location:
          $ref: '#/components/schemas/Location'
        most_spend_12m_location:
          $ref: '#/components/schemas/Location'
        latest_shop_spend:
          type: string
        latest_shop_currency:
          $ref: '#/components/schemas/Currency'
        latest_transacted_location:
          $ref: '#/components/schemas/Location'
        transacted_locations:
          type: string
        likely_country_iso:
          type: string
        likely_country_iso_score:
          type: string
        likely_state_iso:
          type: string
        likely_state_iso_score:
          type: string
        likely_region:
          type: string
        likely_region_score:
          type: string
        top_historic_status:
          $ref: '#/components/schemas/StatusOriginal'
      required:
        - profile_id
        - shop_days
        - spend_12m
        - spend_12m_now
        - spend_all
        - spend_atv_12m
        - spend_atv_all
        - discount_avg
        - spend_first_date
        - spend_last_date
        - dimension_frequency
        - dimension_recency
        - dimension_join
        - channel
        - shop_count
        - total_referred
        - store_join
        - likely_country
        - likely_country_score
        - purchased_brands
        - total_shop_days
        - first_shop_days
        - second_shop_days
        - latest_shop_days
        - average_shop_days
        - second_shop_date
        - previous_shop_date
        - at_risk_date
        - most_transacted_location
        - most_spend_location
        - most_spend_12m_location
        - latest_shop_spend
        - latest_shop_currency
        - latest_transacted_location
        - transacted_locations
        - likely_country_iso
        - likely_country_iso_score
        - likely_state_iso
        - likely_state_iso_score
        - likely_region
        - likely_region_score
        - top_historic_status
      title: ProfileAggregation
    Location:
      type: object
      properties:
        id:
          type: integer
        type:
          type:
            - string
            - 'null'
        name:
          type:
            - string
            - 'null'
        handle:
          type:
            - string
            - 'null'
        description:
          type:
            - string
            - 'null'
        phone:
          type:
            - string
            - 'null'
        email:
          type:
            - string
            - 'null'
        timezone:
          type:
            - string
            - 'null'
        external_id:
          type:
            - string
            - 'null'
        external_code:
          type:
            - string
            - 'null'
        is_published:
          type: boolean
        is_permanently_closed:
          type: boolean
        address:
          $ref: '#/components/schemas/Address'
        normal_hours:
          type: array
          items:
            $ref: '#/components/schemas/LocationHour'
        special_hours:
          type: array
          items:
            $ref: '#/components/schemas/LocationHour'
        tags:
          type: array
          items:
            $ref: '#/components/schemas/Tag'
        custom_fields:
          type: object
          additionalProperties: {}
        icon:
          type:
            - string
            - 'null'
        country_iso_3:
          type:
            - string
            - 'null'
        image_url:
          type:
            - string
            - 'null'
        created_at:
          type: string
        updated_at:
          type: string
        departments:
          type: array
          items:
            $ref: '#/components/schemas/Department'
      required:
        - id
        - type
        - name
        - handle
        - description
        - phone
        - email
        - timezone
        - external_id
        - external_code
        - is_published
        - is_permanently_closed
        - address
        - normal_hours
        - special_hours
        - tags
        - custom_fields
        - icon
        - country_iso_3
        - image_url
        - created_at
        - updated_at
        - departments
      title: Location
    Currency:
      type: object
      properties:
        id:
          type: integer
        from:
          type: string
        to:
          type: string
        rate:
          type: number
        is_system:
          type: boolean
        created_at:
          type: string
        updated_at:
          type: string
      required:
        - id
        - from
        - to
        - rate
        - is_system
        - created_at
        - updated_at
      title: Currency
    StatusOriginal:
      type: object
      properties:
        id:
          type: string
        name:
          type: string
        handle:
          type: string
        sort_order:
          type: string
        description:
          type: string
        short_description:
          type: string
        long_description:
          type: string
        terms_conditions:
          type: string
        icon:
          type: string
        image_url:
          type: string
        earn_instructions:
          type: string
        colour:
          type: string
        primary_colour:
          type: string
        secondary_colour:
          type: string
        text_colour:
          type: string
        code:
          type: string
        internal_notes:
          type: string
        group_name:
          type: string
        group_handle:
          type: string
        timezone:
          type: string
        period:
          type: string
        period_type:
          type: string
        absolute_expiry:
          type: string
        created_at:
          type: string
        updated_at:
          type: string
      required:
        - id
        - name
        - handle
        - sort_order
        - description
        - short_description
        - long_description
        - terms_conditions
        - icon
        - image_url
        - earn_instructions
        - colour
        - primary_colour
        - secondary_colour
        - text_colour
        - code
        - internal_notes
        - group_name
        - group_handle
        - timezone
        - period
        - period_type
        - absolute_expiry
        - created_at
        - updated_at
      title: StatusOriginal
    Address:
      type: object
      properties:
        id:
          type: integer
        address_line_1:
          type: string
        address_line_2:
          type:
            - string
            - 'null'
        address_line_3:
          type:
            - string
            - 'null'
        company:
          type:
            - string
            - 'null'
        latitude:
          type:
            - number
            - 'null'
        longitude:
          type:
            - number
            - 'null'
        city:
          type: string
        postcode:
          type: string
        state:
          type:
            - string
            - 'null'
        country:
          type: string
        notes:
          type:
            - string
            - 'null'
        external_id:
          type:
            - string
            - 'null'
        is_default:
          type: boolean
        created_at:
          type: string
        updated_at:
          type: string
        meta:
          type:
            - array
            - 'null'
          items: {}
        name:
          type:
            - string
            - 'null'
        type:
          type:
            - string
            - 'null'
        phone:
          type:
            - string
            - 'null'
        iso:
          type:
            - string
            - 'null'
        iso_state:
          type:
            - string
            - 'null'
        profile_id:
          type:
            - string
            - 'null'
        custom_fields:
          type: object
          additionalProperties: {}
      required:
        - id
        - address_line_1
        - address_line_2
        - address_line_3
        - company
        - latitude
        - longitude
        - city
        - postcode
        - state
        - country
        - notes
        - external_id
        - is_default
        - created_at
        - updated_at
        - meta
        - name
        - type
        - phone
        - iso
        - iso_state
        - profile_id
        - custom_fields
      title: Address
    LocationHour:
      type: array
      items: {}
      title: LocationHour
    Tag:
      type: string
      title: Tag
    Department:
      type: object
      properties:
        id:
          type: integer
        name:
          type:
            - string
            - 'null'
        handle:
          type: string
        external_id:
          type:
            - string
            - 'null'
        external_code:
          type:
            - string
            - 'null'
        description:
          type:
            - string
            - 'null'
        short_description:
          type:
            - string
            - 'null'
        url:
          type:
            - string
            - 'null'
        image_url:
          type:
            - string
            - 'null'
        internal_note:
          type:
            - string
            - 'null'
        meta:
          type:
            - array
            - 'null'
          items: {}
        brand_id:
          type: integer
        location_id:
          type:
            - integer
            - 'null'
        brand:
          type: object
          properties:
            name:
              type: string
            handle:
              type: string
          required:
            - name
            - handle
        created_at:
          type: string
        updated_at:
          type: string
      required:
        - id
        - name
        - handle
        - external_id
        - external_code
        - description
        - short_description
        - url
        - image_url
        - internal_note
        - meta
        - brand_id
        - location_id
        - brand
        - created_at
        - updated_at
      title: Department
  responses:
    AuthenticationException:
      description: Unauthenticated
      content:
        application/json:
          schema:
            type: object
            properties:
              message:
                type: string
                description: Error overview.
            required:
              - message
    AuthorizationException:
      description: Authorization error
      content:
        application/json:
          schema:
            type: object
            properties:
              message:
                type: string
                description: Error overview.
            required:
              - message
    ModelNotFoundException:
      description: Not found
      content:
        application/json:
          schema:
            type: object
            properties:
              message:
                type: string
                description: Error overview.
            required:
              - message

````