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

# Build your own CRM dashboard

> Pull the numbers your integration dashboard shows (revenue, commission, sales and connected accounts) into your own dashboard.

- Source: https://www.dropfans.io/developers/guides/crm-dashboard
- Section: Guides
- OpenAPI: https://www.dropfans.io/developers/openapi.json

Your integration dashboard on DropFans (Dashboard → Developer) has three tabs: **Dashboard**, **Transactions** and **Accounts**. Each one has an endpoint that returns the same numbers, so your own dashboard can show what ours shows.

| Dashboard tab | Endpoint |
|---|---|
| Dashboard | [GET /api/external/crm/stats](https://www.dropfans.io/developers/reference/get-crm-stats.md) |
| Transactions | [GET /api/external/crm/transactions](https://www.dropfans.io/developers/reference/list-crm-transactions.md) |
| Accounts | [GET /api/external/crm/accounts](https://www.dropfans.io/developers/reference/list-crm-accounts.md) |
| Header (name, commission) | [GET /api/external/crm/app](https://www.dropfans.io/developers/reference/get-crm-app.md) |

> [!NOTE] Owner-held key
> Call these with a key your app owner holds: their own, or one their agency minted for its personas. They always answer for the key's own app. Never send `X-Dropfans-Account`. Personal keys and keys a creator minted for themselves get 403.

## Units

- Every amount is an **integer number of US cents** (`revenueCents: 4500` = $45.00), **excluding tax** and **before our platform fee**.
- `earningsCents` / `crmEarnedCents` is the commission **booked** for your app owner on the sale. It is paid out with the owner's other earnings, so "booked" is not "already paid".
- Revenue and commission leave out refunded and charged-back sales. Transactions list them by default with their `status`, like the dashboard does.

## Charts: stats

```bash
curl "https://www.dropfans.io/api/external/crm/stats?startDate=2026-10-01&endDate=2026-10-30&tz=America/New_York" \
  -H "Authorization: Bearer $APP_OWNER_KEY"
```

`totals` holds the headline tiles: revenue, commission, sales, newly connected accounts, and how many accounts are connected right now. `series` holds one bucket per hour, day, week or month, oldest first, with every empty bucket included as zero, so you can plot it as is.

- Days are cut in `tz` (any IANA name; Europe/Stockholm by default, like our dashboard). Each bucket's `start` is its exact UTC instant.
- Leave `granularity` out to get the dashboard's automatic choice, or ask for `hour` (up to 3 days), `day`, `week` or `month`. A range is at most 366 days.

## Tables: transactions

```js
async function allSales(since) {
  const out = [];
  let cursor = null;
  do {
    const q = new URLSearchParams({ since, limit: '100', ...(cursor ? { cursor } : {}) });
    const res = await fetch(`https://www.dropfans.io/api/external/crm/transactions?${q}`, {
      headers: { Authorization: `Bearer ${process.env.APP_OWNER_KEY}` },
    });
    const page = await res.json();
    out.push(...page.transactions);
    cursor = page.nextCursor;
  } while (cursor);
  return out;
}
```

Newest first, across all your accounts. Filter by `type`, by instants (`since` / `until`) or by calendar days (`startDate` / `endDate` in `tz`). Keep the other parameters unchanged while you follow `nextCursor`. For incremental syncs, store the newest `paidAt` you have and pass it as `since` next time. Upsert by `id`, because a sale's `status` can later change to `refunded` or `charged_back`.

## Accounts

[GET /crm/accounts](https://www.dropfans.io/developers/reference/list-crm-accounts.md) lists every account your app has generated links for, all-time: whether it is still `connected` to your app, how much it has sold through your links (`viaLinksCents`) and in total (`allTimeGrossCents`), and your commission. Agencies come with their creators as `children`. Use `flat=true` for one row per selling account, with `agencyId`.

An account is connected to the CRM that generated its links most recently. When another CRM did so after you, `movedAway.at` tells you when. We never tell you which CRM it was.

Next: [Webhooks & polling](https://www.dropfans.io/developers/webhooks/overview.md) for real-time sales, or [Creator sign-up from your platform](https://www.dropfans.io/developers/guides/creator-signup.md).

---

Previous: [Creator sign-up from your platform](https://www.dropfans.io/developers/guides/creator-signup.md) · Next: [Webhooks & polling](https://www.dropfans.io/developers/webhooks/overview.md) · All pages: [llms.txt](https://www.dropfans.io/developers/llms.txt)
