Update a company
curl --request PUT \
--url https://api.example.com/companies/{id} \
--header 'Content-Type: application/json' \
--data '{}'import requests
url = "https://api.example.com/companies/{id}"
payload = {}
headers = {"Content-Type": "application/json"}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({})
};
fetch('https://api.example.com/companies/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/companies/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/companies/{id}"
payload := strings.NewReader("{}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://api.example.com/companies/{id}")
.header("Content-Type", "application/json")
.body("{}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/companies/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Content-Type"] = 'application/json'
request.body = "{}"
response = http.request(request)
puts response.read_body{
"id": "e4b6d4e8-8e6d-41da-abdb-8fc358a9e7f1",
"tenantId": "e305e9a4-585e-49b8-bc88-9fba992c6326",
"name": "Acme Corp (Atualizada)",
"document": "12345678000199",
"status": "ACTIVE",
"email": "contato_novo@acme.com",
"address": null,
"settings": {},
"taxRegime": "SIMPLES_NACIONAL",
"costMethod": "WEIGHTED_AVERAGE",
"createdAt": "2024-01-01T12:00:00.000Z",
"updatedAt": "2024-02-01T12:00:00.000Z"
}
Companies
Atualizar Empresa
Atualiza os dados de uma empresa existente.
PUT
/
companies
/
{id}
Update a company
curl --request PUT \
--url https://api.example.com/companies/{id} \
--header 'Content-Type: application/json' \
--data '{}'import requests
url = "https://api.example.com/companies/{id}"
payload = {}
headers = {"Content-Type": "application/json"}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({})
};
fetch('https://api.example.com/companies/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/companies/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/companies/{id}"
payload := strings.NewReader("{}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://api.example.com/companies/{id}")
.header("Content-Type", "application/json")
.body("{}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/companies/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Content-Type"] = 'application/json'
request.body = "{}"
response = http.request(request)
puts response.read_body{
"id": "e4b6d4e8-8e6d-41da-abdb-8fc358a9e7f1",
"tenantId": "e305e9a4-585e-49b8-bc88-9fba992c6326",
"name": "Acme Corp (Atualizada)",
"document": "12345678000199",
"status": "ACTIVE",
"email": "contato_novo@acme.com",
"address": null,
"settings": {},
"taxRegime": "SIMPLES_NACIONAL",
"costMethod": "WEIGHTED_AVERAGE",
"createdAt": "2024-01-01T12:00:00.000Z",
"updatedAt": "2024-02-01T12:00:00.000Z"
}
Path
string
required
UUID da empresa que será atualizada.
Body
string
Razão Social ou Nome Fantasia da empresa.
string
CNPJ ou CPF (somente números).
string
Email de contato da empresa.
object
Endereço completo estruturado.
object
Configurações extras da empresa alocadas em JSON.
Response
{
"id": "e4b6d4e8-8e6d-41da-abdb-8fc358a9e7f1",
"tenantId": "e305e9a4-585e-49b8-bc88-9fba992c6326",
"name": "Acme Corp (Atualizada)",
"document": "12345678000199",
"status": "ACTIVE",
"email": "contato_novo@acme.com",
"address": null,
"settings": {},
"taxRegime": "SIMPLES_NACIONAL",
"costMethod": "WEIGHTED_AVERAGE",
"createdAt": "2024-01-01T12:00:00.000Z",
"updatedAt": "2024-02-01T12:00:00.000Z"
}
Path Parameters
Body
application/json
Update status
Available options:
ACTIVE, DISABLED, BLOCKED, SUSPENDED Response
Company updated successfully.
Company Name
Example:
"Acme Corp"
CNPJ or CPF
Example:
"12345678000199"
Company Status
Available options:
ACTIVE, DISABLED, BLOCKED, SUSPENDED Example:
"ACTIVE"
Configuration Settings
Example:
{}
Tax Regime
Available options:
SIMPLES_NACIONAL, LUCRO_PRESUMIDO, LUCRO_REAL Example:
"SIMPLES_NACIONAL"
Cost Method
Available options:
REPLACEMENT, WEIGHTED_AVERAGE Example:
"WEIGHTED_AVERAGE"
Contact Email
Example:
"contact@acme.com"
Address Object