Update an account
curl --request PUT \
--url https://external.pleo.io/v1/chart-of-accounts/{accountId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json;charset=UTF-8' \
--data '
{
"archived": true,
"name": "<string>",
"code": "<string>",
"metadata": {},
"taxCodeExternalId": "<string>"
}
'import requests
url = "https://external.pleo.io/v1/chart-of-accounts/{accountId}"
payload = {
"archived": True,
"name": "<string>",
"code": "<string>",
"metadata": {},
"taxCodeExternalId": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json;charset=UTF-8"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {
Authorization: 'Bearer <token>',
'Content-Type': 'application/json;charset=UTF-8'
},
body: JSON.stringify({
archived: true,
name: '<string>',
code: '<string>',
metadata: {},
taxCodeExternalId: '<string>'
})
};
fetch('https://external.pleo.io/v1/chart-of-accounts/{accountId}', 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/{accountId}",
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([
'archived' => true,
'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/{accountId}"
payload := strings.NewReader("{\n \"archived\": true,\n \"name\": \"<string>\",\n \"code\": \"<string>\",\n \"metadata\": {},\n \"taxCodeExternalId\": \"<string>\"\n}")
req, _ := http.NewRequest("PUT", 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.put("https://external.pleo.io/v1/chart-of-accounts/{accountId}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json;charset=UTF-8")
.body("{\n \"archived\": true,\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/{accountId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json;charset=UTF-8'
request.body = "{\n \"archived\": true,\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"
}
}"Bad Request: for example, missing required fields, tax code does not exist in Pleo.""Account not found."Accounts
Update an account
Update details of an existing account in Pleo. The integration must send a request to this endpoint when it is trying to archive an account linked to accounting entries.
PUT
/
v1
/
chart-of-accounts
/
{accountId}
Update an account
curl --request PUT \
--url https://external.pleo.io/v1/chart-of-accounts/{accountId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json;charset=UTF-8' \
--data '
{
"archived": true,
"name": "<string>",
"code": "<string>",
"metadata": {},
"taxCodeExternalId": "<string>"
}
'import requests
url = "https://external.pleo.io/v1/chart-of-accounts/{accountId}"
payload = {
"archived": True,
"name": "<string>",
"code": "<string>",
"metadata": {},
"taxCodeExternalId": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json;charset=UTF-8"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {
Authorization: 'Bearer <token>',
'Content-Type': 'application/json;charset=UTF-8'
},
body: JSON.stringify({
archived: true,
name: '<string>',
code: '<string>',
metadata: {},
taxCodeExternalId: '<string>'
})
};
fetch('https://external.pleo.io/v1/chart-of-accounts/{accountId}', 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/{accountId}",
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([
'archived' => true,
'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/{accountId}"
payload := strings.NewReader("{\n \"archived\": true,\n \"name\": \"<string>\",\n \"code\": \"<string>\",\n \"metadata\": {},\n \"taxCodeExternalId\": \"<string>\"\n}")
req, _ := http.NewRequest("PUT", 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.put("https://external.pleo.io/v1/chart-of-accounts/{accountId}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json;charset=UTF-8")
.body("{\n \"archived\": true,\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/{accountId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json;charset=UTF-8'
request.body = "{\n \"archived\": true,\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"
}
}"Bad Request: for example, missing required fields, tax code does not exist in Pleo.""Account not found."Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
ID of the account to update.
Body
application/json;charset=UTF-8
Represents a request to update an account.
Boolean flag used to determine if the account is archived.
Name of the account.
Maximum string length:
255Account code or number used in the accounting system's chart of accounts.
Maximum string length:
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
Update of account successful.
Represents an account in Pleo.
Show child attributes
Show child attributes