Creates an account in the company's chart of accounts, optionally linked to one or more cost or profit centers.
Identify the owning company with exactly one of company_id or company_account_external_id. Sending both, or neither, is rejected.
Unknown fields are rejected, so check field names carefully.
Creates an account in the company's chart of accounts. In the same call you can link it to reference accounts (account_mappings), attach classification codes (code_mappings) and link cost or profit centers (centers).
Identify the owning company with exactly one of company_id or company_account_external_id. Sending both, or neither, is rejected.
Unknown fields are rejected, so check field names carefully.
Creating, not updating
This endpoint only creates accounts. Sending an account_external_id that already exists for the company is rejected. To change an existing account, including its mappings, use Account Management in the dashboard.
Create parent accounts before their children: parent_account must point to an account that already exists.
Hierarchy rules
| Rule | Error |
|---|---|
| The parent exists in the same company | Parent account not found for <code> (404) |
| The parent code is unique in the company | More than one account with code <code> in the company |
The parent is synthetic (type: "S") | Parent account must be of type SYNTHETIC (S) |
The parent is ACTIVE | Parent account must be ACTIVE |
level is greater than the parent's level | Parent account level must be lower than the account level |
end_date is not before start_date (same day accepted) | End date cannot be before the start date |
nature
naturenature is a Brinta code with one meaning for every obligation. Each obligation translates it into its own code, and some obligations accept only part of the list. It can be omitted or sent as null.
nature | Meaning |
|---|---|
| 1 | Asset (Ativo) |
| 2 | Liability (Passivo) |
| 3 | Equity (Patrimônio Líquido) |
| 4 | Revenue (Receita) |
| 5 | Expense (Despesa) |
| 6 | Memorandum (Compensação) |
| 7 | Other (Outras) |
Mappings
account_mappings: reference accounts
account_mappings: reference accountsLinks the account to an account in a reference group, such as a referential chart of accounts. Each item names the group and the account code inside it.
"account_mappings": [
{ "group": "COSIF", "account": "1.1.1.10.00.00-8" }
]- Send the group name and the account code exactly as they appear in the group, with dots and dashes.
1111000008instead of1.1.1.10.00.00-8answersAccount 1111000008 not found in group COSIF. - Groups currently available:
COSIF,DESIF,SUSEP,CodTrib IBS/CBS - DeRe,L100A,L100B,L100C,L300A,L300B,L300C. Contact Brinta for other groups or for the list of accounts in a group. - Each group accepts a limited number of mapped accounts per account, usually one.
code_mappings: classification codes
code_mappings: classification codesAttaches a code value to the account, one value per type.
"code_mappings": [
{ "type": "dere_ind_trib_iss", "value": "0" }
]- Types currently available:
dere_ind_trib_iss(DeRE ISS indicator,0or1),cod_det,cod_comp,field_number. Contact Brinta for the values each type accepts. - Each type can be sent only once per account.
Checking mappings
The response does not return account_mappings or code_mappings. To check them after the load, use Account Management in the dashboard.
For obligation-specific mappings, see the obligation guides, for example DeRE: chart of accounts via the Accounts API.
Errors
Format errors always answer 400, before any rule is applied. details carries only the first error found.
{
"status_code": 400,
"error": "Bad Request",
"message": "Validation error: The provided data does not match the required format",
"details": {
"code": "INVALID_PARAMETERS",
"message": "'split_code' must be 3 digits, from 000 to 999",
"invalid_params": ["split_code"]
}
}details.code | When |
|---|---|
INVALID_PARAMETERS | Both or neither company identifiers were sent, account_external_id is missing, split_code does not have three digits, or nature is not empty or 1 to 7 |
INVALID_ENUM_VALUE | status or sub_nature outside its list (including sub_nature as null) |
REQUIRED_FIELD | A required field is missing, or type/value is missing in a code mapping, or group/account in an account mapping |
| No code | Any other format error: an unknown field, a wrong type, an invalid date or a text longer than the maximum |
Business-rule errors answer with this body, without an error code: the message says which rule failed.
{ "response_data_body": "Parent account must be of type SYNTHETIC (S)", "status_code": 400 }| Status | response_data_body | When |
|---|---|---|
| 404 | Company not found or not related to parent company | The company does not exist or is not in your token's group |
| 400 | National account already exists with account <code> and company <company> | The code already exists in that company |
| 400 | Only parentCompanyExternalId or parentCompanyId can be sent, not both | Both parent company identifiers were sent |
| 400 | Location not found | location is not a valid country |
| 404 / 400 | Hierarchy errors | See Hierarchy rules |
| 400 | Account <code> not found in group <group> | The group, or the account in the group, does not exist |
| 400 | More than one account <code> in group <group> | The code is duplicated inside the group |
| 400 | Account mapping sent more than once: <group>/<code> | The same pair is repeated in account_mappings |
| 400 | Too many accounts mapped for the group | More accounts were mapped than the group allows |
| 400 | Unknown code mapping type: <types> | A type in code_mappings does not exist |
| 400 | Code mapping type sent more than once: <types> | A type is repeated in code_mappings |
| 400 | indTribISS must be 0 or 1 | dere_ind_trib_iss has another value |
| 500 | Error creating national account | Saving failed |
| 500 | Error processing centers | The centers failed, but the account was already created: a retry returns the duplicate-account error |
| 500 | Account created but could not be retrieved | The account was created, but could not be read for the response |
500Saving failed. If the error is Error processing centers, the account was already created: a retry returns the duplicate-account error.
