Skip to content

Spain Quickstart

This quickstart walks you through signing your first compliant invoice with fiskaly SIGN ES, covering both TicketBAI (Basque Country) and Verifactu (rest of Spain).

SIGN ES is fiskaly’s software-only, platform-independent API for Spanish fiscal compliance. It covers Verifactu and SII across most of Spain, TicketBAI in the Basque Country, and NaTicket in Navarre (upcoming) — all through one REST API.

VF

Verifactu

National regulation for most of Spain under the Anti-Fraud Law, Royal Decree 1007/2023, and Order HAC/1177/2024.

TB

TicketBAI

Basque Country fiscalization framework for Araba, Bizkaia, and Gipuzkoa.

SII

SII

Electronic VAT reporting to AEAT for large taxpayers in mainland Spain. Mutually exclusive with Verifactu.

NT

NaTicket

Navarra's upcoming invoice-control system, announced September 2025. Expected from 2026–2027.

API

Real-time API flow

SIGN ES generates invoice XML, signs it, chains it, and transmits it to the relevant tax authority.

RegulationApplies toKey output
VerifactuMost of Spain, excluding Basque Country and currently NavarreSigned XML, real-time AEAT transmission, Verifactu phrase and QR code
TicketBAIAraba, Bizkaia, GipuzkoaSigned XML, regional tax authority transmission, TicketBAI ID and QR code
SIIMainland Spain (large VAT taxpayers)Electronic VAT records submitted to AEAT within 4 days; no QR code
NaTicketNavarre (upcoming, ~2026–2027)Planned: signed XML transmitted to Hacienda Foral de Navarra
  • A fiskaly account with a Spanish organization (sign up at hub.fiskaly.com)
  • An API Key and Secret generated in the TEST environment
  • Taxpayer information: legal name, NIF (tax number), and territory
  1. Authenticate

    curl -X POST https://test.es.sign.fiskaly.com/api/v1/auth \
      -H "Content-Type: application/json" \
      -d '{
        "content": {
          "api_key": "YOUR_API_KEY",
          "api_secret": "YOUR_API_SECRET"
        }
      }'
  2. Create a Taxpayer

    Register the taxpayer information. The territory determines which regulation applies:

    • ARABA, BIZKAIA, GIPUZKOA → TicketBAI
    • SPAIN_OTHER, CANARY_ISLANDS, CEUTA, MELILLA → Verifactu
    curl -X PUT "https://test.es.sign.fiskaly.com/api/v1/taxpayer" \
      -H "Authorization: Bearer ${ACCESS_TOKEN}" \
      -H "Content-Type: application/json" \
      -d '{
        "content": {
          "issuer": {
            "tax_number": "B12345678",
            "legal_name": "My Company S.L."
          },
          "territory": "SPAIN_OTHER",
          "sii": {
            "state": "ENABLED"
          }
        }
      }'
  3. Create a Signer

    The signer handles the electronic signature of invoices. A certificate is automatically allocated based on the territory.

    SIGNER_ID=$(uuidgen)
    
    curl -X PUT "https://test.es.sign.fiskaly.com/api/v1/signers/${SIGNER_ID}" \
      -H "Authorization: Bearer ${ACCESS_TOKEN}" \
      -H "Content-Type: application/json" \
      -d '{"content": {}}'
  4. Create a Client

    CLIENT_ID=$(uuidgen)
    
    curl -X PUT "https://test.es.sign.fiskaly.com/api/v1/clients/${CLIENT_ID}" \
      -H "Authorization: Bearer ${ACCESS_TOKEN}" \
      -H "Content-Type: application/json" \
      -d '{"content": {"signer_id": "'${SIGNER_ID}'"}}'
  5. Create your first invoice

    INVOICE_ID=$(uuidgen)
    
    curl -X PUT "https://test.es.sign.fiskaly.com/api/v1/clients/${CLIENT_ID}/invoices/${INVOICE_ID}" \
      -H "Authorization: Bearer ${ACCESS_TOKEN}" \
      -H "Content-Type: application/json" \
      -d '{
        "content": {
          "type": "SIMPLIFIED",
          "number": "INV-001",
          "text": "Sales receipt",
          "full_amount": "12.10",
          "items": [
            {
              "text": "Product A",
              "quantity": "1",
              "unit_amount": "10.00",
              "full_amount": "12.10",
              "system": {
                "type": "REGULAR",
                "rate": "21.00"
              }
            }
          ]
        }
      }'

    The response contains the signed, compliant invoice data including all information required by TicketBAI or Verifactu regulations.

Want to run through all the steps automatically? Download and run our quickstart script:

# Download and run
curl -O https://workspace.fiskaly.com/scripts/sign-es-quickstart.sh
export API_KEY="your_api_key"
export API_SECRET="your_api_secret"
bash sign-es-quickstart.sh

Was this page helpful?