Revenue
Revenue resumes per fiscal entity with per-FE status, forward projection, and aggregated totals. Monthly-refreshed cache with premature-detection for MEI and non-MEI entities.
TL;DR
Revenue resumes
A revenue resume aggregates the total invoiced amount for a fiscal entity in the current fiscal year. It includes:
- Total invoiced — sum of all issued invoices for the year
- Annual limit — the maximum allowed (R$ 81,000 for MEI, configurable for others)
- Forward projection — ok / warning / danger based on current pace
- Errored months — months where data fetch failed
- Processing months — months currently being fetched
The cache is refreshed monthly. After a month closes, the system fetches the previous month's data from the invoice provider (eNotas). The premature-detection feature flags entities that may exceed their limit before year-end.
Per-entity queries
Revenue can be queried at different levels:
Per business
Aggregate revenue across all professionals in a business. Use /businesses/{id}/revenue.
Per professional
Revenue for a specific professional across all their fiscal entities. Use /professionals/{id}/fiscal-entity/revenue.
Per fiscal entity
Revenue for a specific CNPJ/CPF. Use /professional-fiscal-entities/revenue with filter parameters.
Status machine
Each revenue resume entry has a status that tracks the data fetch lifecycle:
If the fetch fails:
- none — no data fetched yet for this month
- requested — data fetch has been triggered
- fetched — data successfully retrieved and cached
- errored — fetch failed, will be retried on next cycle
Endpoints
| Method | Path | Purpose |
|---|---|---|
| GET | /businesses/{id}/revenue | Aggregate revenue for all professionals in a business. |
| GET | /professionals/{id}/fiscal-entity/revenue | Revenue for a specific professional across all fiscal entities. |
| GET | /professional-fiscal-entities/revenue | Revenue for specific fiscal entities. Use ?filter[fiscal_entity_id]=... to narrow. |
All endpoints require Authorization: Bearer <jwt> and ilm-business: <id>.