Skip to content
Concepts

FISCALISTO / API

Authentication and keys

How your system identifies itself with its secret key, how to restrict a key to some issuers, to read-only or to a time limit, and how to roll it without downtime.

Open in ChatGPTOpen in ClaudeOpen in Cursor

Every request carries your secret key in the Authorization header:

curl https://api.fiscalisto.com/v1/account \
  -H "Authorization: Bearer $FISCALISTO_API_KEY"

It's also accepted as the HTTP Basic user, with no password (curl -u "$FISCALISTO_API_KEY:"), for tools that only know that way.

Format

A key is fk_test_ or fk_live_ followed by 40 letters and digits. The prefix says the mode (see Test and live). Fiscalisto keeps only its fingerprint: if you lose it, create another.

Where to keep it

  • In an environment variable or your server's secret manager, never in code or in the repository.
  • Never in the browser or in an app installed on phones: whoever has it stamps in your name. The API doesn't answer browser requests (it refuses them with browser_not_supported); the exception is Probar in this documentation's reference, and only with test keys.
  • One key per system or environment, with a name that says where it lives, so you revoke only the one that leaked.

Keys restricted to some issuers

When creating a key in Desarrolladores › Llaves you can check Solo para algunos emisores (only for some issuers). That key only sees and stamps with those RFCs; anything touching another issuer, creating new issuers or account-wide (like webhooks) answers 403 with key_restricted. It's useful, for example, to give each branch or each customer of your platform a key that only invoices with its RFC.

Read-only keys

In Permisos choose Solo lectura for a key that reads and changes nothing: every GET request (invoices, PDF, XML, balance, catalogs, events) and the POSTs that only check: POST /v1/invoices/preview, POST /v1/tax_ids/validate, POST /v1/sat_lists/check, POST /v1/payroll_receipts/preview and POST /v1/payroll_receipts/external/preview. Everything else (stamping, cancelling, sending, creating or changing data) answers 403 with key_read_only. It's useful for a dashboard, a report or your support team's tool. It can be combined with Solo para algunos emisores.

Keys that expire

In Vence (expires) choose whether the key stops working in 30 days, 90 days, 6 months or 1 year (Nunca, never, otherwise). We email the account's owners and admins 7 days and 1 day before. Once expired it answers 401 with invalid_api_key. Cambiar llave (roll key) gives you a new one with the same term, counted from that day. GET /v1/account says of the key that made the request whether it's read-only (key.read_only) and when it expires (key.expires_at), so your system can warn ahead.

Choosing the issuer

Whatever creates documents, customers or products carries the issuer (iss_…) in issuer, in the body; lists carry it in the query (?issuer=iss_…). If the account, or the key, has a single issuer, you can leave it out. If it has several and you don't send it, the API answers issuer_required. Everything else's ids (inv_…, cus_…) already say which issuer they belong to.

Rolling a key without downtime

In Desarrolladores › Llaves choose Cambiar llave in its menu. We give you a new one with the same name and permissions, and you choose when the old one stops working: right now, in 1 hour, in 24 hours or in 7 days. Put the new one on your server within that time. If a key leaked, roll it with Ahora mismo (right now) or revoke it.

Limits

  • Up to 50 keys per mode.
  • Creating live keys requires the user's two-step verification.
  • An IP address that sends many invalid keys in a row gets 429 for a minute; it never affects valid keys.

Authentication errors

CodeWhat happened
missing_api_keyThe Authorization header didn't arrive.
invalid_api_keyThe key doesn't exist, was revoked or expired.
key_restrictedThe key is restricted to other issuers.
key_read_onlyThe key is read-only and the request changes something.
livemode_mismatchThe object belongs to the other mode.
account_suspendedWe suspended the account (or its live keys); the message says why.

Was this page helpful?