Ir al contenido

Inicio rápido de Italia

Este inicio rápido te guía a través de la creación de su primer registro fiscal con fiskaly SIGN IT, desde la autenticación hasta un documento comercial conforme transmitido a la AdE (Agenzia delle Entrate).

  • Una cuenta fiskaly (regístrese en hub.fiskaly.com)
  • Una clave de API y un secreto para una organización GROUP en el entorno TEST
  • Credenciales de Fisconline para el contribuyente (en LIVE; no necesarias para TEST)
  1. Autenticarse

    curl -X POST https://test.api.fiskaly.com/tokens \
      -H "Content-Type: application/json" \
      -H "X-Api-Version: 2026-02-03" \
      -d '{
        "content": {
          "type": "API_KEY",
          "key": "YOUR_API_KEY",
          "secret": "YOUR_API_SECRET"
        }
      }'
  2. Crear una organización UNIT

    curl -X POST https://test.api.fiskaly.com/organizations \
      -H "Authorization: Bearer ${ACCESS_TOKEN}" \
      -H "Content-Type: application/json" \
      -H "X-Api-Version: 2026-02-03" \
      -H "X-Idempotency-Key: $(uuidgen)" \
      -d '{
        "content": {
          "type": "UNIT",
          "name": "My Italian Merchant"
        }
      }'
  3. Crear una clave de API de sujeto y autenticarse

    Crea una clave de API para la UNIT y autentíquese con ella:

    # Crear clave de API de sujeto (con ámbito en la UNIT)
    curl -X POST https://test.api.fiskaly.com/subjects \
      -H "Authorization: Bearer ${ACCESS_TOKEN}" \
      -H "Content-Type: application/json" \
      -H "X-Api-Version: 2026-02-03" \
      -H "X-Idempotency-Key: $(uuidgen)" \
      -H "X-Scope-Identifier: ${ORG_ID}" \
      -d '{"content": {"type": "API_KEY"}}'
    
    # Autenticarse con la nueva clave de API
    curl -X POST https://test.api.fiskaly.com/tokens \
      -H "Content-Type: application/json" \
      -H "X-Api-Version: 2026-02-03" \
      -d '{"content": {"type": "API_KEY", "key": "NEW_KEY", "secret": "NEW_SECRET"}}'
  4. Crear contribuyente, ubicación y sistema

    # Crear contribuyente
    curl -X POST https://test.api.fiskaly.com/taxpayers \
      -H "Authorization: Bearer ${ACCESS_TOKEN}" \
      -H "Content-Type: application/json" \
      -H "X-Api-Version: 2026-02-03" \
      -H "X-Idempotency-Key: $(uuidgen)" \
      -d '{
        "content": {
          "type": "COMPANY",
          "name": {
            "legal": "La Pizzeria di Mario S.r.l.",
            "trade": "La Pizzeria di Mario"
          },
          "address": {
            "line": {
              "type": "STREET_NUMBER",
              "street": "Via Roma",
              "number": "123"
            },
            "code": "00100",
            "city": "Rome",
            "country": "IT"
          },
          "fiscalization": {
            "type": "IT",
            "tax_id_number": "12345678901",
            "vat_id_number": "12345678901",
            "credentials": {
              "type": "FISCONLINE",
              "pin": "1234567890",
              "password": "MySecurePassword123",
              "tax_id_number": "RSSMRA85M01H501Z"
            }
          }
        }
      }'
    
    # Activar contribuyente
    curl -X PATCH "https://test.api.fiskaly.com/taxpayers/${TAXPAYER_ID}" \
      -H "Authorization: Bearer ${ACCESS_TOKEN}" \
      -H "Content-Type: application/json" \
      -H "X-Api-Version: 2026-02-03" \
      -H "X-Idempotency-Key: $(uuidgen)" \
      -d '{"content": {"state": "COMMISSIONED"}}'
  5. Crear su primer registro

    Los registros requieren dos llamadas: una INTENTION seguida de una TRANSACTION.

    # Parte A: Intention
    curl -X POST https://test.api.fiskaly.com/records \
      -H "Authorization: Bearer ${ACCESS_TOKEN}" \
      -H "Content-Type: application/json" \
      -H "X-Api-Version: 2026-02-03" \
      -H "X-Idempotency-Key: $(uuidgen)" \
      -d '{
        "content": {
          "type": "INTENTION",
          "system": {"id": "YOUR_SYSTEM_ID"},
          "operation": {"type": "TRANSACTION"}
        }
      }'
    
    # Parte B: Transaction
    curl -X POST https://test.api.fiskaly.com/records \
      -H "Authorization: Bearer ${ACCESS_TOKEN}" \
      -H "Content-Type: application/json" \
      -H "X-Api-Version: 2026-02-03" \
      -H "X-Idempotency-Key: $(uuidgen)" \
      -d '{
        "content": {
          "type": "TRANSACTION",
          "record": {
            "id": "your_intention_id"
          },
          "operation": {
            "type": "RECEIPT",
            "document": {
              "number": "1",
              "total_vat": {
                "amount": "2.20",
                "exclusive": "10.00",
                "inclusive": "12.20"
              }
            },
            "entries": [
              {
                "type": "SALE",
                "details": {
                  "concept": "GOOD"
                },
                "data": {
                  "type": "ITEM",
                  "text": "Margherita Pizza",
                  "unit": {
                    "quantity": "1",
                    "price": "12.20"
                  },
                  "value": {
                    "base": "10.00",
                    "discount": "0.00"
                  },
                  "vat": {
                    "type": "VAT_RATE",
                    "code": "STANDARD",
                    "percentage": "22.00",
                    "exclusive": "10.00",
                    "inclusive": "12.20",
                    "amount": "2.20"
                  }
                }
              }
            ],
            "payments": [
              {
                "type": "CASH",
                "details": {
                  "amount": "12.20"
                }
              }
            ]
          }
        }
      }'

    Una vez que el registro alcanza el estado COMPLETED con el modo FINISHED, el documento comercial ha sido transmitido a la AdE.

¿Desea ejecutar todos los pasos automáticamente? Descarga y ejecuta nuestro script de inicio rápido:

# Descargar y ejecutar
curl -O https://workspace.fiskaly.com/scripts/sign-it-quickstart.sh
export API_KEY="your_api_key"
export API_SECRET="your_api_secret"
export GROUP_ORG_ID="your_group_org_id"
bash sign-it-quickstart.sh

Was this page helpful?