1. Organizations
  2. Create organization
POST

Creates an issuing company (organization) in your Enterprise account. Store the organization.id from the response: it goes in the x-organization-id header of that company’s calls.

​
Authentication

Send the x-enterprise-key header.

x-enterprise-key
required
string

Enterprise key with this route’s permission. See Authentication.

​
Body

application/json

CNPJCPF
required
string

CNPJ or CPF, digits only. Cannot be changed later.

xNome
required
string

Legal name.

xFant
string

Trade name.

email
required
string
fone
string
IE
string

State registration.

address
required
object

Address following the NF-e layout.

  • xLgr (string) (required): Street.
  • nro (string) (required): Number.
  • xCpl (string): Address line 2.
  • xBairro (string) (required): Neighborhood.
  • cMun (integer) (required): The municipality’s IBGE code (7 digits).
  • xMun (string) (required): Municipality name.
  • UF (string) (required): State abbreviation.
  • CEP (string) (required): Postal code (CEP), digits only (8 digits).
  • fone (string): Phone number, digits only.

​
Responses

StatusDescription
201Organization created.
400Invalid body (missing required field, wrong format, or field not allowed).
401Credential missing, invalid, or expired.
curl -X POST "https://api.treeunfe.com.br/api/v1/enterprise/organizations" \
  -H "x-enterprise-key: YOUR_ENTERPRISE_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "CNPJCPF": "12345678000195",
    "xNome": "CLIENTE EXEMPLO LTDA",
    "xFant": "CLIENTE EXEMPLO",
    "email": "fiscal@cliente-exemplo.com.br",
    "fone": "44999990000",
    "IE": "9071311225",
    "address": {
      "xLgr": "Avenida Exemplo",
      "nro": "5145",
      "xBairro": "Zona 07",
      "cMun": 4115200,
      "xMun": "MARINGA",
      "UF": "PR",
      "CEP": "87020035"
    }
  }'
{
  "organization": {
    "id": "string",
    "CNPJCPF": "string",
    "xNome": "string",
    "xFant": "string",
    "email": "string",
    "fone": "string",
    "IE": "string",
    "address": {
      "xLgr": "Rua das Palmeiras",
      "nro": "456",
      "xCpl": "string",
      "xBairro": "Centro",
      "cMun": 3550308,
      "xMun": "São Paulo",
      "UF": "SP",
      "CEP": "01002000",
      "fone": "string"
    },
    "isActive": true
  }
}