Usage statistics
A-Cube API lets you monitor how many operations you performed (invoices sent and received, notifications, signatures, preservations, and so on) and how much they cost.
Legacy endpoint (Italy only)
The legacy endpoint GET /invoices/stats/:year only covers Italy and will be deprecated in June 2027. Use the endpoint described in this page instead. See Migrating from the legacy endpoint.
Italy data availability: the complete data for 2025 and 2026 using the new endpoint will be available starting from January 2027. Until then, only the data from April 2026 onwards is available.
All the other countries: the endpoint is already operational and includes all the data of interest.
What you can get
Each statistic refers to a single month and tells you, for a given application and operation type:
- the
countof operations performed - the
amount, which is the cost of those operations, in euros and VAT excluded
For example, you can find out how many invoices you sent through it.api.acubeapi.com in April and how much they cost.
The figures of the current month are partial: they are recalculated periodically, and calculated_at tells you when each entry was last updated.
Granularity
You decide how detailed the statistics are with the fiscalId filter:
- Aggregated: without
fiscalId, the statistics are the total across all your fiscal IDs, andfiscal_idisnullin the response. - Per fiscal ID: with
fiscalId, you only get the statistics of that fiscal ID. This is useful, for example, to split the costs among the companies you manage. UsefiscalId=N/A(case-insensitive) to get the operations that have no fiscal ID, which are returned withfiscal_idset toN/A.
You can also restrict the statistics to one or more applications with the application filter.
Choosing the period
By default, the statistics of the current month are returned. To get a different period, provide all of the following query parameters together:
fromYearandfromMonth: the first month of the periodtoYearandtoMonth: the last month of the period
Both ends are included, and a single request can cover up to 6 months. To cover a longer span, split it into multiple requests.
Retrieving the statistics
Authenticate with the JWT you obtain from the login, then call GET /usage-stats.
For example, the statistics of March and April 2026 for the it.api.acubeapi.com application, across all your fiscal IDs:
curl --request GET \
--url 'https://common-sandbox.api.acubeapi.com/usage-stats?application=it.api.acubeapi.com&fromYear=2026&fromMonth=3&toYear=2026&toMonth=4' \
--header 'Authorization: Bearer <token>' \
--header 'Accept: application/json'
The response contains one entry for each month and operation type:
[
{
"uuid": "c4d3aa59-8902-4e8a-a2ad-a352be91acc9",
"year": 2026,
"month": 4,
"fiscal_id": null,
"application": "it.api.acubeapi.com",
"operation_type": "invoice-sent",
"amount": "4.2600",
"count": 71,
"calculated_at": "2026-05-03T02:01:20+00:00"
},
{
"uuid": "7b1e0f4a-3d52-4c8e-9a61-5f2d8c0b9e17",
"year": 2026,
"month": 4,
"fiscal_id": null,
"application": "it.api.acubeapi.com",
"operation_type": "invoice-received",
"amount": "5.7600",
"count": 96,
"calculated_at": "2026-05-03T02:01:20+00:00"
}
]
Each entry contains:
uuid: the identifier of the entryyearandmonth: the month the statistics refer tofiscal_id: the fiscal ID the statistics refer to,N/Afor operations without a fiscal ID, ornullif they are aggregatedapplication: the application, for exampleit.api.acubeapi.comorstripe.acubeapi.comoperation_type: the type of operation, for exampleinvoice-sent,invoice-received,notification-rc,signature,preservationorverify-cerca-impreseamount: the cost in euros, VAT excluded, as a decimal string with four decimal placescount: the number of operationscalculated_at: when the statistics were last calculated
The application filter accepts the following values:
ae.api.acubeapi.com: UAE API Productbe.api.acubeapi.com: Belgium API Productde.api.acubeapi.com: Germany API Productfr.api.acubeapi.com: France API Productit.api.acubeapi.com: Italy API Productno.api.acubeapi.com: Norway API Productpl.api.acubeapi.com: Poland API Productpeppol.api.acubeapi.com: Peppol APIob.api.acubeapi.com: Open Banking APIpreservation.api.acubeapi.com: Preservation APIshopper-hub.api.acubeapi.com: Connect Hub (formerly Shopper Hub)stripe.acubeapi.com: Stripe Integrationnsofacile.it: NSO Facile
The statistics you receive depend on the services enabled on your account. If there are no statistics for the requested filters, the response is an empty array.
To retrieve a single entry, call GET /usage-stats/{uuid}. You can only access your own statistics.
Errors
The request is rejected with 400 Bad Request if:
- only some of
fromYear,fromMonth,toYearandtoMonthare provided - the end of the period precedes its start
- the period is longer than 6 months
A request without a valid token is rejected with 401 Unauthorized.
Migrating from the legacy endpoint
The new endpoint replaces GET /invoices/stats/:year. The main differences are:
- the endpoint is part of the Common API instead of the Italian API
- the period is chosen with the
fromYear/fromMonthandtoYear/toMonthquery parameters instead of theyearpath parameter, up to 6 months per request - the fiscal ID filter is named
fiscalIdinstead offiscal_id - you can filter by
application, and the results are paginated with thepageparameter
For the complete list of parameters and responses, see the API reference of GET /usage-stats.