/api/sped/efdGenerate SPED EFD
Generates the SPED EFD ICMS/IPI (Digital Tax Bookkeeping) file for the given period, from the company's self-issued invoices (NF-e model 55) in the production environment — outbound and inbound (e.g., returns, tpNF=0), including canceled ones (record C100 with COD_SIT=02, per the Guia Prático). Using the status and tipo parameters select what goes into the file: issued/canceled/all and inbound/outbound/all. It builds blocks 0/B/C/D/E/G/H/K/1/9, the ICMS assessment (E110/E116 — debits from outbound transactions × credits from inbound transactions), the participants and the accountant (record 0100, filled automatically from the company's accountant registration, when present). The file is generated in ISO-8859-1, uploaded to storage, and the response returns the download link in arquivo_url.
Required headers
tokenstring | string | Company token |
signstring | string | MD5 signature |
timestampstring | string | Unix timestamp in seconds |
Body — parameters
start_*string | string | Start of the period, in dd/MM/yyyy or dd/MM/yyyy HH:mm:ss format.Without the time, it assumes 00:00:00. São Paulo time zone. |
end_*string | string | End of the period (same format). The end is exclusive — for a full month, use the 1st day of the following month (e.g., 01/07/2026). |
statusstring | string | Optional. Status of the invoices included: "todas" (default), "emitidas" (authorized only) or "canceladas" (cancelled). Case and accents are ignored; singular forms and "autorizadas" are also accepted. Other values return an error. |
tipostring | string | Optional. Operation type: "todas" (default), "saida" or "entrada" (accented spelling also accepted). Inbound = self-issued invoice with tpNF=0, such as returns. When a filter (status or tipo) is applied, the file is a partial cut for review — the official monthly EFD must contain all invoices. |
limitnumber | number | Optional. Limits the number of authorized invoices processed — for quick testing only. The cut is applied before the tipo filter. |
cod_string | string | Optional. Overrides the layout version (COD_VER). Default "020" (the version applicable in 2026). |
perfilstring | string | Optional. Overrides the presentation profile (IND_PERFIL: A/B/C). Default "A". |
ativstring | string | Optional. Overrides the activity indicator (IND_ATIV): 0 industrial or equivalent, 1 other. Default "1". |
* Required field.
Examples
# sign = md5(token + path + body + timestamp) # Template generated from the endpoint path; replace the placeholders curl -X POST "https://api.tffiscal.com/api/sped/efd" \ -H "Content-Type: application/json" \ -H "token: $TOKEN" \ -H "timestamp: $TIMESTAMP" \ -H "sign: $SIGN" \ -d @body.json
{
"start_date": "01/06/2026",
"end_date": "01/07/2026"
}
{
"success": true,
"message": "成功",
"data": {
"company_id": 4512,
"periodo": {
"de": "01/06/2026",
"ate": "30/06/2026"
},
"filtros": {
"status": "todas",
"tipo": "todas"
},
"linhas": 279,
"bytes": 24201,
"avisos": [],
"arquivo_url": "https://tffiscal-file.tffiscal.com/sped.......txt"
}
}