---
title: "Get VeriFactu stats"
method: GET
path: "/companies/{company}/verifactu/stats"
tags: ["VeriFactu"]
---

# Get VeriFactu stats

`GET /companies/{company}/verifactu/stats`

## Request

- Base URL: `https://api.factuarea.com/v1`
- URL: `https://api.factuarea.com/v1/companies/{company}/verifactu/stats`
- Auth: one of:
  - HTTP bearer
  - API key in header `X-API-Key`

Return aggregated KPIs of your VeriFactu records: totals, counts per status, breakdown by record and invoice type and last transmission time.
- Optional filters: `date_from`, `date_to`, `environment`.
- `pending_incident_count`, `blocked_incident_count` and `oldest_pending_at` report the pending-remission alert and ignore the filters.

## Path parameters

- `company` string, uuid, required

## Query parameters

- `status` string
- `record_type` string
- `invoice_type` string
- `date_from` string
- `date_to` string
- `environment` string

## Headers

- `Factuarea-Version` string, date

## Response `200`

- object
  - `data` VeriFactuStats, required: Aggregated summary of the VeriFactu records of the authenticated company: counts by status and breakdown by type. Returned by `GET /v1/companies/{company}/verifactu/stats`.
    - `object` 'verifactu_stats', required
    - `total_records` integer, required: Total number of VeriFactu records.
    - `pending` integer, required: Records pending transmission.
    - `submitted` integer, required: Records submitted to AEAT (without a final response yet).
    - `accepted` integer, required: Records accepted by AEAT.
    - `rejected` integer, required: Records rejected by AEAT.
    - `error` integer, required: Records in error status.
    - `by_record_type` object, required: Count by record type (registration/cancellation).
    - `by_invoice_type` object, required: Count by AEAT invoice type (F1, F2, F3, …).
    - `last_transmission_at` string, date-time, nullable, required: Date of the last transmission to AEAT, or `null` if there is none.
    - `pending_incident_count` integer, required: Records still waiting to be remitted to AEAT: `pending` (or without a state yet), `error` of ANY kind (those that retry by themselves and the blocked ones), `submitted` (in flight, or orphaned until the next sweep) and `rejected` records that have already been subsanados. NOT counted: `accepted`, `rejected` records still waiting for your correction, and sandbox (test mode) companies. The query filters never affect it. Art. 16 of Order HAC/1177/2024 requires the taxpayer to see how many records are pending.
    - `blocked_incident_count` integer, required: Of the pending records, the BLOCKED ones: `error` with NO automatic retry (missing certificate or representation, presenter not enabled by AEAT, or a client-side rejection). They do not go out until someone reactivates them (`POST /v1/companies/{company}/verifactu/records/retry-blocked`) and they hold back the chain of the company. It is a subset of `pending_incident_count`; the query filters never affect it.
    - `oldest_pending_at` string, date-time, nullable, required: Generation timestamp of the oldest of the pending records counted by `pending_incident_count`, or `null` when there is none. The query filters never affect it.

## Other responses

- `400`: `parameter_unknown` with `subcode` `retired_active_profile_header`: the retired `X-Active-Profile` header was sent; the company goes in the path. `parameter_invalid_format` on `Factuarea-Version`: the header is not a `YYYY-MM-DD` date. `unsupported_api_version`: the `Factuarea-Version` date is not a supported version.
- `401`: Missing or invalid API key.
- `403`: The request is authenticated but not allowed: the API key lacks the required scope (`insufficient_scope`), the plan does not include the public API or this feature (`addon_not_active`, `feature_not_available_in_plan`), or the module is not available with a test key (`module_not_available_in_sandbox`).
- `404`: The requested resource does not exist or belongs to another company. `profile_not_found`: the company in the path does not exist, is not in the API key scope or belongs to the other environment (live or test).
- `429`: Rate limit exceeded. Retry after the duration in `Retry-After`.
- `500`: Unexpected server error.

---

[API](https://skmtc.dev/factuarea/apis/factuarea-public-api.md) · [All operations](https://skmtc.dev/factuarea/apis/factuarea-public-api/llms.txt) · [OpenAPI document](https://skmtc.dev/factuarea/apis/factuarea-public-api/revisions/718e77934422?raw)
