Accounting Rules Configuration
  • 03 May 2023
  • 3 Minutes To Read
  • Dark
    Light
  • PDF

Accounting Rules Configuration

  • Dark
    Light
  • PDF

Article Summary

Accounting rules allows you to create general rules for your accounts such as setting automatic accounting closures that recur on a regular basis and defining rules for how to handle any transactions that affect General Ledger (GL) balances in two different branches. For more information about these types of rules, see inter-branch transfer rules.

With Configuration as Code (CasC), you may batch configure your accounting rules configuration via the API using YAML. For general information on CasC, see Configuration as Code Overview.

API Operations

CasC for accounting rules supports two operations.

ActionEndpointDescription
GET/configuration/accountingrules.yamlGet current accounting rules configuration.
PUT/configuration/accountingrules.yamlWrite a new accounting rules configuration to Mambu.
Please Note

If you PUT a configuration to Mambu, any current configuration settings not included in the new YAML configuration will be deleted. PATCH requests are not currently supported.

Requests

For general information on CasC requests such as authentication and required headers, see Configuration as Code Overview.

The following section shows sample requests using curl and basic authentication. For all examples, replace TENANT_NAME with your actual tenant name.

GET configuration

curl -X GET 'https://TENANT_NAME.mambu.com/api/configuration/accountingrules.yaml' \
-H 'Accept: application/vnd.mambu.v2+yaml' \
-H 'Authorization: Basic {auth}'

{auth} is the base-64-encoded value of username:password. For more information, see Authentication in our API reference.

PUT configuration

curl -X PUT 'https://TENANT_NAME.mambu.com/api/configuration/accountingrules.yaml' \
-H 'Accept: application/vnd.mambu.v2+yaml' \
-H 'Content-Type: application/yaml' \
-H 'Authorization: Basic {auth}' \
--data-binary @accountingrules.yaml

{auth} is the base-64-encoded value of username:password. For more information, see Authentication in our API reference.

“@accountingrules.yaml” represents the absolute path of the file on your device.

(Use “--data-raw” if you want to specify the YAML body inline).

Configuration body example

---
defaultGlCode: "defaultGlAccountCode"
automatedAccountingClosuresInterval: 7
customRules:
  - id: "ruleId1"
    leftBranchId: "branchId1"
    rightBranchId: "branchId2"
    glCode: "glCode1"
  - id: "ruleId2"
    leftBranchId: "branchId3"
    rightBranchId: "branchId1"
    glCode: "glCode2"

Attributes

NameTypeDescriptionRequired
defaultGlCodeStringDefault GL account code.
automatedAccountingClosuresIntervalNumberNumber of days between the execution of automated accounting closures. If this number is zero, no automated closure is performed.
customRulesListCustom rules in which new accounting rules can be added between branches.
idStringUser-defined unique ID. Rules are ordered by ID in the YAML file.
rightBranchIdStringID of the right branch of the rule.
leftBranchIdStringID of the left branch of the rule.
glCodeStringThe unique identifier of the account that is mapped to the financial resource.

Replies

If you do not receive a 200 OK status code then fix any validation errors and make another PUT request until you receive a 200 OK status code.

Please Note

If you PUT a valid YAML configuration to the API and you do not receive a 200 OK status code within 60 seconds, you may receive a 504 Gateway Timeout status code. We expect all responses to be below 60 seconds.

If you encounter this issue, please contact us through Mambu Support so we can investigate it.

Validations

With all use cases, a validation of the uploaded file will be done, ensuring the following:

  • Syntax is correct as per YAML standards and the template for holidays.
  • Minimum requirements indicates the line with the syntax error.
  • Content is correct.
NameValidation
defaultGlCodeCan be null. If it is not null, it must be for an existing GL account that is in the organization's base currency.
automatedAccountingClosuresIntervalMust be a non-negative whole number. Can be null or empty, in which case it will be considered zero.
idRequired, must not exceed 32 characters in length, must be unique in the configuration.
leftBranchIdMust be the ID of an existing branch, can’t be the same as rightBranchId. If empty, the rule will apply for “All Branches“, if that is a valid case in the configuration.
rightBranchIdMust be the ID of an existing branch, can’t be same as leftBranchId. If empty, the rule will apply for “All Branches“ if that is a valid case in the configuration.
glCodeMust be the GL Code of an existing GL account.

Was this article helpful?