Tax IDs
A tax ID combines an issuing country, a normalized identifier type and its value. Tax IDs are created only as part of an account or customer. They receive their own stable ID and can be retrieved separately, but cannot be created, updated or deleted directly through the API.
Replacing a customer's nested tax ID creates a new Tax ID resource and deletes the previous one. Previously issued invoices retain their immutable snapshot.
The Tax ID object
id
string
object
string
tax_id.live
boolean
country
string
type
enum
es_nif
A Spanish NIF, including DNI and NIE identifiers for individuals and NIF identifiers for legal entities.
eu_vat
A VAT identifier issued by an EU member state and checked for intra-EU registration.
local
A domestic fiscal identifier that FiscalRail validates locally without querying a registry.
value
string
owner
object
Show child propertiesHide child properties
type
enum
account
The FiscalRail account whose legal entity uses this Tax ID.
customer
The customer associated with this Tax ID.
id
string
type.verification
object or null
Show child propertiesHide child properties
status
enum
pending
The registry check is queued, running or waiting to be retried.
completed
The registry returned a result; inspect valid for the outcome.
failed
FiscalRail could not complete the registry query; this is not evidence that the Tax ID is invalid.
valid
boolean or null
completed_at
string or null
{
"id": "tax_id_14Vxtqg6oXpAY5WdWoq4wW",
"object": "tax_id",
"live": true,
"country": "ES",
"type": "es_nif",
"value": "B87654323",
"owner": {
"type": "customer",
"id": "cus_14Vxtqg6oXpAY5WdWoq4wW"
},
"verification": {
"status": "completed",
"valid": true,
"completed_at": "2026-08-09T10:24:00Z"
}
}
Tax ID types
The country is the jurisdiction that issued the identifier; it does not have to match the owner's address country. Selecting a country restricts the available types.
| Type | Allowed countries | Local validation | Registry verification |
|---|---|---|---|
es_nif |
ES |
DNI, NIE and entity-prefix/control-character rules | Automatically checked against the AEAT census |
eu_vat |
EU member states | Country prefix and basic format; Spanish values also validate the underlying NIF | Automatically checked against VIES |
local |
Any country | Basic identifier format | Not available |
For Greece, send country: "GR" while the VAT value begins with EL. A structurally valid EU VAT number is not necessarily registered for intra-EU trade.
Spanish VERI*FACTU records project eu_vat as NIF-IVA (IDType=02) and local as an official identifier issued by the customer's country (IDType=04). Passport, residence-certificate and other-evidence identifiers are not accepted until FiscalRail exposes those types explicitly.
Tax ID verification
FiscalRail starts registry verification automatically when an es_nif or eu_vat Tax ID is created. The check runs asynchronously against the AEAT census for es_nif and VIES for eu_vat. Local Tax IDs are not checked against a registry.
The verification starts as pending and finishes as completed or failed, as described in the verification.status property above. A completed verification has a boolean valid result. For AEAT, valid: false includes identifiers that are missing, inactive, revoked or do not match the owner's name. Transport failures are retried five times with polynomial backoff before the verification becomes failed.
Verification emits the following events:
tax_id.verification.completed
Emitted when a registry check finishes with either a valid or invalid result.
tax_id.verification.failed
Emitted when FiscalRail cannot complete the registry query.
Verification requirements depend on the account's tax regime. In regimes that require a valid Tax ID, a completed verification with valid: false can prevent invoice issuance. A failed result means the registry check did not complete; it is not evidence that the Tax ID is invalid.
Retrieve a Tax ID
/v1/tax_ids/{id}Returns a Tax ID by its opaque ID, including its owner and latest registry-verification status.
id
string
required
200
A Tax ID object.
JSON
curl --request GET \
'https://api.fiscalrail.com/v1/tax_ids/example' \
--header "Authorization: Bearer ak_test_..."
{
"id": "tax_id_14Vxtqg6oXpAY5WdWoq4wW",
"object": "tax_id",
"live": true,
"country": "ES",
"type": "es_nif",
"value": "B87654323",
"owner": {
"type": "customer",
"id": "cus_14Vxtqg6oXpAY5WdWoq4wW"
},
"verification": {
"status": "completed",
"valid": true,
"completed_at": "2026-08-09T10:24:00Z"
}
}