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

# Per-customer aggregations + drill-down series

> Returns the customer entity plus their purchase aggregates (count, total spent) and a gap-filled daily time-series of purchases in the requested window. Requires a Nevermined API key, organization admin privileges, and the Enterprise tier.



## OpenAPI

````yaml /api-reference/organizations-openapi.json get /organizations/{orgId}/customers/{customerId}/aggregations
openapi: 3.0.0
info:
  title: Nevermined Organizations API
  description: >-
    Manage a Nevermined organization programmatically — members, tiers, groups &
    budgets, treasury wallets, customers, webhooks, analytics, and
    agent-discovery surfaces.
  version: 1.0.0
  contact: {}
servers:
  - url: https://api.sandbox.nevermined.app/api/v1
    description: Sandbox
  - url: https://api.live.nevermined.app/api/v1
    description: Live
security: []
tags:
  - name: Organizations
    x-group: General
    description: Organization settings, members & roles, and workspace context.
  - name: Organizations - Billing
    x-group: Billing
    description: Tiers, subscriptions, invoices, checkout, and the public tier catalog.
  - name: Groups
    x-group: Groups & Budgets
    description: Organization groups, per-group budgets, and shared payment methods.
  - name: Organizations - Wallets
    x-group: Wallets
    description: Custodial stablecoin treasury wallets.
  - name: Organizations - Customers
    x-group: Customers
    description: The white-label customer CRM (Enterprise).
  - name: Organizations - Analytics
    x-group: Analytics
    description: Revenue, MRR, usage, conversion, and per-member metrics.
  - name: Organizations - Webhooks
    x-group: Webhooks
    description: Outbound webhook subscriptions and deliveries.
  - name: Organizations - Activity
    x-group: Activity
    description: The organization activity feed.
  - name: Organizations - Realtime
    x-group: Realtime
    description: Realtime WebSocket secret management (Enterprise).
  - name: Invitations
    x-group: Invitations
    description: Invite people to an organization.
  - name: Organizations - Integration
    x-group: Agent Discovery
    description: >-
      Public agent-discovery surfaces (llms.txt, agentic-instructions.md,
      ai-catalog.json).
paths:
  /organizations/{orgId}/customers/{customerId}/aggregations:
    get:
      tags:
        - Organizations - Customers
      summary: Per-customer aggregations + drill-down series
      description: >-
        Returns the customer entity plus their purchase aggregates (count, total
        spent) and a gap-filled daily time-series of purchases in the requested
        window. Requires a Nevermined API key, organization admin privileges,
        and the Enterprise tier.
      operationId: OrganizationCustomersController_getCustomerAggregations
      parameters:
        - name: orgId
          required: true
          in: path
          description: Organization ID
          schema:
            type: string
        - name: customerId
          required: true
          in: path
          description: Customer record ID
          schema:
            type: string
        - name: to
          required: false
          in: query
          description: ISO-8601 end.
          schema:
            type: string
        - name: from
          required: false
          in: query
          description: ISO-8601 start.
          schema:
            type: string
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CustomerAggregationsResponseDto'
        '401':
          description: Missing or invalid Nevermined API key
        '403':
          description: >-
            Caller is not an organization admin, or the org is not on the
            Enterprise tier
        '404':
          description: Customer not found
      security:
        - Authorization: []
components:
  schemas:
    CustomerAggregationsResponseDto:
      type: object
      properties:
        customer:
          description: The customer record.
          allOf:
            - $ref: '#/components/schemas/CustomerResponseDto'
        purchaseCount:
          type: number
          description: Count of purchase transactions in range.
          example: 4
        totalSpent:
          type: string
          description: Sum of purchase prices in range, serialised as a string (bigint).
          example: '12000000'
        timeSeries:
          description: Gap-filled daily series.
          type: array
          items:
            $ref: '#/components/schemas/CustomerTimeSeriesPointDto'
        from:
          type: string
          description: Start of the requested window (ISO-8601).
          example: '2026-03-01T00:00:00.000Z'
        to:
          type: string
          description: End of the requested window (ISO-8601).
          example: '2026-05-30T23:59:59.000Z'
      required:
        - customer
        - purchaseCount
        - totalSpent
        - timeSeries
        - from
        - to
    CustomerResponseDto:
      type: object
      properties:
        id:
          type: string
          description: Customer record ID.
          example: oc-7b1c3e9a
        orgId:
          type: string
          description: Organization the customer belongs to.
          example: org-abc123
        userId:
          type: string
          description: Nevermined user ID of the customer.
          example: us-2f4a6c8e
        firstSeenAt:
          type: string
          description: ISO-8601 timestamp the customer was first observed.
          example: '2026-01-15T09:30:00.000Z'
        lastActiveAt:
          type: string
          description: ISO-8601 timestamp of the customer’s most recent activity.
          example: '2026-05-20T14:05:00.000Z'
        totalSpent:
          type: string
          description: >-
            Total amount the customer has spent, serialised as a string
            (bigint).
          example: '125000000'
        createdAt:
          type: string
          description: ISO-8601 timestamp the customer record was created.
          example: '2026-01-15T09:30:00.000Z'
        status:
          description: >-
            Lifecycle status. `blocked` customers hold no valid org-issued
            credential and cannot be issued a new one until unblocked.
          example: active
          allOf:
            - $ref: '#/components/schemas/OrganizationCustomerStatus'
        userName:
          type: string
          description: Display name from the buyer’s user profile, when available.
          example: Aitor Argomaniz
          nullable: true
        userEmail:
          type: string
          description: Email from the buyer’s user profile, when available.
          example: aitor@example.com
          nullable: true
      required:
        - id
        - orgId
        - userId
        - firstSeenAt
        - lastActiveAt
        - totalSpent
        - createdAt
        - status
    CustomerTimeSeriesPointDto:
      type: object
      properties:
        date:
          type: string
          description: Bucket date in YYYY-MM-DD (UTC).
          example: '2026-05-01'
        purchases:
          type: number
          description: Number of purchases in this bucket.
          example: 5
        amount:
          type: string
          description: >-
            Sum of prices for purchases in this bucket, serialised as a string
            (bigint).
          example: '125000000'
      required:
        - date
        - purchases
        - amount
    OrganizationCustomerStatus:
      type: string
      enum:
        - active
        - blocked
  securitySchemes:
    Authorization:
      scheme: bearer
      bearerFormat: JWT
      type: http

````

## Related topics

- [Org-wide customer aggregations](/docs/api-reference/organizations--customers/org-wide-customer-aggregations.md)
- [Customers](/docs/solutions/organizations/customers.md)
- [Analytics](/docs/solutions/organizations/analytics.md)
- [Downgrade an Enterprise org to Premium without resubscribing](/docs/api-reference/organizations--billing/downgrade-an-enterprise-org-to-premium-without-resubscribing.md)
- [Per-customer purchase history](/docs/api-reference/organizations--customers/per-customer-purchase-history.md)
