1. Organizations
  2. Criar organization
POST

Cria uma empresa emitente (organization) na sua conta Enterprise. Guarde o organization.id da resposta: ele vai no header x-organization-id das chamadas dessa empresa.

​
Autenticação

Envie o header x-enterprise-key.

x-enterprise-key
required
string

Chave Enterprise com a permissão desta rota. Veja Autenticação.

​
Body

application/json

CNPJCPF
required
string

CNPJ ou CPF só com números. Não pode ser alterado depois.

xNome
required
string

Razão social.

xFant
string

Nome fantasia.

email
required
string
fone
string
IE
string

Inscrição estadual.

address
required
object

Endereço no padrão do leiaute da NF-e.

  • xLgr (string) (obrigatório): Logradouro.
  • nro (string) (obrigatório): Número.
  • xCpl (string): Complemento.
  • xBairro (string) (obrigatório): Bairro.
  • cMun (integer) (obrigatório): Código IBGE do município (7 dígitos).
  • xMun (string) (obrigatório): Nome do município.
  • UF (string) (obrigatório): Sigla da UF.
  • CEP (string) (obrigatório): CEP só com números (8 dígitos).
  • fone (string): Telefone só com números.

​
Respostas

StatusDescrição
201Organization criada.
400Body inválido (campo obrigatório ausente, formato incorreto ou campo não permitido).
401Credencial ausente, inválida ou expirada.
curl -X POST "https://api.treeunfe.com.br/api/v1/enterprise/organizations" \
  -H "x-enterprise-key: SUA_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
  }
}