Skip to main content

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

FieldTypeDescription
processorstringProcessor identifier (e.g., spain/lroe)
batches_createdintegerNumber of new batches created
batches_retriedintegerNumber of previously failed batches retried
acceptedintegerItems accepted by the fiscal authority
rejectedintegerItems rejected by the fiscal authority
failedintegerItems that failed to submit
failure_ratefloatRatio of failures to total items
alert_triggeredbooleanWhether the failure rate exceeded the alert threshold
errors_countintegerNumber of errors encountered
duration_msintegerProcessing duration in milliseconds

Registered processors

ProcessorSystemDescription
spain/lroeTicketBAI (Bizkaia)LROE batch submission for Bizkaia territory