curl --request PUT \
--url https://api.exowpee.com/v1/accounting/organization/books/{accountMapping}/account-mappings/{account_mapping} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"accounting_account_id": "<string>"
}
'import requests
url = "https://api.exowpee.com/v1/accounting/organization/books/{accountMapping}/account-mappings/{account_mapping}"
payload = { "accounting_account_id": "<string>" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({accounting_account_id: '<string>'})
};
fetch('https://api.exowpee.com/v1/accounting/organization/books/{accountMapping}/account-mappings/{account_mapping}', 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/accounting/organization/books/{accountMapping}/account-mappings/{account_mapping}",
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([
'accounting_account_id' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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.exowpee.com/v1/accounting/organization/books/{accountMapping}/account-mappings/{account_mapping}"
payload := strings.NewReader("{\n \"accounting_account_id\": \"<string>\"\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.exowpee.com/v1/accounting/organization/books/{accountMapping}/account-mappings/{account_mapping}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"accounting_account_id\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.exowpee.com/v1/accounting/organization/books/{accountMapping}/account-mappings/{account_mapping}")
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'
request.body = "{\n \"accounting_account_id\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"owner_type": "<string>",
"role": "<string>",
"auxiliary_type": "<string>",
"accounting_account_id": "<string>",
"account": {},
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}{
"message": "<string>",
"errors": {}
}Change an account mapping
Point an automatic posting role at a different account so future entries land there.
curl --request PUT \
--url https://api.exowpee.com/v1/accounting/organization/books/{accountMapping}/account-mappings/{account_mapping} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"accounting_account_id": "<string>"
}
'import requests
url = "https://api.exowpee.com/v1/accounting/organization/books/{accountMapping}/account-mappings/{account_mapping}"
payload = { "accounting_account_id": "<string>" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({accounting_account_id: '<string>'})
};
fetch('https://api.exowpee.com/v1/accounting/organization/books/{accountMapping}/account-mappings/{account_mapping}', 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/accounting/organization/books/{accountMapping}/account-mappings/{account_mapping}",
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([
'accounting_account_id' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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.exowpee.com/v1/accounting/organization/books/{accountMapping}/account-mappings/{account_mapping}"
payload := strings.NewReader("{\n \"accounting_account_id\": \"<string>\"\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.exowpee.com/v1/accounting/organization/books/{accountMapping}/account-mappings/{account_mapping}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"accounting_account_id\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.exowpee.com/v1/accounting/organization/books/{accountMapping}/account-mappings/{account_mapping}")
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'
request.body = "{\n \"accounting_account_id\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"owner_type": "<string>",
"role": "<string>",
"auxiliary_type": "<string>",
"accounting_account_id": "<string>",
"account": {},
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}{
"message": "<string>",
"errors": {}
}account_mappings.update
Conditions
- The accounting module must be included in the plan of the organization.
- In the organization space the caller needs an accounting access grant on the book named in the URL.
- Mapping updates are switched off by configuration (account_mapping_updates_enabled is false by default): once the request passes validation, the change is refused as forbidden until it is enabled.
- The record must belong to the selected book.
- accounting_account_id is required and must be an account of the same book.
- A role without a third-party type needs an account that can receive entries; a role with a third-party type (customer, vendor, location and similar) needs a grouping account that cannot receive entries.
- Postings made afterwards for this role use the new account. Entries already posted are not changed.
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Identifier of the book (the organization or one of its companies), 27-character KSUID. The generated path names this segment after the resource; the route parameter is the book. The caller needs an access grant on it.
Identifier of the account mapping (27-character KSUID). It must belong to the book in the URL.
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, owner_type, role, auxiliary_type, accounting_account_id, 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: account.
Body
Identifier of the account to map the role to. It must be an account of the same book, one that receives entries for a role without a third-party type, or a grouping account for a role with one. Updates are refused while mapping updates are disabled by configuration.
Response
Resource (only with response=resource).
Identifier of the mapping (27-character KSUID).
Type of book owning the mapping: organization, company or client.
Posting role the mapping serves, for example customer_receivable or sales_revenue. Each role is mapped once per book.
Type of third party the role posts to (customer, vendor, location and similar) when the role keeps one child account per third party; null when the role posts directly to the mapped account.
Identifier of the account the role is mapped to (27-character KSUID).
The mapped account, as an account object. Only present when selected with include and the caller has the accounting_accounts.retrieve permission.
Date and time the record was created (ISO 8601, UTC).
Date and time the record was last changed (ISO 8601, UTC).