TF Fiscal

Platform & integrations

RPA Receipts

9 endpoints

The RPA API lets you register individual (natural person) service providers, calculate and issue self-employed payment receipts, retrieve the PDF and generate the monthly closing report for accounting. RPA is not an electronic tax document: there is no transmission to the tax authority, no digital signature, no access key and no protocol — and therefore no homologation environment either. The issuing company is resolved from the token, never from the request body. Available only to companies that issue NF-e.

EndpointMethodDescription
/api/rpa/prestador/savePOSTCreate/update provider
/api/rpa/prestador/get_listPOSTList providers
/api/rpa/previewPOSTCalculate without issuing
/api/rpa/createPOSTIssue RPA
/api/rpa/get_listPOSTList RPA
/api/rpa/get_detailPOSTGet RPA detail
/api/rpa/get_pdfPOSTGet RPA PDF
/api/rpa/estornarPOSTReverse RPA
/api/rpa/report/monthlyPOSTMonthly closing

INSS and IRRF are assessed per period and per person, not per receipt: the INSS ceiling and the progressive IRRF bracket take into account everything already paid to the same CPF within the month. That is why the second payment of the month to the same provider may be withheld at a higher amount than the first. The INSS/IRRF table is maintained by the platform per calendar year — there is nothing to register. Until a new year's figures have been validated by an accountant, /preview keeps calculating while /create returns an error, instead of issuing a receipt with unverified withholding.

POST/api/rpa/prestador/save

Create/update provider

Creates or updates the individual provider record. The CPF identifies the provider within the company: two records with the same CPF are not allowed. The individual is not an issuer — no account and no certificate required.

Required headers

HeaderTypeDescription
tokenstringIssuing company token
signstringMD5 signature: MD5(token + path + body + timestamp)
timestampstringUnix timestamp in seconds

Body

FieldTypeDescription
idstringRecord ID. Empty creates; filled updates
cpf *stringProvider CPF (11 digits)
name *stringProvider full name
nitstringNIT/PIS/PASEP. Without it accounting cannot file in eSocial
qtdDependentesintDependents for IRRF deduction (monthly deduction, not per receipt)
ativoboolProvider active

* Required field.

POST/api/rpa/prestador/get_list

List providers

Required headers

HeaderTypeDescription
tokenstringIssuing company token
signstringMD5 signature: MD5(token + path + body + timestamp)
timestampstringUnix timestamp in seconds

Body

FieldTypeDescription
pageintPage (default 1)
pageSizeintItems per page (default 20)
keywordstringSearch by name or CPF
somenteAtivosboolReturn only active providers
POST/api/rpa/preview

Calculate without issuing

Calculates the withholding without persisting anything: no receipt is created and no number is consumed. This is the recommended step before confirming a payment — in an RPA the provider receives less than the agreed amount, and issuing cannot be undone (a reversal does not return the number). Preview is never blocked: if a year's table has not been validated yet, it still calculates and flags this in avisos, while /create refuses.

Required headers

HeaderTypeDescription
tokenstringIssuing company token
signstringMD5 signature: MD5(token + path + body + timestamp)
timestampstringUnix timestamp in seconds

Body

FieldTypeDescription
prestadorId *stringProvider ID (returned by /prestador/save)
dataPagamento *stringDate of payment (YYYY-MM-DD). Defines the period — cash basis
valorBruto *decimalGross amount of the service
outrasDeducoesdecimalAlimony and similar deductions
baseInssOutrosTomadoresdecimalINSS 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
valorInssOutrosTomadoresdecimalINSS already withheld by other payers (informational)

* Required field.

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.

Required headers

HeaderTypeDescription
tokenstringIssuing company token
signstringMD5 signature: MD5(token + path + body + timestamp)
timestampstringUnix timestamp in seconds

Body

FieldTypeDescription
prestadorId *stringProvider ID (returned by /prestador/save)
dataPagamento *stringDate of payment (YYYY-MM-DD). Defines the period — cash basis
valorBruto *decimalGross amount of the service
descricaoServico *stringDescription of the service rendered
codigoServicoMunicipalstringMunicipal service code (optional)
outrasDeducoesdecimalAlimony and similar deductions
baseInssOutrosTomadoresdecimalINSS 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
serieintReceipt series. Defaults to 1 when omitted

* Required field.

POST/api/rpa/get_list

List RPA

Required headers

HeaderTypeDescription
tokenstringIssuing company token
signstringMD5 signature: MD5(token + path + body + timestamp)
timestampstringUnix timestamp in seconds

Body

FieldTypeDescription
pageintPage (default 1)
pageSizeintItems per page (default 20)
competenciaintPeriod in YYYYMM format
cpfstringProvider CPF (11 digits)
statusstringFilter: emitido or estornado
POST/api/rpa/get_detail

Get RPA detail

Required headers

HeaderTypeDescription
tokenstringIssuing company token
signstringMD5 signature: MD5(token + path + body + timestamp)
timestampstringUnix timestamp in seconds

Body

FieldTypeDescription
id *stringReceipt ID

* Required field.

POST/api/rpa/get_pdf

Get RPA PDF

Returns the receipt PDF URL. It is generated on the first call and reused afterwards. The PDF derives from stored data — including the frozen calculation memo — so regerar never changes any amount.

Required headers

HeaderTypeDescription
tokenstringIssuing company token
signstringMD5 signature: MD5(token + path + body + timestamp)
timestampstringUnix timestamp in seconds

Body

FieldTypeDescription
id *stringReceipt ID
regerarboolForce PDF rebuild instead of reusing

* Required field.

POST/api/rpa/estornar

Reverse RPA

Logical reversal — there is no cancellation, because the RPA is not transmitted anywhere. The receipt stays in the listing flagged as reversed, drops out of every closing total, and the number does not return to the sequence. Later receipts in the same period are not recalculated.

Required headers

HeaderTypeDescription
tokenstringIssuing company token
signstringMD5 signature: MD5(token + path + body + timestamp)
timestampstringUnix timestamp in seconds

Body

FieldTypeDescription
id *stringReceipt ID
motivo *stringReversal reason (minimum 5 characters)

* Required field.

POST/api/rpa/report/monthly

Monthly closing

Returns, per receipt, what eSocial requires (CPF, NIT, category, bases and amounts of each withholding), the period totals and the alerts that block filing: temEstorno and prestadoresSemNit. Reversed receipts appear in itens but are excluded from the totals.

Required headers

HeaderTypeDescription
tokenstringIssuing company token
signstringMD5 signature: MD5(token + path + body + timestamp)
timestampstringUnix timestamp in seconds

Body

FieldTypeDescription
competencia *intPeriod in YYYYMM format

* Required field.