---
title: "Every customer with spend in a window"
method: GET
path: "/credits/analytics/customers"
tags: ["Customers"]
---

# Every customer with spend in a window

`GET /credits/analytics/customers`

## Request

- Base URL: `https://api.paywithlocus.com/api`
- URL: `https://api.paywithlocus.com/api/credits/analytics/customers`
- Auth: one of:
  - HTTP bearer
  - HTTP bearer

Each (attribution.source, customerId) pair the tenant's charges were attributed to in the window, counted exactly as analytics counts customer spend, named from the customer directory, filterable by product, searchable, and paged past the analytics row cap. sources totals every product with customer spend in the window and ignores source and q. Enterprise workspaces only.

## Query parameters

- `days` 7 | 30 | 90
- `from` string, date-time
- `to` string, date-time
- `source` string
- `q` string
- `offset` integer
- `limit` integer

## Response `200`

One page of customers, the matching total, and per-product totals

- object
  - `success` true, required
  - `periodStart` string, date-time, required
  - `periodEndExclusive` string, date-time, required
  - `total` integer, required: Customers matching source and q, across all pages.
  - `customers` CustomerSpend[], required
    - `spenderId` string, required: <URL-encoded source>/<customerId>; focuses analytics as initiator=customer:<spenderId>.
    - `source` string, required
    - `customerId` string, required
    - `name` string, nullable, required
    - `url` string, nullable, required
    - `adminUrl` string, nullable, required
    - `usageUsdc` string, required
    - `calls` integer, required
    - `providers` integer, required
    - `firstChargeAt` string, date-time, required
    - `lastChargeAt` string, date-time, required
  - `sources` AnalyticsCustomerSource[], required
    - `source` string, required
    - `customers` integer, required
    - `usageUsdc` string, required
    - `calls` integer, required

## Other responses

- `400`: Invalid window, page, source, or search
- `401`: Missing, invalid, expired, or revoked management credential
- `403`: The authenticated management credential lacks one or more required scopes
- `503`: Too many analytics reads in flight; retry after Retry-After seconds

---

[API](https://skmtc.dev/paywithlocus/apis/locus-pro-api.md) - [All operations](https://skmtc.dev/paywithlocus/apis/locus-pro-api/llms.txt) - [OpenAPI document](https://skmtc.dev/paywithlocus/apis/locus-pro-api/revisions/aab8fa5d6cef?raw)
