Batch Processing
Admin endpoints for triggering and monitoring batch fiscalization processors. All endpoints require authentication.
info
Batch processing is used for fiscalization systems that require periodic submission rather than real-time (e.g., Spain LROE for Bizkaia). Registered processors run automatically on schedule, but these endpoints allow manual triggering and monitoring.
Trigger batch processing
POST /v1/admin/process-pending
Triggers all registered batch processors to process pending items.
Example
curl -X POST https://api.fiscalapi.com/v1/admin/process-pending \
-H "Authorization: Bearer fsk_test_abc123def456..."
Response 200 OK
{
"results": [
{
"processor": "spain/lroe",
"batches_created": 1,
"batches_retried": 0,
"accepted": 15,
"rejected": 0,
"failed": 0,
"failure_rate": 0.0,
"alert_triggered": false,
"errors_count": 0,
"duration_ms": 1234
}
]
}
Response 207 Multi-Status
Returned when some processors succeed and others fail:
{
"results": [
{
"processor": "spain/lroe",
"batches_created": 1,
"accepted": 10,
"rejected": 2,
"failed": 1,
"failure_rate": 0.077,
"alert_triggered": true,
"errors_count": 1,
"duration_ms": 2345
}
]
}
Get batch statistics
GET /v1/admin/batch-stats
Returns statistics for all batch processors over the last 24 hours.
Example
curl https://api.fiscalapi.com/v1/admin/batch-stats \
-H "Authorization: Bearer fsk_test_abc123def456..."
Response 200 OK
{
"stats": [
{
"processor": "spain/lroe",
"batches_created": 5,
"batches_retried": 1,
"accepted": 142,
"rejected": 3,
"failed": 0,
"failure_rate": 0.021,
"since": "2026-03-08T14:30:00Z"
}
]
}
Batch result fields
| Field | Type | Description |
|---|---|---|
processor | string | Processor identifier (e.g., spain/lroe) |
batches_created | integer | Number of new batches created |
batches_retried | integer | Number of previously failed batches retried |
accepted | integer | Items accepted by the fiscal authority |
rejected | integer | Items rejected by the fiscal authority |
failed | integer | Items that failed to submit |
failure_rate | float | Ratio of failures to total items |
alert_triggered | boolean | Whether the failure rate exceeded the alert threshold |
errors_count | integer | Number of errors encountered |
duration_ms | integer | Processing duration in milliseconds |
Registered processors
| Processor | System | Description |
|---|---|---|
spain/lroe | TicketBAI (Bizkaia) | LROE batch submission for Bizkaia territory |