Account tax regime
The Account Tax Regime resource exposes mutable configuration and compliance state for one account. This is separate from the public Tax Regime catalog, which describes supported taxes and rules, and from the immutable tax-regime state attached to an issued Invoice.
The key field discriminates the response shape. A Spanish account includes an
es object; a Global account omits regime-specific details until Global has
account-level configuration to expose.
For Live Spanish accounts, es.submission reports the active method (direct
or represented), its ready state and the direct certificate's expiry date.
No credential material is exposed. es.pending_submission reports the replacement's
kind, verification status, error_code, last_checked_at and certificate expiry.
The active method remains unchanged until the replacement passes verification.
After activation or cancellation, pending_submission becomes null.
es.representation reports the AEAT IZ860 registered-power state when represented
submission is active. It is null for direct submission. All submission and representation fields are null for
Test accounts, which use the simulator without AEAT credentials.
Live issuance checks submission readiness at the operation boundary.
Configure AEAT submission
These operations live under /v1/account/tax-regime/es and require a Live
Spanish account's API key. Read the setup using GET /v1/account/tax-regime.
Upload a .p12 or
.pfx file as multipart/form-data, with certificate_file and the optional
certificate_password. The maximum file size is 128 KiB. The certificate must
identify the account's issuer NIF and include its private key. FiscalRail stores
the credential encrypted and discards the password after parsing.
An upload returns 202 Accepted and starts verification with AEAT. Poll this
resource to observe the pending result. A failed or unavailable check retains
the pending certificate; retry verification or cancel the pending change.
A new upload replaces the pending change. A working active setup is preserved
throughout verification. Invalid uploads leave existing configurations untouched.
To use FiscalRail's representative certificate, grant the AEAT power first, then request representation verification. When direct submission is active, this stages a represented replacement and only switches after successful verification.
For an active configuration, status describes submission verification and
error_code reports the latest failure. Always use ready for issuance readiness:
a previously verified configuration stays usable during an unavailable recheck.
These new operations currently use HTTP directly; SDK convenience methods are not yet available. Use a Live key in the examples below.
Upload an issuer certificate
/v1/account/tax-regime/es/certificateUploads a PKCS#12 certificate and queues AEAT verification. Only Live Spanish accounts are supported. A working setup remains active until verification succeeds. A new upload replaces any pending change.
certificate_file
string
required
certificate_password
string
curl --request POST \
'https://api.fiscalrail.com/v1/account/tax-regime/es/certificate' \
--header "Authorization: Bearer fra_live_..." \
--form 'certificate_file=@issuer.p12' \
--form-string 'certificate_password=YOUR_CERTIFICATE_PASSWORD'
{
"object": "account_tax_regime",
"account": "acct_14Vxtqg7NhKs3Rb9CmY2Pd",
"key": "global"
}
Verify AEAT representation
/v1/account/tax-regime/es/representation/verifyQueues verification of FiscalRail representation for a Live Spanish account. If direct submission is active, it remains active until the represented replacement verifies. Any pending change is replaced.
curl --request POST \
'https://api.fiscalrail.com/v1/account/tax-regime/es/representation/verify' \
--header "Authorization: Bearer fra_live_..."
{
"object": "account_tax_regime",
"account": "acct_14Vxtqg7NhKs3Rb9CmY2Pd",
"key": "global"
}
Retry submission verification
/v1/account/tax-regime/es/submission/verifyQueues another check of the pending configuration, or the active configuration if there is no pending change. Only Live Spanish accounts are supported.
curl --request POST \
'https://api.fiscalrail.com/v1/account/tax-regime/es/submission/verify' \
--header "Authorization: Bearer fra_live_..."
{
"object": "account_tax_regime",
"account": "acct_14Vxtqg7NhKs3Rb9CmY2Pd",
"key": "global"
}
Cancel a pending submission change
/v1/account/tax-regime/es/submission/pendingDeletes the pending change and its stored certificate, preserving the active setup. Succeeds even when there is no pending change. Only Live Spanish accounts are supported.
curl --request DELETE \
'https://api.fiscalrail.com/v1/account/tax-regime/es/submission/pending' \
--header "Authorization: Bearer fra_live_..."
{
"object": "account_tax_regime",
"account": "acct_14Vxtqg7NhKs3Rb9CmY2Pd",
"key": "global"
}
The Account Tax Regime object
The response is one of the following concrete shapes, selected by key.
Global Account Tax Regime
object
string
account_tax_regime.account
string
key
string
global.{
"object": "account_tax_regime",
"account": "acct_14Vxtqg7NhKs3Rb9CmY2Pd",
"key": "global"
}
Spanish Account Tax Regime
object
string
account_tax_regime.account
string
key
string
es.es
object
Show child propertiesHide child properties
pending_submission
object or null
Show child propertiesHide child properties
kind
enum
direct
represented
status
enum
not_started
pending_verification
verified
invalid
unavailable
error_code
string or null
last_checked_at
string or null
certificate_expires_at
string or null
submission
object or null
Show child propertiesHide child properties
kind
enum
direct
represented
ready
boolean
status
enum
not_started
pending_verification
verified
invalid
unavailable
error_code
string or null
last_checked_at
string or null
certificate_expires_at
string or null
representation
object or null
Show child propertiesHide child properties
kind
string
aeat_registered_power.power_code
string
IZ860.status
enum
not_started
Verification has not been requested.
pending_verification
A live verification check is queued or running.
verified
The latest live check confirmed the registered power.
revoked
A previously verified power failed the latest live check.
invalid
No successful live check has confirmed the registered power.
verified_at
string or null
last_checked_at
string or null
{
"object": "account_tax_regime",
"account": "acct_14Vxtqg2nwvPR75TpsGH8N",
"key": "es",
"es": {
"submission": {
"kind": "represented",
"ready": true,
"status": "verified",
"error_code": null,
"last_checked_at": "2026-08-25T14:30:00Z",
"certificate_expires_at": null
},
"pending_submission": null,
"representation": {
"kind": "aeat_registered_power",
"power_code": "IZ860",
"status": "verified",
"verified_at": "2026-08-25T14:30:00Z",
"last_checked_at": "2026-08-25T14:30:00Z"
}
}
}
Retrieve the account tax regime
/v1/account/tax-regimeReturns the selected account's regime configuration and compliance state.
200
An Account Tax Regime object.
JSON
import os
from fiscalrail import FiscalRail
client = FiscalRail(os.environ["FISCALRAIL_API_KEY"])
tax_regime = client.account_tax_regimes.retrieve()
require "fiscalrail"
client = FiscalRail::Client.new(api_key: ENV.fetch("FISCALRAIL_API_KEY"))
tax_regime = client.account_tax_regimes.retrieve
curl --request GET \
'https://api.fiscalrail.com/v1/account/tax-regime' \
--header "Authorization: Bearer fra_test_..."
{
"object": "account_tax_regime",
"account": "acct_14Vxtqg2nwvPR75TpsGH8N",
"key": "es",
"es": {
"submission": {
"kind": "represented",
"ready": true,
"status": "verified",
"error_code": null,
"last_checked_at": "2026-08-25T14:30:00Z",
"certificate_expires_at": null
},
"pending_submission": null,
"representation": {
"kind": "aeat_registered_power",
"power_code": "IZ860",
"status": "verified",
"verified_at": "2026-08-25T14:30:00Z",
"last_checked_at": "2026-08-25T14:30:00Z"
}
}
}