curl --request POST \
--url https://api.exowpee.com/v1/accounting/client/analytic-rules \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"analytic_axis_id": "<string>",
"analytic_section_id": "<string>",
"priority": 1,
"match_account_prefix": "<string>",
"match_source_type": "<string>",
"match_journal_id": "<string>"
}
'import requests
url = "https://api.exowpee.com/v1/accounting/client/analytic-rules"
payload = {
"analytic_axis_id": "<string>",
"analytic_section_id": "<string>",
"priority": 1,
"match_account_prefix": "<string>",
"match_source_type": "<string>",
"match_journal_id": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
analytic_axis_id: '<string>',
analytic_section_id: '<string>',
priority: 1,
match_account_prefix: '<string>',
match_source_type: '<string>',
match_journal_id: '<string>'
})
};
fetch('https://api.exowpee.com/v1/accounting/client/analytic-rules', 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/client/analytic-rules",
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([
'analytic_axis_id' => '<string>',
'analytic_section_id' => '<string>',
'priority' => 1,
'match_account_prefix' => '<string>',
'match_source_type' => '<string>',
'match_journal_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/client/analytic-rules"
payload := strings.NewReader("{\n \"analytic_axis_id\": \"<string>\",\n \"analytic_section_id\": \"<string>\",\n \"priority\": 1,\n \"match_account_prefix\": \"<string>\",\n \"match_source_type\": \"<string>\",\n \"match_journal_id\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", 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.post("https://api.exowpee.com/v1/accounting/client/analytic-rules")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"analytic_axis_id\": \"<string>\",\n \"analytic_section_id\": \"<string>\",\n \"priority\": 1,\n \"match_account_prefix\": \"<string>\",\n \"match_source_type\": \"<string>\",\n \"match_journal_id\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.exowpee.com/v1/accounting/client/analytic-rules")
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'
request.body = "{\n \"analytic_axis_id\": \"<string>\",\n \"analytic_section_id\": \"<string>\",\n \"priority\": 1,\n \"match_account_prefix\": \"<string>\",\n \"match_source_type\": \"<string>\",\n \"match_journal_id\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"analytic_axis_id": "<string>",
"axis": {},
"analytic_section_id": "<string>",
"section": {},
"priority": 123,
"match_account_prefix": "<string>",
"match_source_type": "<string>",
"match_journal_id": "<string>",
"journal": {},
"status": "<string>",
"created_by": "<string>",
"created_by_type": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}{
"message": "<string>"
}{
"message": "<string>",
"errors": {}
}Add an allocation rule (client account)
Create an allocation rule (rule that automatically allocates new entries to an analytic section).
curl --request POST \
--url https://api.exowpee.com/v1/accounting/client/analytic-rules \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"analytic_axis_id": "<string>",
"analytic_section_id": "<string>",
"priority": 1,
"match_account_prefix": "<string>",
"match_source_type": "<string>",
"match_journal_id": "<string>"
}
'import requests
url = "https://api.exowpee.com/v1/accounting/client/analytic-rules"
payload = {
"analytic_axis_id": "<string>",
"analytic_section_id": "<string>",
"priority": 1,
"match_account_prefix": "<string>",
"match_source_type": "<string>",
"match_journal_id": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
analytic_axis_id: '<string>',
analytic_section_id: '<string>',
priority: 1,
match_account_prefix: '<string>',
match_source_type: '<string>',
match_journal_id: '<string>'
})
};
fetch('https://api.exowpee.com/v1/accounting/client/analytic-rules', 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/client/analytic-rules",
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([
'analytic_axis_id' => '<string>',
'analytic_section_id' => '<string>',
'priority' => 1,
'match_account_prefix' => '<string>',
'match_source_type' => '<string>',
'match_journal_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/client/analytic-rules"
payload := strings.NewReader("{\n \"analytic_axis_id\": \"<string>\",\n \"analytic_section_id\": \"<string>\",\n \"priority\": 1,\n \"match_account_prefix\": \"<string>\",\n \"match_source_type\": \"<string>\",\n \"match_journal_id\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", 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.post("https://api.exowpee.com/v1/accounting/client/analytic-rules")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"analytic_axis_id\": \"<string>\",\n \"analytic_section_id\": \"<string>\",\n \"priority\": 1,\n \"match_account_prefix\": \"<string>\",\n \"match_source_type\": \"<string>\",\n \"match_journal_id\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.exowpee.com/v1/accounting/client/analytic-rules")
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'
request.body = "{\n \"analytic_axis_id\": \"<string>\",\n \"analytic_section_id\": \"<string>\",\n \"priority\": 1,\n \"match_account_prefix\": \"<string>\",\n \"match_source_type\": \"<string>\",\n \"match_journal_id\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"analytic_axis_id": "<string>",
"axis": {},
"analytic_section_id": "<string>",
"section": {},
"priority": 123,
"match_account_prefix": "<string>",
"match_source_type": "<string>",
"match_journal_id": "<string>",
"journal": {},
"status": "<string>",
"created_by": "<string>",
"created_by_type": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}{
"message": "<string>"
}{
"message": "<string>",
"errors": {}
}analytic_rules.create
Conditions
- The accounting module must be included in the plan of the organization.
- At least one of match_account_prefix, match_source_type or match_journal_id must be sent and non-empty; a rule with no matcher would allocate every line.
- analytic_axis_id must be an axis of the book, and the axis must be active.
- analytic_section_id must be an active section of the same axis and of the same book that is postable and has no child sections; otherwise the call is refused.
- match_journal_id, when sent, must be a journal of the same book.
- priority is required, an integer of 0 or more.
- The rule is created with status active: lines of entries posted later that match it are allocated to the section, unless a target sent with the entry or an earlier rule of the same axis already allocates them.
- The creating actor is recorded in created_by and created_by_type.
- Existing journal lines are not re-allocated.
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, analytic_axis_id, analytic_section_id, priority, match_account_prefix, match_source_type, match_journal_id, status, created_by, created_by_type, 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: axis, section, section.axis, section.parent, journal.
Body
Required. Axis of the book on which the rule allocates; it must be active.
Required. Active, postable section of that axis with no child sections.
Required. Integer of 0 or more; order of evaluation among the rules of the axis.
x >= 0Account code prefix to match, at most 16 characters. At least one of the three matchers is required.
16Source type of the entry to match, at most 64 characters. At least one of the three matchers is required.
64Journal of the same book to match. At least one of the three matchers is required.
Response
Resource (only with response=resource).
Identifier of the rule (27-character KSUID).
Identifier of the axis the rule allocates on.
The axis, included only when the caller may retrieve analytic axes.
Identifier of the section that matching lines are allocated to.
The target section, included only when the caller may retrieve analytic sections.
Order of evaluation among the rules of the axis; an integer of 0 or more.
Matches journal lines whose account code starts with this prefix; null when this matcher is not used.
Matches entries created by this source type; null when this matcher is not used.
Matches entries of this journal; null when this matcher is not used.
The matched journal, included only when the caller may retrieve journals.
active or archived. Only active rules allocate.
Identifier of the actor that created the rule.
Kind of actor that created the rule (the actor's morph alias); null when it could not be resolved.
Date and time the record was created (ISO 8601, UTC).
Date and time the record was last changed (ISO 8601, UTC).