curl --request POST \
--url https://api.exowpee.com/v1/team/organization/companies \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.exowpee.com/v1/team/organization/companies"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.exowpee.com/v1/team/organization/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.exowpee.com/v1/team/organization/companies",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.exowpee.com/v1/team/organization/companies"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
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.exowpee.com/v1/team/organization/companies")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.exowpee.com/v1/team/organization/companies")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"id": "<string>",
"organization_id": "<string>",
"name": "<string>",
"tax_registration_number": "<string>",
"business_registration_number": "<string>",
"address": "<string>",
"city": "<string>",
"country": "<string>",
"logo_url": "<string>",
"type": "<string>",
"currency_code": "<string>",
"currency_exponent": 123,
"is_active": true,
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}{
"message": "<string>",
"errors": {}
}Create a company
Creates a new company in the organization with its tax profile, default settings, books and an administrator role for the creator.
curl --request POST \
--url https://api.exowpee.com/v1/team/organization/companies \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.exowpee.com/v1/team/organization/companies"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.exowpee.com/v1/team/organization/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.exowpee.com/v1/team/organization/companies",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.exowpee.com/v1/team/organization/companies"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
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.exowpee.com/v1/team/organization/companies")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.exowpee.com/v1/team/organization/companies")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"id": "<string>",
"organization_id": "<string>",
"name": "<string>",
"tax_registration_number": "<string>",
"business_registration_number": "<string>",
"address": "<string>",
"city": "<string>",
"country": "<string>",
"logo_url": "<string>",
"type": "<string>",
"currency_code": "<string>",
"currency_exponent": 123,
"is_active": true,
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}{
"message": "<string>",
"errors": {}
}- Only the owner of the organization (the member recorded as its owner) can create a company.
- name, type, country_code, fiscal_status, currency_code and currency_exponent are required.
- The name must be unique among the companies of the organization (compared in lowercase).
- type is one of mepc, gemsd, imed, proj; country_code must be a configured country and fiscal_status one of that country’s fiscal statuses.
- currency_code is trimmed, converted to uppercase and must be 3 characters; currency_exponent is an integer from 0 to 6.
- The logo must be an image of type jpeg, png, jpg, gif or svg, at most 2048 KB.
- The new company is created active, with activated_at set to now and the creator as owner_id.
- The organization’s tax profile for the company’s country and fiscal status is created if missing.
- Default settings are created: the given order currency, time zone Africa/Porto-Novo, rounding 0, default tax value 18 and orders_count 0. With a monthly order limit of 0, order creation is refused until that limit is changed, and no action of this API changes it.
- The creator receives the administrator role and profile of the company and becomes one of its members.
- The built-in capability roles created for the company (names starting with manage) are attached to it.
- The company’s accounting books are opened (chart, journals, role mappings, fee policies and a fiscal year for the current calendar year) in the order currency, and a cash account named after the company is created and linked as its cash_account_id.
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Query Parameters
Response mode. Default none; none answers 204 No Content.
none, resource Comma-separated JSON keys of the root resource (id is always rendered). Available: id, organization_id, name, tax_registration_number, business_registration_number, address, city, country, logo_url, type, currency_code, currency_exponent, is_active, created_at, updated_at.
Comma-separated include paths, each optionally followed by its fields in parentheses: units(id,sku),units.uomUnit(id,name). Max depth 6, max 40 paths. Available: .
Response
Resource (only with response=resource).
Identifier of the company (27-character KSUID string).
Identifier of the organization the record belongs to.
Name of the company, stored in lowercase.
Tax registration number of the company; null when not set.
Business registration number of the company; null when not set.
Street address of the company; null when not set.
City of the company; null when not set.
Country of the company as free text; null when not set.
Public URL of the stored logo image, or null when no logo is set.
Type of the company: mepc (small and medium-sized business), gemsd (large and medium-sized distribution store), imed (importers and distributors) or proj (projects).
3-character order currency code of the company, read from its settings; null when the company has no settings.
Number of decimal places of the currency (0 for XOF). An amount in minor units divided by 10 to this power gives the amount in the currency.
Whether the company is active. An organization turns it on or off with the activate and deactivate actions.
Date and time the record was created (ISO 8601, UTC).
Date and time the record was last changed (ISO 8601, UTC).