POST
/api/sso/consume_ticketConsume SSO ticket
Exchanges the ticket generated by /api/sso/create_ticket for the TFiscal session JWT. This endpoint is called by the frontend (route /sso) and does not require sign/timestamp headers — the opaque ticket itself is the credential. Each ticket can be consumed only once and expires in 60 seconds.
Body
ticket*string | string | Ticket returned by create_ticket |
* Required field.
Response fields
access_string | string | Session JWT (365-day validity). Use in the Authorization header of TFiscal calls |
typestring | string | User type (user, admin, etc.) |
uidint | int | Internal user ID |
company_int | int | ID of the company selected in create_ticket |
languagestring | string | Language chosen in create_ticket (always normalized) |
pagestring | string | Target page (or empty string if not set) |
Error responses
| Message | Cause |
|---|---|
Ticket inválido | Body without ticket field |
Ticket inválido ou expirado | Ticket does not exist, has already been consumed, or is past the 60-second limit |
Rate limit exceeded | More than 60 consumes per minute from the same IP |
Sessão inválida | The user linked to the ticket no longer exists |
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/consume_ticket" \ -H "Content-Type: application/json" \ -H "token: $TOKEN" \ -H "timestamp: $TIMESTAMP" \ -H "sign: $SIGN" \ -d @body.json
{
"ticket": "nXk9sz6I6KHOt_OM72ZmfyU5p1eOet5k5Bd3AFZtspg"
}
{
"success": true,
"message": "Login succeeded",
"access_token": "eyJhbGciOi...",
"type": "user",
"uid": 1234,
"company_id": 5678,
"language": "br",
"page": "emitir_nfe"
}