Ir al contenido

Inicio rápido de Francia

Este inicio rápido te guía para crear tu primer registro fiscal firmado con fiskaly SIGN FR, cumpliendo las tres obligaciones fiscales francesas clave: firma, registro y archivado.

  • Una cuenta fiskaly (regístrate en hub.fiskaly.com)
  • Una clave de API y un secreto para una organización GROUP en el entorno de PRUEBA
  • Información del contribuyente: nombre de empresa, número SIREN, dirección
  1. Autenticar

    curl -X POST https://test.api.fiskaly.com/tokens \
      -H "Content-Type: application/json" \
      -H "X-Api-Version: 2026-02-03" \
      -H "X-Idempotency-Key: $(uuidgen)" \\
      -d '{
        "content": {
          "type": "API_KEY",
          "key": "YOUR_API_KEY",
          "secret": "YOUR_API_SECRET"
        }
      }'
  2. Crear Organización, Contribuyente, Ubicación y Sistema

    La configuración sigue el mismo patrón que SIGN IT — crea una organización UNIT, luego un Contribuyente, Ubicación y Sistema, poniendo en servicio cada recurso:

    # Crear 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 French Company"}}'
    
    # Crear clave API de Sujeto para la UNIT, volver a autenticar, luego:
    
    # Crear Contribuyente
    curl -X POST https://test.api.fiskaly.com/taxpayers \
      -H "Authorization: Bearer ${UNIT_TOKEN}" \
      -H "Content-Type: application/json" \
      -H "X-Api-Version: 2026-02-03" \
      -H "X-Idempotency-Key: $(uuidgen)" \
      -d '{
        "content": {
          "type": "COMPANY",
          "name": {"legal": "Ma Societe SARL", "trade": "Ma Societe"},
          "address": {
            "line": {"type": "STREET_NUMBER", "street": "Rue de Rivoli", "number": "1"},
            "code": "75001", "city": "Paris", "country": "FR"
          },
          "fiscalization": {
            "type": "FR",
            "tax_id_number": "123456789",
            "credentials": {
              "type": "LNE",
              "properties": {"legal_form": "SARL", "naf_ape_code": "1071C", "social_capital": "50000"}
            }
          }
        }
      }'
    
    # Poner en servicio el Contribuyente, crear + poner en servicio Ubicación y Sistema
    # (mismo patrón que SIGN IT — consulta la guía de integración completa)
  3. Crear tu primer Registro

    # Parte A: Intención
    curl -X POST https://test.api.fiskaly.com/records \
      -H "Authorization: Bearer ${UNIT_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: Transacción
    curl -X POST https://test.api.fiskaly.com/records \
      -H "Authorization: Bearer ${UNIT_TOKEN}" \
      -H "Content-Type: application/json" \
      -H "X-Api-Version: 2026-02-03" \
      -H "X-Idempotency-Key: $(uuidgen)" \
      -d '{
        "content": {
          "type": "TRANSACTION",
          "record": {"id": "INTENTION_ID"},
          "operation": {
            "type": "RECEIPT",
            "document": {
              "number": "0001",
              "total_vat": {
                "amount": "2.00",
                "exclusive": "10.00",
                "inclusive": "12.00"
              }
            },
            "entries": [{
              "type": "SALE",
              "details": {"concept": "GOOD"},
              "data": {
                "type": "ITEM",
                "text": "Product A",
                "unit": {
                  "quantity": "1.00",
                  "price": {"inclusive": "12.00", "exclusive": "10.00"}
                },
                "value": {"base": "10.00", "discount": "0.00"},
                "vat": {
                  "type": "VAT_RATE",
                  "code": "STANDARD",
                  "percentage": "20.00",
                  "exclusive": "10.00",
                  "inclusive": "12.00",
                  "amount": "2.00"
                }
              }
            }],
            "payments": [{"type": "CASH", "details": {"amount": "12.00"}}]
          }
        }
      }'

    Una vez creados, los datos se firman, registran y archivan automáticamente — cumpliendo las tres obligaciones fiscales clave de NF525.