curl --request POST \
--url https://external.pleo.io/v1/chart-of-accounts \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json;charset=UTF-8' \
--data '
{
"archived": true,
"companyId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"externalId": "<string>",
"name": "<string>",
"code": "<string>",
"metadata": {},
"taxCodeExternalId": "<string>"
}
'import requests
url = "https://external.pleo.io/v1/chart-of-accounts"
payload = {
"archived": True,
"companyId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"externalId": "<string>",
"name": "<string>",
"code": "<string>",
"metadata": {},
"taxCodeExternalId": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json;charset=UTF-8"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
Authorization: 'Bearer <token>',
'Content-Type': 'application/json;charset=UTF-8'
},
body: JSON.stringify({
archived: true,
companyId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
externalId: '<string>',
name: '<string>',
code: '<string>',
metadata: {},
taxCodeExternalId: '<string>'
})
};
fetch('https://external.pleo.io/v1/chart-of-accounts', 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://external.pleo.io/v1/chart-of-accounts",
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([
'archived' => true,
'companyId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'externalId' => '<string>',
'name' => '<string>',
'code' => '<string>',
'metadata' => [
],
'taxCodeExternalId' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json;charset=UTF-8"
],
]);
$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://external.pleo.io/v1/chart-of-accounts"
payload := strings.NewReader("{\n \"archived\": true,\n \"companyId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"externalId\": \"<string>\",\n \"name\": \"<string>\",\n \"code\": \"<string>\",\n \"metadata\": {},\n \"taxCodeExternalId\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json;charset=UTF-8")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://external.pleo.io/v1/chart-of-accounts")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json;charset=UTF-8")
.body("{\n \"archived\": true,\n \"companyId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"externalId\": \"<string>\",\n \"name\": \"<string>\",\n \"code\": \"<string>\",\n \"metadata\": {},\n \"taxCodeExternalId\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://external.pleo.io/v1/chart-of-accounts")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json;charset=UTF-8'
request.body = "{\n \"archived\": true,\n \"companyId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"externalId\": \"<string>\",\n \"name\": \"<string>\",\n \"code\": \"<string>\",\n \"metadata\": {},\n \"taxCodeExternalId\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"archived": false,
"code": "2001",
"companyId": "123e4567-e89b-12d3-a456-426614174006",
"externalId": "External Id",
"id": "123e4567-e89b-12d3-a456-426614174005",
"name": "Bank Charges",
"taxCodeExternalId": "IVA 20"
}
}{
"data": {
"archived": false,
"code": "2001",
"companyId": "123e4567-e89b-12d3-a456-426614174006",
"externalId": "External Id",
"id": "123e4567-e89b-12d3-a456-426614174005",
"name": "Bank Charges",
"taxCodeExternalId": "IVA 20"
}
}"Bad Request: for example, missing required fields.""Conflict: account with the same `externalId` exists in Pleo."Create a new account
The integration sends a request to this endpoint to create a corresponding account in Pleo for any new record created in the external ERP/accounting system.
The request will fail if an account with the same externalId and companyId already exists in Pleo.
curl --request POST \
--url https://external.pleo.io/v1/chart-of-accounts \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json;charset=UTF-8' \
--data '
{
"archived": true,
"companyId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"externalId": "<string>",
"name": "<string>",
"code": "<string>",
"metadata": {},
"taxCodeExternalId": "<string>"
}
'import requests
url = "https://external.pleo.io/v1/chart-of-accounts"
payload = {
"archived": True,
"companyId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"externalId": "<string>",
"name": "<string>",
"code": "<string>",
"metadata": {},
"taxCodeExternalId": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json;charset=UTF-8"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
Authorization: 'Bearer <token>',
'Content-Type': 'application/json;charset=UTF-8'
},
body: JSON.stringify({
archived: true,
companyId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
externalId: '<string>',
name: '<string>',
code: '<string>',
metadata: {},
taxCodeExternalId: '<string>'
})
};
fetch('https://external.pleo.io/v1/chart-of-accounts', 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://external.pleo.io/v1/chart-of-accounts",
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([
'archived' => true,
'companyId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'externalId' => '<string>',
'name' => '<string>',
'code' => '<string>',
'metadata' => [
],
'taxCodeExternalId' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json;charset=UTF-8"
],
]);
$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://external.pleo.io/v1/chart-of-accounts"
payload := strings.NewReader("{\n \"archived\": true,\n \"companyId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"externalId\": \"<string>\",\n \"name\": \"<string>\",\n \"code\": \"<string>\",\n \"metadata\": {},\n \"taxCodeExternalId\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json;charset=UTF-8")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://external.pleo.io/v1/chart-of-accounts")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json;charset=UTF-8")
.body("{\n \"archived\": true,\n \"companyId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"externalId\": \"<string>\",\n \"name\": \"<string>\",\n \"code\": \"<string>\",\n \"metadata\": {},\n \"taxCodeExternalId\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://external.pleo.io/v1/chart-of-accounts")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json;charset=UTF-8'
request.body = "{\n \"archived\": true,\n \"companyId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"externalId\": \"<string>\",\n \"name\": \"<string>\",\n \"code\": \"<string>\",\n \"metadata\": {},\n \"taxCodeExternalId\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"archived": false,
"code": "2001",
"companyId": "123e4567-e89b-12d3-a456-426614174006",
"externalId": "External Id",
"id": "123e4567-e89b-12d3-a456-426614174005",
"name": "Bank Charges",
"taxCodeExternalId": "IVA 20"
}
}{
"data": {
"archived": false,
"code": "2001",
"companyId": "123e4567-e89b-12d3-a456-426614174006",
"externalId": "External Id",
"id": "123e4567-e89b-12d3-a456-426614174005",
"name": "Bank Charges",
"taxCodeExternalId": "IVA 20"
}
}"Bad Request: for example, missing required fields.""Conflict: account with the same `externalId` exists in Pleo."Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
Boolean flag used to determine if the account is archived.
Pleo's internal identifier for the company the account is associated with.
Unique external identifier of the account, assigned in the external ERP/accounting system. Can be the same as code if no other identifier is available.
255Name of the account.
255Account code or number used in the accounting system's chart of accounts.
255Place for API users to store flexible data.
Show child attributes
Show child attributes
The identifier in the target system for the tax code the account is associated with.
- This is NOT the tax percentage (e.g. 20%)
- This is NOT the Pleo UUID of the tax code
Response
Request matched existing account.
Represents an account in Pleo.
Show child attributes
Show child attributes