Skip to main content

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.

warning

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.

info

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 count of 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, and fiscal_id is null in 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. Use fiscalId=N/A (case-insensitive) to get the operations that have no fiscal ID, which are returned with fiscal_id set to N/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:

  • fromYear and fromMonth: the first month of the period
  • toYear and toMonth: 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 entry
  • year and month: the month the statistics refer to
  • fiscal_id: the fiscal ID the statistics refer to, N/A for operations without a fiscal ID, or null if they are aggregated
  • application: the application, for example it.api.acubeapi.com or stripe.acubeapi.com
  • operation_type: the type of operation, for example invoice-sent, invoice-received, notification-rc, signature, preservation or verify-cerca-imprese
  • amount: the cost in euros, VAT excluded, as a decimal string with four decimal places
  • count: the number of operations
  • calculated_at: when the statistics were last calculated

The application filter accepts the following values:

  • ae.api.acubeapi.com: UAE API Product
  • be.api.acubeapi.com: Belgium API Product
  • de.api.acubeapi.com: Germany API Product
  • fr.api.acubeapi.com: France API Product
  • it.api.acubeapi.com: Italy API Product
  • no.api.acubeapi.com: Norway API Product
  • pl.api.acubeapi.com: Poland API Product
  • peppol.api.acubeapi.com: Peppol API
  • ob.api.acubeapi.com: Open Banking API
  • preservation.api.acubeapi.com: Preservation API
  • shopper-hub.api.acubeapi.com: Connect Hub (formerly Shopper Hub)
  • stripe.acubeapi.com: Stripe Integration
  • nsofacile.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, toYear and toMonth are 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/fromMonth and toYear/toMonth query parameters instead of the year path parameter, up to 6 months per request
  • the fiscal ID filter is named fiscalId instead of fiscal_id
  • you can filter by application, and the results are paginated with the page parameter

For the complete list of parameters and responses, see the API reference of GET /usage-stats.