Create a new company
curl --request POST \
--url https://api.example.com/companies \
--header 'Content-Type: application/json' \
--data '
{
"name": "Acme Corp",
"document": "12345678000199",
"email": "contact@acme.com",
"address": {},
"settings": {}
}
'import requests
url = "https://api.example.com/companies"
payload = {
"name": "Acme Corp",
"document": "12345678000199",
"email": "contact@acme.com",
"address": {},
"settings": {}
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'Acme Corp',
document: '12345678000199',
email: 'contact@acme.com',
address: {},
settings: {}
})
};
fetch('https://api.example.com/companies', 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",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'name' => 'Acme Corp',
'document' => '12345678000199',
'email' => 'contact@acme.com',
'address' => [
],
'settings' => [
]
]),
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"
payload := strings.NewReader("{\n \"name\": \"Acme Corp\",\n \"document\": \"12345678000199\",\n \"email\": \"contact@acme.com\",\n \"address\": {},\n \"settings\": {}\n}")
req, _ := http.NewRequest("POST", 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.post("https://api.example.com/companies")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Acme Corp\",\n \"document\": \"12345678000199\",\n \"email\": \"contact@acme.com\",\n \"address\": {},\n \"settings\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/companies")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"Acme Corp\",\n \"document\": \"12345678000199\",\n \"email\": \"contact@acme.com\",\n \"address\": {},\n \"settings\": {}\n}"
response = http.request(request)
puts response.read_body{
"id": "e4b6d4e8-8e6d-41da-abdb-8fc358a9e7f1",
"tenantId": "e305e9a4-585e-49b8-bc88-9fba992c6326",
"name": "Acme Corp",
"document": "12345678000199",
"status": "ACTIVE",
"email": "contact@acme.com",
"address": null,
"settings": {},
"taxRegime": "SIMPLES_NACIONAL",
"costMethod": "WEIGHTED_AVERAGE",
"createdAt": "2024-01-01T12:00:00.000Z",
"updatedAt": "2024-01-01T12:00:00.000Z"
}
Companies
Criar Empresa
Cria uma nova empresa sob o tenant atual autenticado.
POST
/
companies
Create a new company
curl --request POST \
--url https://api.example.com/companies \
--header 'Content-Type: application/json' \
--data '
{
"name": "Acme Corp",
"document": "12345678000199",
"email": "contact@acme.com",
"address": {},
"settings": {}
}
'import requests
url = "https://api.example.com/companies"
payload = {
"name": "Acme Corp",
"document": "12345678000199",
"email": "contact@acme.com",
"address": {},
"settings": {}
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'Acme Corp',
document: '12345678000199',
email: 'contact@acme.com',
address: {},
settings: {}
})
};
fetch('https://api.example.com/companies', 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",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'name' => 'Acme Corp',
'document' => '12345678000199',
'email' => 'contact@acme.com',
'address' => [
],
'settings' => [
]
]),
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"
payload := strings.NewReader("{\n \"name\": \"Acme Corp\",\n \"document\": \"12345678000199\",\n \"email\": \"contact@acme.com\",\n \"address\": {},\n \"settings\": {}\n}")
req, _ := http.NewRequest("POST", 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.post("https://api.example.com/companies")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Acme Corp\",\n \"document\": \"12345678000199\",\n \"email\": \"contact@acme.com\",\n \"address\": {},\n \"settings\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/companies")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"Acme Corp\",\n \"document\": \"12345678000199\",\n \"email\": \"contact@acme.com\",\n \"address\": {},\n \"settings\": {}\n}"
response = http.request(request)
puts response.read_body{
"id": "e4b6d4e8-8e6d-41da-abdb-8fc358a9e7f1",
"tenantId": "e305e9a4-585e-49b8-bc88-9fba992c6326",
"name": "Acme Corp",
"document": "12345678000199",
"status": "ACTIVE",
"email": "contact@acme.com",
"address": null,
"settings": {},
"taxRegime": "SIMPLES_NACIONAL",
"costMethod": "WEIGHTED_AVERAGE",
"createdAt": "2024-01-01T12:00:00.000Z",
"updatedAt": "2024-01-01T12:00:00.000Z"
}
Permite que um usuário autenticado crie uma “Company”, que representa uma entidade fiscal ou filial, dentro de seu lojista (tenant).
Body
string
required
Razão Social ou Nome Fantasia da empresa. (ex: Acme Corp)
string
required
CNPJ ou CPF (somente números). Deve ser único globalmente.
string
Email de contato da empresa.
object
Endereço completo estruturado. (ex: rua, número, cidade, estado, cep)
object
Configurações iniciais extras estruturadas em JSON.
Response
{
"id": "e4b6d4e8-8e6d-41da-abdb-8fc358a9e7f1",
"tenantId": "e305e9a4-585e-49b8-bc88-9fba992c6326",
"name": "Acme Corp",
"document": "12345678000199",
"status": "ACTIVE",
"email": "contact@acme.com",
"address": null,
"settings": {},
"taxRegime": "SIMPLES_NACIONAL",
"costMethod": "WEIGHTED_AVERAGE",
"createdAt": "2024-01-01T12:00:00.000Z",
"updatedAt": "2024-01-01T12:00:00.000Z"
}
Body
application/json
Response
Company created 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