# Get billing by module
URL: https://docs.fluenta.io/docs/reference/analytics/get-billing-by-module
Operation: `getBillingByModule`
Required permission: `read`

`GET /v1/external/organizations/{organizationId}/analytics/billing/modules`

«Facturación por módulo» for one plant day: each módulo’s billed units and amount, in the plant’s currency.

What it is: «Facturación por módulo», the table of the dashboard’s «Reportes», tab «Facturación», for one plant day: one row per «módulo» that billed, with the units it bills (`billableUnits`) and what they are worth (`billedAmount`). A «módulo» that billed nothing that day is no row.

How it is computed: the units of the «módulo»’s «puestos de salida» (the «puestos» whose output the plant invoices its client for), each at the price per unit of its «referencia» that day, plus an hour whose «conteo manual» was typed while no «puesto» held that role, at the price its «referencia» billed at that day. Summed per «módulo», then rounded to 2 decimals once.

Money is «Facturación»: the units of the «puestos de salida» × the price per unit each was billed at, in the plant’s currency (`currency`, ISO 4217: `EUR` for a plant in España, `COP` for every other), in whole currency units with up to 2 decimals, never cents. Whether a money figure reads null or 0 where nothing was priced is stated on each field.

Days and hours are the plant’s own: a plant day is a calendar day `YYYY-MM-DD` in the organization’s timezone (`getOrganization` `timezone`), never UTC, and an `hour` is the clock hour 0–23 that starts at it in that zone. `day` is optional: without it, the plant’s today on the organization’s own clock, as on every single-day route of the API externa; the answer’s `day` says which day was read.

Plan: needs the plan feature `billingAnalytics` («Facturación»), the one its dashboard screen is gated by. Pro, a trial of Pro and an «exenta» organization answer it; a Light organization, of either plan version, does not: 403 `PLAN_LIMIT` with `feature: "billingAnalytics"`. `getPlan` `features` lists what the organization’s plan has.

See also: `getBilling` for «Facturación» over a range, by day, «módulo», «operario» or «puesto»; `getMonth` for the last 30 days in one call.

### Authorization

- `apiToken` — Bearer token. An API token created in Configuración › Tokens de API, or a connected app’s access token

Send it as `Authorization: Bearer <your API token>`.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `day` | query | string | no | Plant day, YYYY-MM-DD on the plant’s clock. Omitted: the plant’s today, on its own clock. |
| `organizationId` | path | integer | yes | The organization, from `getMe` or `listOrganizations`. |

### Responses

| Status | Description |
| --- | --- |
| `200` | The day’s «Facturación», one row per «módulo» that billed. |
| `400` | `INVALID_DAY`: `day` is not a real calendar day written `YYYY-MM-DD`. `INVALID_REQUEST`: a query parameter is missing, of the wrong type or outside its allowed values; `details` lists each one as `{field, message}`. Body: `{statusCode, code, message}`, the message in Spanish, for the usuario. |
| `401` | Missing, malformed, unknown, expired or revoked credential: `INVALID_API_TOKEN`. |
| `402` | The organization is blocked: `ORG_BLOCKED`. |
| `403` | `PLAN_LIMIT` with `feature: "billingAnalytics"`: the organization’s plan lacks «Facturación» (Pro, a trial of Pro and an «exenta» organization answer it; a Light organization, of either plan version, does not). `PLAN_LIMIT` with `feature: "aiConnector"`: a connected app reads an organization without «Conectar con IA». `INSUFFICIENT_SCOPE`: the credential lacks the «Permiso» `read`. Retrying does not help: the plan or the credential has to change. |
| `404` | `ORGANIZATION_NOT_FOUND`: the organization does not exist or is out of the credential’s reach. One body for a row that is missing and for one of another organization. |
| `429` | The credential is over its rate limit: `RATE_LIMITED`. Per credential, in fixed windows of 60 seconds: 60 requests in one organization on Light and 120 on Pro; 20 on the heavy reads (the range figures, the whole floor, the month and the pauses); 300 across every organization; 60 on the routes that name no organization. Wait `Retry-After` seconds; a refused request counts against nothing. |

### Example

```bash
curl -X GET 'https://api.fluenta.io/v1/external/organizations/{organizationId}/analytics/billing/modules' \
  -H 'Authorization: Bearer <your API token>'
```