TF Fiscal

RPA Receipts

POST/api/rpa/create

Issue 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

tokenstringstringIssuing company token
signstringstringMD5 signature: MD5(token + path + body + timestamp)
timestampstringstringUnix timestamp in seconds

Body

prestadorId*stringstringProvider ID (returned by /prestador/save)
dataPagamento*stringstringDate of payment (YYYY-MM-DD).
valorBruto*decimaldecimalGross amount of the service
descricaoServico*stringstringDescription of the service rendered
codigoServicoMunicipalstringstringMunicipal service code (optional)
outrasDeducoesdecimaldecimalAlimony and similar deductions
baseInssOutrosTomadoresdecimaldecimalINSS base already consumed by other payers in the period.
valorInssOutrosTomadoresdecimaldecimalINSS amount already withheld by other payers.
serieintintReceipt series.

 * Required field.

Common errors

MessageCause
prestadorId inválido / prestadorId无效Not a valid ObjectId
dataPagamento deve estar no formato AAAA-MM-DD / dataPagamento格式须为YYYY-MM-DDMissing 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