# See your money and resources over time

> Read an organization's payments, refunds and net by day, and the memory, storage, CPU and traffic its customers' servers use, in Analytics.

Source: https://www.coritan.com/docs/organizations/analytics/

In the dashboard:

- Partner dashboard: /org/…/analytics: https://partners.coritan.com
- Partner dashboard: /org/…/analytics/resources: https://partners.coritan.com

**Analytics** charts an organization's money and its servers' resources over a period you choose. The **Money** tab shows what payment gateways took from your customers and what went back as refunds. The **Resources** tab shows what your customers' servers hold now, and on the Resources billing basis how much memory, storage, CPU and traffic they used each day and what that cost you.

## Before you begin

- **Money** needs the owner, admin or billing role. Another member sees a notice that names the role, with **Back to Home**.
- **Resources** opens for every member while the **Hosting** module is on ([Choose what your dashboard shows](/docs/organizations/modules/)). The cost figures on it need the owner, admin or billing role.
- Daily memory, storage, CPU, traffic and cost figures exist only on the Resources billing basis ([Choose how you pay for compute](/docs/organizations/billing/usage-and-cost/#choose-your-billing-basis)). An organization that pays by plan sees what its servers hold now, and a note that says why the charts are missing. One of Coritan's own organizations sees the daily figures as a simulation of what it would pay, and nothing is charged.

## Read the money figures

1. In the [partner dashboard](https://partners.coritan.com), open your organization. In the sidebar, select **Analytics**. It opens on the **Money** tab.
2. Choose the period: **7 days**, **30 days**, **90 days** or **12 months**. The period ends today (UTC) and stays in the page's address, so a reload or a shared link opens the same view.
3. Read the six tiles. Each shows its change against the period of the same length before:

   | Tile | What it is |
   | --- | --- |
   | **Gross** | The money gateways took in the period. |
   | **Refunds** | The money that went back out: refunds and chargebacks. |
   | **Net** | **Gross** less **Refunds**. |
   | **Payments** | How many payments made up the gross. |
   | **Average payment** | **Gross** over **Payments**. |
   | **Refund rate** | The share of the gross that went back as refunds. |

4. Read the charts. **Gross and net** draws each day's payments before and after refunds, and **Payments and refunds** draws the money taken each day with the refunds below the line. Over 12 months both draw a point for each month. **By source** splits the gross between hosting and your store, and **By payment method** splits it by who took the payment.
5. To read a chart's figures as a table, turn on **Show as table** on its card.
6. Select **Export CSV** to download the daily figures for the period.

Money taken in a currency other than the organization's main one is named in a line under the charts, and is in none of the figures above it.

### What the money figures count {#what-the-money-figures-count}

- The gross is money a gateway took: hosting payments, wallet top-ups and your store's captured live payments.
- An invoice you marked paid, an invoice paid from wallet credit, credit you granted, a store payment that was never captured and a test order moved no money, so they are left out.
- Refunds are hosting refunds and chargebacks, and store refunds that succeeded. A refund the bank returned cancels the refund it undoes.
- Money is never added across currencies. The figures are in the currency with the most money in the period, or the organization's default currency when the period is empty.

The [platform cut](/docs/organizations/billing/platform-cut/) and your [payouts](/docs/organizations/billing/payouts/) are worked out by calendar month, so their figures differ from a period that ends today.

## Read the resource figures

1. In **Analytics**, open the **Resources** tab.
2. Read the four tiles: **Servers** (the game servers and virtual machines behind your services that have not ended), **Running** (those whose recorded power state is running), **Memory allocated** and **Storage allocated**.
3. On the Resources billing basis, choose the period and read the charts. They draw, for each day, the memory and storage in use on average, the CPU in use on average, the traffic sent out and, for Billing and above, what the day cost you.
   - A day is added once it is over and rated, so today and sometimes yesterday are missing.
   - A day on which CPU or traffic was not measured has no figure for it. That is not a day on which nothing was used.
   - The cost is every resource together.
4. Read **By product**: for each of your products, how many **Servers** it has, the **Memory** and **Storage** they hold now, and the CPU and traffic they used in the period. Billing and above also see what each product cost in the period. The table lists the 20 products with the most memory.

On the **Plans** basis the page shows the tiles, the note and **By product** only. For Billing and above, **Open Resource costs** in the note opens the page where the owner compares the two bases ([See what your customers' use costs you](/docs/organizations/billing/usage-and-cost/)).

## Troubleshooting

The **Resources** tab is missing
: The **Hosting** module is off. An owner or admin turns it on under **Settings**, on the **Dashboard** tab.

The charts on **Resources** are missing
: The organization pays by plan, so no day is rated. The tiles and **By product** still show what the servers hold now.

A chart says **No day has been rated in this period**
: A day is rated after it closes, so today's use is not in the charts yet.

**Gross** is lower than the invoices paid in the period
: Invoices marked paid, and invoices paid from credit, are not money a gateway took.

## Related

- [Read your organization's Home page](/docs/organizations/overview/)
- [See what your customers' use costs you](/docs/organizations/billing/usage-and-cost/)
- [See every payment](/docs/organizations/billing/payments/)
- [Generate organization statements](/docs/organizations/billing/statements/)
- [Read your storefront's traffic](/docs/organizations/traffic/)

## With the API

Both routes take `days`: `7`, `30`, `90` or `365`, and `30` when you leave it out. Any other number answers `422` with `days must be one of 7, 30, 90, 365`. The window ends today (UTC).

The money route takes the owner, admin or billing role, and answers anyone else `403`:

```bash
curl "https://api.coritan.com/api/v1/orgs/acme/analytics/money?days=30" \
  -H "Authorization: Bearer $CORITAN_TOKEN"
```

The answer has `currency`, `from`, `to`, `days` and:

| Field | What it holds |
| --- | --- |
| `series` | One row per day from `from` to `to`, oldest first: `date`, `gross`, `refunds`, `net` and `payments`. A day with no money has zeros. |
| `totals` | `gross`, `refunds`, `net`, `payments`, `refund_count` and `average_payment` for the window. |
| `previous` | The same figures for the window of the same length before `from`. |
| `by_source` | `source`, `label`, `gross` and `payments` for `hosting`, and for `store` when the organization has a store. |
| `by_method` | `method`, `label`, `gross` and `payments` for each family that took a payment, largest first: `stripe`, `paypal`, `square`, `paynow`, `oceanpayment`, `crypto`, `external` for the store's own payment page, or the account's own name. |
| `other_currencies` | `currency`, `gross` and `payments` for the window's payments in each other currency. |

Amounts are strings with two decimals, and counts are numbers. `refunds` is a positive figure. A store chargeback is not in `refunds`.

The resources route takes any member:

```bash
curl "https://api.coritan.com/api/v1/orgs/acme/analytics/resources?days=30" \
  -H "Authorization: Bearer $CORITAN_TOKEN"
```

The answer has `from`, `to`, `days`, `currency` and:

| Field | What it holds |
| --- | --- |
| `metered` | `true` when Coritan rates each server's use per day: on the `usage` billing basis, and for one of Coritan's own organizations. |
| `simulated` | `true` for one of Coritan's own organizations: the figures are what it would pay, and nothing is charged. |
| `now` | `services`, `running`, `memory_gb` and `storage_gb`: what the servers are allocated now. |
| `series` | When `metered`, one row per day, oldest first: `date`, `memory_gb_hours`, `storage_gb_hours`, `memory_gb` and `storage_gb` (the day's average in use, the GB-hours over 24), `cpu_vcpu_hours` (the CPU time used), `cpu_vcpus` (the day's average vCPUs in use, the hours over 24), `traffic_gb` (the data sent out) and `cost`. `cpu_vcpu_hours`, `cpu_vcpus` and `traffic_gb` are `null` for a day on which nothing was measured. Otherwise the list is empty. |
| `totals` and `previous` | `memory_gb_hours`, `storage_gb_hours`, `cpu_vcpu_hours`, `traffic_gb` and `cost` for the window and for the one before. CPU and traffic add up the days that were measured, and read `0` when none was. |
| `by_product` | `product_id`, `name`, `services`, `memory_gb`, `storage_gb`, `cpu_vcpu_hours` and `traffic_gb` (the window's use, `null` when nothing was measured) and `cost` for the 20 products with the most memory. |

`cost` is what the organization pays Coritan for the use, every resource together, in US dollars, as a string with four decimals. It is `null` for a member below the billing role, and for every member when `metered` is `false`. Quantities are strings with at most three decimals.

## API

- `GET /api/v1/orgs/{org_slug}/analytics/money`: Money in and money handed back per day (https://www.coritan.com/docs/api/reference/organizations/organizations-members/analytics/#op-get-api-v1-orgs-org-slug-analytics-money)
- `GET /api/v1/orgs/{org_slug}/analytics/resources`: What the organization's customer servers hold now and used per day (https://www.coritan.com/docs/api/reference/organizations/organizations-members/analytics/#op-get-api-v1-orgs-org-slug-analytics-resources)
