Skip to main content

Translations

Translate fiscalization error codes and messages to English. Supports static lookup for known error codes and AI-powered translation as a fallback for unrecognized errors.

All endpoints require authentication.

Translate an error

POST /v1/translations/errors

Translates a country-specific fiscalization error into English with classification metadata.

Request body

FieldTypeRequiredDescription
error_codestringYesThe error code from the tax authority (e.g., 1105 for AEAT)
error_messagestringNoThe original error message (improves AI translation quality)
countrystringYesCountry code: ES, IT, or FR
systemstringNoFiscalization system (e.g., ticketbai, verifactu, sii, sdi)

Example

curl -X POST https://api.fiscalapi.com/v1/translations/errors \
-H "Content-Type: application/json" \
-H "Authorization: Bearer fsk_test_abc123def456..." \
-d '{
"error_code": "1105",
"country": "ES",
"system": "verifactu"
}'

Response 200 OK

{
"error_code": "1105",
"country": "ES",
"system": "verifactu",
"original_message": "El NIF del obligado tributario no está identificado en la AEAT",
"translation": "The taxpayer NIF is not registered with AEAT",
"category": "validation",
"severity": "error",
"retriable": false,
"user_message": "The tax ID provided is not recognized by the Spanish tax authority. Please verify the NIF is correct.",
"source": "static"
}

Response fields

FieldTypeDescription
error_codestringEchoed from request
countrystringCountry code
systemstringFiscalization system (if provided)
original_messagestringOriginal error message in the source language
translationstringEnglish translation of the error
categorystringError classification (see below)
severitystringerror, warning, or info
retriablebooleanWhether retrying the operation may succeed
user_messagestringNon-technical message suitable for end users
sourcestringstatic (known error code) or ai (AI-translated)

Error categories

CategoryDescription
validationInput data validation failure
authAuthentication or authorization issue
submissionError during submission to tax authority
networkNetwork or connectivity issue
configurationSystem configuration problem
unknownUnrecognized error type

Translation sources

Static lookup -- For known error codes, FiscalAPI returns pre-translated messages from its built-in error catalog. Currently supported:

CountrySystemCoverage
Spain (ES)TicketBAI, Verifactu, SIIAEAT error codes
Italy (IT)SDISDI notification error codes

Static translations include curated category, severity, retriable, and user_message values.

AI fallback -- When an error code is not in the static catalog, FiscalAPI uses Claude to translate the error message, classify it, and generate a user-friendly explanation. AI translations are cached permanently to avoid redundant calls.

Errors

StatusErrorCause
400error_code is requiredMissing error code
400country is requiredMissing country code