Skip to content

Authentication

All fiskaly APIs use JWT-based authentication. This guide covers the different authentication patterns across products.

API Key + Secret → POST /auth (or /tokens) → access_token + refresh_token
├─ Use in Authorization header
└─ On 401 → refresh or re-authenticate

These products use a straightforward auth endpoint:

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"
  }'
{
"access_token": "eyJhbGciOiJSUzI1NiIs...",
"access_token_expires_in": 86400,
"refresh_token": "eyJhbGciOiJSUzI1NiIs...",
"refresh_token_expires_in": 172800
}
FieldDescription
access_tokenJWT token valid for 24 hours — include as Authorization: Bearer <token>
refresh_tokenToken valid for 48 hours — use to obtain a new access token

SIGN ES wraps the auth request in a content envelope:

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"
    }
  }'

These newer APIs use /tokens with the content.type discriminator and require additional headers:

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"
    }
  }'

To scope requests to a specific organization UNIT, include the X-Scope-Identifier header:

Authorization: Bearer <access_token>
X-Api-Version: 2026-02-03
X-Scope-Identifier: <organization_unit_id>

When the access token expires, use the refresh token instead of re-authenticating with credentials:

curl -X POST https://kassensichv-middleware.fiskaly.com/api/v2/auth \
  -H "Content-Type: application/json" \
  -d '{"refresh_token": "YOUR_REFRESH_TOKEN"}'
  1. Authenticate once at application startup
  2. Store the access_token and refresh_token in memory
  3. On 401 response, attempt to refresh using the refresh_token
  4. If refresh fails (token expired), re-authenticate with API key + secret
  5. If re-auth fails, surface the error to the operator

Was this page helpful?