TF Fiscal

SSO

POST/api/sso/create_ticket

Generates a single-use ticket that can be used within 60 seconds to automatically log the user into the company panel matching the token.

Required headers

tokenstringstringCompany token (same as used to issue NF-e)
signstringstringMD5 signature: MD5(token + path + body + timestamp)
timestampstringstringUnix timestamp in seconds (5-minute window)

Fields

FieldRequiredTypeDescription
tokenYesstringCompany token — the same one used in /api/invoice/create. It must be identical to the token header; when they differ, an error is returned. When omitted, the token header is used. An integrator token can be used only when it has exactly one company
languageNostringUI language: br, en, zh, es, ja, ko. Default: br; any other value is treated as br
pageNostringLanding page after login. Accepted values: emitir_nfe. Empty, missing or any other value opens the default panel (/company/kanban).

Response fields

successbooleanbooleantrue when the ticket was successfully generated
ticketstringstringOpaque ticket (random, 32 bytes base64url)
redirectUrlstringstringFull URL where the ERP should redirect the user's browser
expiresInSecondsnumbernumberValidity in seconds (always 60)
expiresAtstringstringUTC expiration date/time (ISO 8601)

Error Responses

MessageCause
Informe o token / 请传入tokentoken was sent neither in the body nor in the header
O token do corpo difere do token do header / 请求体 token 与请求头 token 不一致The body token differs from the token header (code is AUTH_TOKEN_INVALID)
token inválido / token错误The token does not exist
Nenhuma empresa vinculada a este tokenThe token has no company
Este token está vinculado a múltiplas empresas. Envie o token da empresa que deseja acessar.Integrator token with more than one company — the specific company token must be sent
Conta não encontradaThe platform account of the company does not exist
Rate limit exceeded, please slow downThe call rate limit of the token was exceeded (configured by TF for each integrator)

Examples

# sign = md5(token + path + body + timestamp)
# Template generated from the endpoint path; replace the placeholders
curl -X POST "https://api.tffiscal.com/api/sso/create_ticket" \
  -H "Content-Type: application/json" \
  -H "token: $TOKEN" \
  -H "timestamp: $TIMESTAMP" \
  -H "sign: $SIGN" \
  -d @body.json