POST
/api/rpa/createIssue RPA
Issues the receipt. The calculation is redone server-side at write time, under a (CPF, period) lock — the amount returned by preview is not accepted as input. Requires the year's table to be confirmed. There is no protection against duplicate submissions: each call issues a new receipt and consumes a new number.
Required headers
tokenstring | string | Issuing company token |
signstring | string | MD5 signature: MD5(token + path + body + timestamp) |
timestampstring | string | Unix timestamp in seconds |
Body
prestadorId*string | string | Provider ID (returned by /prestador/save) |
dataPagamento*string | string | Date of payment (YYYY-MM-DD). Defines the period — cash basis |
valorBruto*decimal | decimal | Gross amount of the service |
descricaoServico*string | string | Description of the service rendered |
codigoServicoMunicipalstring | string | Municipal service code (optional) |
outrasDeducoesdecimal | decimal | Alimony and similar deductions |
baseInssOutrosTomadoresdecimal | decimal | INSS base already consumed by other payers in the period. It is a monthly total, taken from the provider's proof of withholding — the INSS ceiling belongs to the person, not to the payer |
valorInssOutrosTomadoresdecimal | decimal | INSS amount already withheld by other payers. Stored with the receipt only; not used in the calculation |
serieint | int | Receipt series. Defaults to 1 when omitted |
* Required field.
Common errors
| Message | Cause |
|---|---|
| prestadorId inválido / prestadorId无效 | Not a valid ObjectId |
| dataPagamento deve estar no formato AAAA-MM-DD / dataPagamento格式须为YYYY-MM-DD | Missing or not in YYYY-MM-DD format |
| valorBruto deve ser maior que zero / valorBruto必须大于零 | valorBruto missing or not greater than 0 |
| valores de dedução não podem ser negativos / 扣除金额不能为负 | outrasDeducoes, baseInssOutrosTomadores or valorInssOutrosTomadores is negative |
| descricaoServico é obrigatório / descricaoServico为必填项 | descricaoServico not provided |
| Prestador não encontrado / 未找到该服务提供方 | The provider of prestadorId does not exist or does not belong to the company |
| Prestador está inativo / 该服务提供方已停用 | The provider is inactive (ativo = false) |
| Tabela de INSS/IRRF do ano ainda não foi confirmada pela contabilidade / 该年度INSS/IRRF税率表尚未经会计确认 | The table of the payment year has not been confirmed by accounting |
Examples
# sign = md5(token + path + body + timestamp) # Template generated from the endpoint path; replace the placeholders curl -X POST "https://api.tffiscal.com/api/rpa/create" \ -H "Content-Type: application/json" \ -H "token: $TOKEN" \ -H "timestamp: $TIMESTAMP" \ -H "sign: $SIGN" \ -d @body.json
{
"prestadorId": "66c1f0a2e4b0a1c2d3e4f5a6",
"dataPagamento": "2026-08-20",
"valorBruto": 3000.00,
"descricaoServico": "Comissao de divulgacao - agosto/2026",
"codigoServicoMunicipal": "",
"outrasDeducoes": 0,
"baseInssOutrosTomadores": 0,
"valorInssOutrosTomadores": 0,
"serie": 1
}
{
"success": true,
"message": "成功",
"data": {
"id": "66c1f4b7e4b0a1c2d3e4f5b1",
"serie": 1,
"numero": 27,
"cpf": "12345678901",
"nomePrestador": "MARIA DA SILVA",
"nit": "12345678901",
"dataPagamento": "2026-08-20",
"competencia": 202608,
"descricaoServico": "Comissao de divulgacao - agosto/2026",
"codigoServicoMunicipal": "",
"valorBruto": 3000.00,
"baseInss": 3000.00,
"aliquotaInssSegurado": 0.11,
"valorInssSegurado": 330.00,
"aliquotaInssPatronal": 0.20,
"valorInssPatronal": 600.00,
"baseInssOutrosTomadores": 0.00,
"valorInssOutrosTomadores": 0.00,
"baseIrrf": 2392.80,
"baseIrrfAcumulada": 2392.80,
"aliquotaIrrf": 0.00,
"parcelaDeduzirIrrf": 0.00,
"qtdDependentes": 0,
"valorDeducaoDependentes": 0.00,
"outrasDeducoes": 0.00,
"valorDescontoSimplificado": 607.20,
"usouDescontoSimplificado": true,
"irrfApuradoAcumulado": 0.00,
"valorRedutorIrrf": 0.00,
"valorIrrf": 0.00,
"valorLiquido": 2670.00,
"custoTotalEmpresa": 3600.00,
"status": "emitido",
"motivoEstorno": "",
"tabelaAno": 2026,
"pdfUrl": "",
"date": "2026-08-20 14:32",
"memoria": "...",
"avisos": []
}
}