TF Fiscal

NFS-e Service Invoices

POST/api/nfse/get_danfse

Get NFS-e PDF

Required headers

tokenstringstringCompany token
signstringstringMD5 signature
timestampstringstringUnix timestamp in seconds

Fields

chave*stringstringVerification code of the NFS-e (codigoVerificacao from the issuance response, codigo_verificacao in the list); for NFS-e of the national system, the 50-digit access key (chave in the issuance response and the list) is also accepted

Note: For São Paulo (Paulistana), returns the link to the municipal PDF page (notaprintpdf.aspx, with the municipal registration, the NFS-e number and the verification code as parameters). For the national system, the PDF is retrieved in real time from the national NFS-e system and returned as a data URI string in the form data:application/pdf;base64,...; if it cannot be retrieved, an error is returned.

Common errors

MessageCause
O campo chave (codigo de verificacao) e obrigatoriochave not provided
NFS-e nao encontrada para a chave informadaNo NFS-e with this verification code or access key under the company of the token
DANFSE nao disponivelThe national system did not return the PDF

Examples

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