- Guides
- Registering organizations
Guides
Registering organizations
Create, edit, and deactivate the issuing companies in your Enterprise account.
An organization is an issuing company in your Enterprise account. Every route on this page uses the Enterprise key.
Create
POST /enterprise/organizations
{
"CNPJCPF": "12345678000195",
"xNome": "Cliente Exemplo LTDA",
"xFant": "Cliente Exemplo",
"email": "fiscal@cliente-exemplo.com.br",
"fone": "+5511999887755",
"IE": "123456789",
"address": {
"xLgr": "Rua das Palmeiras",
"nro": "456",
"xBairro": "Centro",
"cMun": 3550308,
"xMun": "São Paulo",
"UF": "SP",
"CEP": "01002000"
},
"generateApiKey": false
}
| Field | Description |
|---|---|
CNPJCPF | CNPJ or CPF (Brazilian company or individual tax ID), digits only. Cannot be changed later. |
xNome / xFant | Legal name and trade name. |
email, fone, IE | Contact details and state registration (IE). |
address | Address. cMun is the municipality’s IBGE code (7 digits). |
generateApiKey | true also generates an API Key. Requires apiKeyOptions (see the options). |
The response (201) includes organization and, if requested, apiKey. Store the organization.id: it’s used in the other routes.
Edit
PATCH /enterprise/organizations/{organizationId}
Send only the fields that changed:
{ "xNome": "Cliente Exemplo LTDA - Matriz" }
Accepted fields: xNome, xFant, email, fone, IE, address, and isActive.
The body is strict. Any field outside this list returns 400. Sending CNPJCPF, even with the current value, returns 400 CNPJ não pode ser alterado (“CNPJ cannot be changed”).
Deactivate
{ "isActive": false }
While the organization is inactive, all of its API Keys receive 403 Organization is inactive. Send isActive: true to reactivate it.
Fiscal configuration
Before issuing, the organization needs its NF-e settings filled in. Generate a link and send it to the customer:
| Action | Endpoint |
|---|---|
| Create link | POST /bff/enterprise-group/organizations/{organizationId}/fiscal-config-invites |
| List links | GET /bff/enterprise-group/organizations/{organizationId}/fiscal-config-invites |
Digital certificate
The organization also needs an A1 certificate (.pfx). These routes use the organization’s x-api-key:
| Action | Endpoint |
|---|---|
| Upload | POST /certificates/upload (multipart/form-data with file and password) |
| Get the current one | GET /certificates/current |
| Delete | DELETE /certificates/{certificateId} |
curl -X POST https://api.treeunfe.com.br/api/v1/certificates/upload \
-H "x-api-key: ORGANIZATION_RAW_KEY" \
-F "file=@certificado.pfx" \
-F "password=CERTIFICATE_PASSWORD"