Skip to content

Germany Quickstart

This quickstart walks you through authenticating with the SIGN DE API, creating a TSS (Technical Security System), and signing your first transaction. By the end you will have a working fiscal signing flow.

  • A fiskaly account with a German organization (sign up at hub.fiskaly.com)
  • An API Key and Secret generated in the TEST environment
  • A tool to make HTTP requests (cURL, Postman, or your application code)
  1. Authenticate

    Use your API Key and Secret to obtain an access token:

    curl -X POST https://kassensichv-middleware.fiskaly.com/api/v2/auth \
      -H "Content-Type: application/json" \
      -d '{
        "api_key": "YOUR_API_KEY",
        "api_secret": "YOUR_API_SECRET"
      }'

    The response contains an access_token (valid 24h) and a refresh_token (valid 48h).

  2. Create and initialize a TSS

    Create a TSS, set the Admin PIN, authenticate as admin, and initialize:

    # Create TSS
    TSS_ID=$(uuidgen)
    curl -X PUT "https://kassensichv-middleware.fiskaly.com/api/v2/tss/${TSS_ID}" \
      -H "Authorization: Bearer ${ACCESS_TOKEN}" \
      -H "Content-Type: application/json" \
      -d '{"description": "Quickstart TSS"}'
    
    # Change Admin PIN
    curl -X PATCH "https://kassensichv-middleware.fiskaly.com/api/v2/tss/${TSS_ID}/admin" \
      -H "Authorization: Bearer ${ACCESS_TOKEN}" \
      -H "Content-Type: application/json" \
      -d '{"admin_puk": "ADMIN_PUK_FROM_RESPONSE", "new_admin_pin": "my-secure-pin"}'
    
    # Authenticate as Admin
    curl -X POST "https://kassensichv-middleware.fiskaly.com/api/v2/tss/${TSS_ID}/admin/auth" \
      -H "Authorization: Bearer ${ACCESS_TOKEN}" \
      -H "Content-Type: application/json" \
      -d '{"admin_pin": "my-secure-pin"}'
    
    # Initialize TSS
    curl -X PATCH "https://kassensichv-middleware.fiskaly.com/api/v2/tss/${TSS_ID}" \
      -H "Authorization: Bearer ${ACCESS_TOKEN}" \
      -H "Content-Type: application/json" \
      -d '{"state": "INITIALIZED"}'
  3. Create a Client

    CLIENT_ID=$(uuidgen)
    curl -X PUT "https://kassensichv-middleware.fiskaly.com/api/v2/tss/${TSS_ID}/client/${CLIENT_ID}" \
      -H "Authorization: Bearer ${ACCESS_TOKEN}" \
      -H "Content-Type: application/json" \
      -d '{"serial_number": "POS-001"}'
  4. Sign your first transaction

    Start a transaction, then finish it with receipt data:

    TX_ID=$(uuidgen)
    
    # Start transaction
    curl -X PUT "https://kassensichv-middleware.fiskaly.com/api/v2/tss/${TSS_ID}/tx/${TX_ID}?tx_revision=1" \
      -H "Authorization: Bearer ${ACCESS_TOKEN}" \
      -H "Content-Type: application/json" \
      -d '{"state": "ACTIVE", "client_id": "'${CLIENT_ID}'"}'
    
    # Finish transaction with receipt
    curl -X PUT "https://kassensichv-middleware.fiskaly.com/api/v2/tss/${TSS_ID}/tx/${TX_ID}?tx_revision=2" \
      -H "Authorization: Bearer ${ACCESS_TOKEN}" \
      -H "Content-Type: application/json" \
      -d '{
        "state": "FINISHED",
        "client_id": "'${CLIENT_ID}'",
        "schema": {
          "standard_v1": {
            "receipt": {
              "receipt_type": "RECEIPT",
              "amounts_per_vat_rate": [{"vat_rate": "NORMAL", "amount": "10.00"}],
              "amounts_per_payment_type": [{"payment_type": "CASH", "amount": "10.00"}]
            }
          }
        }
      }'

    The response includes a cryptographic signature from the TSS, the signature_counter, and all data needed for a KassenSichV-compliant receipt.

Was this page helpful?