TF Fiscal
Documentation

Files

File download

Downloads XML, DANFE, DACCE or DACTE through the links returned by queries and callbacks.

GET/openapi/files/{kind}/{ref}

No signature headers required.

Download links in query responses and callback payloads look like https://api.v2.tffiscal.com/openapi/files/{kind}/{ref}?token=…. No signature headers: the token travels with the link and a plain GET is enough. The token is bound to the path, the integrator and the application; changing the path or reusing it on another file invalidates it. Use the link exactly as returned.

Parameters

Path parameters

  • kindstringrequired

    File kind: xml (authorized XML or event receipt), danfe, dacce or dacte (CT-e).

  • refstringrequired

    File id or the 44-digit access key.

Query parameters

  • tokenstringrequired

    Link token issued by the platform. Never build or alter it manually.

Responses

302

Redirects to an object-storage URL valid for 60 seconds. Clients must follow redirects (curl -L). The response carries Cache-Control: no-store; do not cache links.

No response body

Errors

CodeHTTP
10009035401

Download link invalid (path altered, token reused or signature mismatch).

10009036401

Download link expired. Query the document again to obtain a fresh link.

10009037503

File not ready yet (rendering service busy). Retry the same link after Retry-After.

10013011404

File not found.

10013016429

Too many downloads from one IP. Retry after Retry-After.

Validity and rendering

  • Validity: 7 days by default (the platform can configure 1 to 365 days per integrator); the setting only affects links issued afterwards. Every query issues new links.
  • DANFE rendered on demand: linkDanfe is usable as soon as the NF-e is authorized; the PDF is rendered on the first download.
  • Failures are HTTP statuses: 401 invalid or expired link, 403 application or integrator disabled, 404 file not found, 429 rate limited (with Retry-After), 503 file not ready; the body is the platform envelope (success=false).
  • Rate limiting and billing: downloads count against the application throttle and have their own FILES group; they are not billed.