Get rule defaults
curl --request POST \
--url https://api.hyperline.co/v1/accounting/rules/defaults \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"ledger_id": "<string>",
"filters": {
"product_types": [],
"product_ids": [
"<string>"
],
"currencies": [
"<string>"
],
"countries": [
"<string>"
],
"tax_schemes": [],
"tax_territories": [
"<string>"
],
"tax_rate_classes": [],
"customer_ids": [
"<string>"
],
"coupon_ids": [
"<string>"
],
"client_provider_ids": [
"<string>"
],
"payment_method_types": [],
"bank_account_ids": [
"<string>"
],
"interval_count": 123
}
}
'import requests
url = "https://api.hyperline.co/v1/accounting/rules/defaults"
payload = {
"ledger_id": "<string>",
"filters": {
"product_types": [],
"product_ids": ["<string>"],
"currencies": ["<string>"],
"countries": ["<string>"],
"tax_schemes": [],
"tax_territories": ["<string>"],
"tax_rate_classes": [],
"customer_ids": ["<string>"],
"coupon_ids": ["<string>"],
"client_provider_ids": ["<string>"],
"payment_method_types": [],
"bank_account_ids": ["<string>"],
"interval_count": 123
}
}
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({
ledger_id: '<string>',
filters: {
product_types: [],
product_ids: ['<string>'],
currencies: ['<string>'],
countries: ['<string>'],
tax_schemes: [],
tax_territories: ['<string>'],
tax_rate_classes: [],
customer_ids: ['<string>'],
coupon_ids: ['<string>'],
client_provider_ids: ['<string>'],
payment_method_types: [],
bank_account_ids: ['<string>'],
interval_count: 123
}
})
};
fetch('https://api.hyperline.co/v1/accounting/rules/defaults', 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.hyperline.co/v1/accounting/rules/defaults",
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([
'ledger_id' => '<string>',
'filters' => [
'product_types' => [
],
'product_ids' => [
'<string>'
],
'currencies' => [
'<string>'
],
'countries' => [
'<string>'
],
'tax_schemes' => [
],
'tax_territories' => [
'<string>'
],
'tax_rate_classes' => [
],
'customer_ids' => [
'<string>'
],
'coupon_ids' => [
'<string>'
],
'client_provider_ids' => [
'<string>'
],
'payment_method_types' => [
],
'bank_account_ids' => [
'<string>'
],
'interval_count' => 123
]
]),
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.hyperline.co/v1/accounting/rules/defaults"
payload := strings.NewReader("{\n \"ledger_id\": \"<string>\",\n \"filters\": {\n \"product_types\": [],\n \"product_ids\": [\n \"<string>\"\n ],\n \"currencies\": [\n \"<string>\"\n ],\n \"countries\": [\n \"<string>\"\n ],\n \"tax_schemes\": [],\n \"tax_territories\": [\n \"<string>\"\n ],\n \"tax_rate_classes\": [],\n \"customer_ids\": [\n \"<string>\"\n ],\n \"coupon_ids\": [\n \"<string>\"\n ],\n \"client_provider_ids\": [\n \"<string>\"\n ],\n \"payment_method_types\": [],\n \"bank_account_ids\": [\n \"<string>\"\n ],\n \"interval_count\": 123\n }\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.hyperline.co/v1/accounting/rules/defaults")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"ledger_id\": \"<string>\",\n \"filters\": {\n \"product_types\": [],\n \"product_ids\": [\n \"<string>\"\n ],\n \"currencies\": [\n \"<string>\"\n ],\n \"countries\": [\n \"<string>\"\n ],\n \"tax_schemes\": [],\n \"tax_territories\": [\n \"<string>\"\n ],\n \"tax_rate_classes\": [],\n \"customer_ids\": [\n \"<string>\"\n ],\n \"coupon_ids\": [\n \"<string>\"\n ],\n \"client_provider_ids\": [\n \"<string>\"\n ],\n \"payment_method_types\": [],\n \"bank_account_ids\": [\n \"<string>\"\n ],\n \"interval_count\": 123\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.hyperline.co/v1/accounting/rules/defaults")
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 \"ledger_id\": \"<string>\",\n \"filters\": {\n \"product_types\": [],\n \"product_ids\": [\n \"<string>\"\n ],\n \"currencies\": [\n \"<string>\"\n ],\n \"countries\": [\n \"<string>\"\n ],\n \"tax_schemes\": [],\n \"tax_territories\": [\n \"<string>\"\n ],\n \"tax_rate_classes\": [],\n \"customer_ids\": [\n \"<string>\"\n ],\n \"coupon_ids\": [\n \"<string>\"\n ],\n \"client_provider_ids\": [\n \"<string>\"\n ],\n \"payment_method_types\": [],\n \"bank_account_ids\": [\n \"<string>\"\n ],\n \"interval_count\": 123\n }\n}"
response = http.request(request)
puts response.read_body{
"defaults": {},
"suggested_priority": 123,
"trace": [
{
"field": "<string>",
"value": "<string>",
"rule_id": "<string>",
"rule_name": "<string>",
"is_ambiguous": true
}
],
"context_count": 123
}Accounting > Rules
Get rule defaults
Preview default account values and priority for a new accounting rule.
POST
/
v1
/
accounting
/
rules
/
defaults
Get rule defaults
curl --request POST \
--url https://api.hyperline.co/v1/accounting/rules/defaults \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"ledger_id": "<string>",
"filters": {
"product_types": [],
"product_ids": [
"<string>"
],
"currencies": [
"<string>"
],
"countries": [
"<string>"
],
"tax_schemes": [],
"tax_territories": [
"<string>"
],
"tax_rate_classes": [],
"customer_ids": [
"<string>"
],
"coupon_ids": [
"<string>"
],
"client_provider_ids": [
"<string>"
],
"payment_method_types": [],
"bank_account_ids": [
"<string>"
],
"interval_count": 123
}
}
'import requests
url = "https://api.hyperline.co/v1/accounting/rules/defaults"
payload = {
"ledger_id": "<string>",
"filters": {
"product_types": [],
"product_ids": ["<string>"],
"currencies": ["<string>"],
"countries": ["<string>"],
"tax_schemes": [],
"tax_territories": ["<string>"],
"tax_rate_classes": [],
"customer_ids": ["<string>"],
"coupon_ids": ["<string>"],
"client_provider_ids": ["<string>"],
"payment_method_types": [],
"bank_account_ids": ["<string>"],
"interval_count": 123
}
}
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({
ledger_id: '<string>',
filters: {
product_types: [],
product_ids: ['<string>'],
currencies: ['<string>'],
countries: ['<string>'],
tax_schemes: [],
tax_territories: ['<string>'],
tax_rate_classes: [],
customer_ids: ['<string>'],
coupon_ids: ['<string>'],
client_provider_ids: ['<string>'],
payment_method_types: [],
bank_account_ids: ['<string>'],
interval_count: 123
}
})
};
fetch('https://api.hyperline.co/v1/accounting/rules/defaults', 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.hyperline.co/v1/accounting/rules/defaults",
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([
'ledger_id' => '<string>',
'filters' => [
'product_types' => [
],
'product_ids' => [
'<string>'
],
'currencies' => [
'<string>'
],
'countries' => [
'<string>'
],
'tax_schemes' => [
],
'tax_territories' => [
'<string>'
],
'tax_rate_classes' => [
],
'customer_ids' => [
'<string>'
],
'coupon_ids' => [
'<string>'
],
'client_provider_ids' => [
'<string>'
],
'payment_method_types' => [
],
'bank_account_ids' => [
'<string>'
],
'interval_count' => 123
]
]),
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.hyperline.co/v1/accounting/rules/defaults"
payload := strings.NewReader("{\n \"ledger_id\": \"<string>\",\n \"filters\": {\n \"product_types\": [],\n \"product_ids\": [\n \"<string>\"\n ],\n \"currencies\": [\n \"<string>\"\n ],\n \"countries\": [\n \"<string>\"\n ],\n \"tax_schemes\": [],\n \"tax_territories\": [\n \"<string>\"\n ],\n \"tax_rate_classes\": [],\n \"customer_ids\": [\n \"<string>\"\n ],\n \"coupon_ids\": [\n \"<string>\"\n ],\n \"client_provider_ids\": [\n \"<string>\"\n ],\n \"payment_method_types\": [],\n \"bank_account_ids\": [\n \"<string>\"\n ],\n \"interval_count\": 123\n }\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.hyperline.co/v1/accounting/rules/defaults")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"ledger_id\": \"<string>\",\n \"filters\": {\n \"product_types\": [],\n \"product_ids\": [\n \"<string>\"\n ],\n \"currencies\": [\n \"<string>\"\n ],\n \"countries\": [\n \"<string>\"\n ],\n \"tax_schemes\": [],\n \"tax_territories\": [\n \"<string>\"\n ],\n \"tax_rate_classes\": [],\n \"customer_ids\": [\n \"<string>\"\n ],\n \"coupon_ids\": [\n \"<string>\"\n ],\n \"client_provider_ids\": [\n \"<string>\"\n ],\n \"payment_method_types\": [],\n \"bank_account_ids\": [\n \"<string>\"\n ],\n \"interval_count\": 123\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.hyperline.co/v1/accounting/rules/defaults")
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 \"ledger_id\": \"<string>\",\n \"filters\": {\n \"product_types\": [],\n \"product_ids\": [\n \"<string>\"\n ],\n \"currencies\": [\n \"<string>\"\n ],\n \"countries\": [\n \"<string>\"\n ],\n \"tax_schemes\": [],\n \"tax_territories\": [\n \"<string>\"\n ],\n \"tax_rate_classes\": [],\n \"customer_ids\": [\n \"<string>\"\n ],\n \"coupon_ids\": [\n \"<string>\"\n ],\n \"client_provider_ids\": [\n \"<string>\"\n ],\n \"payment_method_types\": [],\n \"bank_account_ids\": [\n \"<string>\"\n ],\n \"interval_count\": 123\n }\n}"
response = http.request(request)
puts response.read_body{
"defaults": {},
"suggested_priority": 123,
"trace": [
{
"field": "<string>",
"value": "<string>",
"rule_id": "<string>",
"rule_name": "<string>",
"is_ambiguous": true
}
],
"context_count": 123
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/json
Identifier of the ledger used to resolve defaults.
Category of the new accounting rule.
Available options:
invoice_posted, invoice_settled, revenue_recognition, credit_note_created, accounting_software Optional filters for the proposed rule.
Show child attributes
Show child attributes
Response
200 - application/json
Suggested accounting defaults by field.
Show child attributes
Show child attributes
Suggested priority for the new rule.
Resolution trace for the suggested defaults.
Show child attributes
Show child attributes
Number of matching contexts used for resolution.
Was this page helpful?
⌘I

