Files
File download
Downloads XML, DANFE, DACCE or DACTE through the links returned by queries and callbacks.
/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
kindstringrequiredFile kind:
xml(authorized XML or event receipt),danfe,dacceordacte(CT-e).refstringrequiredFile id or the 44-digit access key.
Query parameters
tokenstringrequiredLink token issued by the platform. Never build or alter it manually.
Responses
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
| Code | HTTP | |
|---|---|---|
| 10009035 | 401 | Download link invalid (path altered, token reused or signature mismatch). |
| 10009036 | 401 | Download link expired. Query the document again to obtain a fresh link. |
| 10009037 | 503 | File not ready yet (rendering service busy). Retry the same link after |
| 10013011 | 404 | File not found. |
| 10013016 | 429 | Too many downloads from one IP. 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:
linkDanfeis 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
FILESgroup; they are not billed.
