POST
/api/rpa/prestador/saveCreate/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. An update overwrites the whole record with the request body: omitted fields are cleared and ativo becomes true when omitted; dataNascimento is the exception and keeps its previous value when omitted or malformed.
Required headers
tokenstring | string | Issuing company token |
signstring | string | MD5 signature: MD5(token + path + body + timestamp) |
timestampstring | string | Unix timestamp in seconds |
Body
| Identification | ||
idstring | string | Record ID. Empty creates a new record; filled updates that record, and an error is returned if it does not exist |
cpf*string | string | Provider CPF (11 digits); non-digit characters are removed |
name*string | string | Provider name |
nitstring | string | NIT/PIS/PASEP; only digits are kept. Without it accounting cannot file in eSocial |
dataNascimentostring | string | Date of birth (YYYY-MM-DD). Ignored when the format does not match |
| Address and contact | ||
enderecostring | string | Street |
numerostring | string | Number |
complementostring | string | Address complement |
bairrostring | string | Neighborhood |
citystring | string | City |
ufstring | string | State abbreviation (2 letters), stored in upper case |
cepstring | string | Postal code; only digits are kept |
telefonestring | string | Phone |
emailstring | string | |
| Tax | ||
inscricaoMunicipalstring | string | Municipal registration |
qtdDependentesint | int | Dependents for IRRF deduction (monthly deduction, not per receipt). Negative values are treated as 0 |
| Payment details | ||
bancostring | string | Bank |
agenciastring | string | Branch |
contastring | string | Account number |
tipoContastring | string | Account type |
pixstring | string | PIX key |
| Status | ||
ativobool | bool | Provider active; default true.Inactive providers cannot be used in /preview and /create |
* Required field.
Common errors
| Message | Cause |
|---|---|
| cpf deve ter 11 dígitos / cpf必须为11位数字 | Not 11 digits after removing non-digit characters |
| name é obrigatório / name为必填项 | name not provided |
| id inválido / id无效 | id is not a valid ObjectId |
| Prestador não encontrado / 未找到该服务提供方 | The record of the id does not exist or does not belong to the company |
| Já existe prestador com este CPF / 该CPF已存在服务提供方 | Another record of the company already uses this CPF |
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/prestador/save" \ -H "Content-Type: application/json" \ -H "token: $TOKEN" \ -H "timestamp: $TIMESTAMP" \ -H "sign: $SIGN" \ -d @body.json
{
"cpf": "12345678901",
"nit": "12345678901",
"name": "MARIA DA SILVA",
"dataNascimento": "1990-05-12",
"qtdDependentes": 0,
"endereco": "Rua das Flores",
"numero": "100",
"bairro": "Centro",
"city": "Sao Paulo",
"uf": "SP",
"cep": "01000000",
"email": "maria@exemplo.com",
"pix": "maria@exemplo.com",
"ativo": true
}
{
"success": true,
"message": "成功",
"data": {
"id": "66c1f0a2e4b0a1c2d3e4f5a6",
"cpf": "12345678901",
"nit": "12345678901",
"name": "MARIA DA SILVA",
"dataNascimento": "1990-05-12",
"endereco": "Rua das Flores",
"complemento": "",
"numero": "100",
"bairro": "Centro",
"city": "Sao Paulo",
"uf": "SP",
"cep": "01000000",
"telefone": "",
"email": "maria@exemplo.com",
"inscricaoMunicipal": "",
"qtdDependentes": 0,
"banco": "",
"agencia": "",
"conta": "",
"tipoConta": "",
"pix": "maria@exemplo.com",
"ativo": true,
"nitPendente": false
}
}