Audit
Query audit reports and verify fiscal chain integrity for locations. All endpoints require authentication.
Get audit report
GET /v1/locations/{id}/audit?from=YYYY-MM-DD&to=YYYY-MM-DD
Returns a comprehensive audit report for a location over the specified date range, including transaction summary, chain integrity check, event log, and available export formats.
Path parameters
| Parameter | Type | Description |
|---|---|---|
id | uuid | Location UUID |
Query parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
from | string | Yes | Start date (YYYY-MM-DD or RFC 3339) |
to | string | Yes | End date (YYYY-MM-DD or RFC 3339) |
limit | integer | No | Items per page (max 100, default 20) |
offset | integer | No | Pagination offset (max 10000, default 0) |
Example
curl "https://api.zyntem.dev/v1/locations/7c9e6679-7425-40de-944b-e07fc1f90ae7/audit?from=2026-01-01&to=2026-03-31" \
-H "Authorization: Bearer zyn_test_abc123def456..."
Response 200 OK
{
"location": {
"id": "7c9e6679-7425-40de-944b-e07fc1f90ae7",
"name": "Bilbao Office",
"country": "ES",
"address": "Gran Via 1",
"tax_id": "B12345674",
"status": "active",
"country_config": { "system": "ticketbai" }
},
"period": {
"from": "2026-01-01T00:00:00Z",
"to": "2026-03-31T23:59:59Z"
},
"summary": {
"total_transactions": 1500,
"total_amount": 12500000,
"total_tax": 2625000,
"sales_count": 1480,
"sales_amount": 12400000,
"cancellations_count": 20,
"cancellations_amount": 100000,
"by_status": { "success": 1490, "failed": 5, "pending": 5 }
},
"transactions": {
"data": [],
"total": 1500,
"limit": 20,
"offset": 0
},
"chain_integrity": {
"valid": true,
"total_checked": 1500,
"fiscal_id_count": 1490,
"gaps": [],
"first_fiscal_id": "TBAI-00001",
"last_fiscal_id": "TBAI-01490"
},
"event_log": [],
"export_formats": ["ticketbai-xml", "csv", "pdf"]
}
Export audit data
POST /v1/locations/{id}/audit/export
Queues an export of audit data in a country-specific format.
Request body
| Field | Type | Required | Description |
|---|---|---|---|
from | string | Yes | Start date (YYYY-MM-DD or RFC 3339) |
to | string | Yes | End date (YYYY-MM-DD or RFC 3339) |
format | string | No | Export format (default: csv) |
Available formats by country:
| Country | Formats |
|---|---|
| FR | jet, csv, pdf |
| PT | saft-pt, csv, pdf |
| ES | ticketbai-xml, csv, pdf |
| IT | fattura-xml, csv, pdf |
| Others | csv, pdf |
Example
curl -X POST "https://api.zyntem.dev/v1/locations/7c9e6679-7425-40de-944b-e07fc1f90ae7/audit/export" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer zyn_test_abc123def456..." \
-d '{"from": "2026-01-01", "to": "2026-03-31", "format": "csv"}'
Response 200 OK
{
"format": "csv",
"status": "pending",
"message": "Export generation queued. Country-specific export adapters will produce the file."
}
Check chain integrity
GET /v1/locations/{id}/audit/chain-integrity?from=YYYY-MM-DD&to=YYYY-MM-DD
Verifies the fiscal ID chain integrity for a location. Checks for gaps (successful transactions without fiscal IDs) and duplicate fiscal IDs.
Query parameters
Same as Get audit report.
Example
curl "https://api.zyntem.dev/v1/locations/7c9e6679-7425-40de-944b-e07fc1f90ae7/audit/chain-integrity?from=2026-01-01&to=2026-03-31" \
-H "Authorization: Bearer zyn_test_abc123def456..."
Response 200 OK
{
"valid": true,
"total_checked": 1500,
"fiscal_id_count": 1490,
"gaps": [],
"first_fiscal_id": "TBAI-00001",
"last_fiscal_id": "TBAI-01490"
}