- Organizations
- Editar organization
Organizations
Editar organization
Atualiza os dados cadastrais
PATCH
/enterprise/organizations/{organizationId}
curl --request PATCH \
--url https://api.treeunfe.com.br/api/v1/enterprise/organizations/{organizationId} \
--header 'x-api-key: <api-key>' \
--header 'x-enterprise-key: <x_enterprise_key>' \
--header 'Content-Type: application/json' \
--data '{
"xNome": "<string>",
"xFant": "<string>",
"email": "<string>",
"fone": "<string>",
"IE": "<string>",
"address": "<value>",
"isActive": true
}'
curl --request PATCH \
--url https://api.treeunfe.com.br/api/v1/enterprise/organizations/{organizationId} \
--header 'x-api-key: <api-key>' \
--header 'x-enterprise-key: <x_enterprise_key>' \
--header 'Content-Type: application/json' \
--data '{
"xNome": "<string>",
"xFant": "<string>",
"email": "<string>",
"fone": "<string>",
"IE": "<string>",
"address": "<value>",
"isActive": true
}'Atualiza os dados cadastrais. O body é estrito: qualquer campo fora da lista
retorna 400. Enviar CNPJCPF retorna 400 CNPJ não pode ser alterado.
isActive: false inativa a organization; as API Keys dela passam a receber
403 Organization is inactive.
Autenticação
Envie o header x-enterprise-key.
x-enterprise-key
string
Chave da conta Enterprise (escopo enterprise:manage).
Parâmetros de rota
organizationId
required
string
ID (UUID) da organization.
Body
application/json
xNome
string
xFant
string
email
string
fone
string
IE
string
address
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.
isActive
boolean
false inativa a organization: as chaves dela passam a receber 403 nas rotas operacionais.
Respostas
| Status | Descrição |
|---|---|
200 | Organization atualizada. |
400 | Body inválido (campo obrigatório ausente, formato incorreto ou campo não permitido). |
401 | Credencial ausente, inválida ou expirada. |
404 | Recurso não encontrado. |
curl -X PATCH "https://api.treeunfe.com.br/api/v1/enterprise/organizations/7a6b2d8e-4bc3-4a25-a298-adb3ba63f9de" \
-H "x-enterprise-key: SUA_ENTERPRISE_KEY" \
-H "Content-Type: application/json" \
-d '{
"xNome": "CLIENTE EXEMPLO LTDA - FILIAL"
}'
{
"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
}
}
curl -X PATCH "https://api.treeunfe.com.br/api/v1/enterprise/organizations/7a6b2d8e-4bc3-4a25-a298-adb3ba63f9de" \
-H "x-enterprise-key: SUA_ENTERPRISE_KEY" \
-H "Content-Type: application/json" \
-d '{
"xNome": "CLIENTE EXEMPLO LTDA - FILIAL"
}'
curl --request PATCH \
--url https://api.treeunfe.com.br/api/v1/enterprise/organizations/{organizationId} \
--header 'x-api-key: <api-key>' \
--header 'x-enterprise-key: <x_enterprise_key>' \
--header 'Content-Type: application/json' \
--data '{
"xNome": "<string>",
"xFant": "<string>",
"email": "<string>",
"fone": "<string>",
"IE": "<string>",
"address": "<value>",
"isActive": true
}'
curl --request PATCH \
--url https://api.treeunfe.com.br/api/v1/enterprise/organizations/{organizationId} \
--header 'x-api-key: <api-key>' \
--header 'x-enterprise-key: <x_enterprise_key>' \
--header 'Content-Type: application/json' \
--data '{
"xNome": "<string>",
"xFant": "<string>",
"email": "<string>",
"fone": "<string>",
"IE": "<string>",
"address": "<value>",
"isActive": true
}'{
"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
}
}