Skip to main content

Admin Endpoints

Internal administrative endpoints for batch processing and system operations. These are not exposed to external API consumers and are typically invoked by Cloud Scheduler or internal tooling.

All admin endpoints require admin-level authentication.

Process pending batches

POST /v1/admin/process-pending

Runs all registered batch processors (LROE TicketBAI batch submission, Bizkaia fiscalization protocols). Typically invoked by Cloud Scheduler on a daily cadence. Each processor runs sequentially and returns its own result summary.

Response 200 OK

{
"results": [
{
"processor": "lroe_batch",
"processed": 42,
"failed": 1,
"duration_ms": 3200
}
]
}

Errors

StatusDescription
401Unauthorized — admin auth required
500One or more processors failed

Get batch statistics

GET /v1/admin/batch-stats

Returns statistics from all registered batch processors for the last 24 hours.

Response 200 OK

{
"stats": [
{
"processor": "lroe_batch",
"last_run": "2026-03-15T02:00:00Z",
"total_processed_24h": 156,
"total_failed_24h": 3,
"avg_duration_ms": 2800
}
]
}

Operational notes

  • Cloud Scheduler triggers process-pending at 02:00 UTC daily
  • Batch stats are retained for 30 days in the operational database
  • Failed batches are automatically retried on the next invocation
  • Monitor via Cloud Monitoring dashboards (see Runbook)