Accounting Rules Configuration
  • 26 Jan 2022
  • 3 Minutes To Read
  • Dark
  • PDF

Accounting Rules Configuration

  • Dark
  • PDF

Early Access Feature
If you would like to request early access to this feature, please get in touch with your Mambu Customer Success Manager to discuss your requirements. For more information, see Mambu Release Cycle - Feature Release Status.

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.

Action Endpoint Description
GET /configuration/accountingrules.yaml Get current accounting rules configuration.
PUT /configuration/accountingrules.yaml Write 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.


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 '' \
-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 '' \
-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
  - id: "ruleId1"
    leftBranchId: "branchId1"
    rightBranchId: "branchId2"
    glCode: "glCode1"
  - id: "ruleId2"
    leftBranchId: "branchId3"
    rightBranchId: "branchId1"
    glCode: "glCode2"


Name Type Description Required
defaultGlCode String Default GL account code.
automatedAccountingClosuresInterval Number Number of days between the execution of automated accounting closures. If this number is zero, no automated closure is performed.
customRules List Custom rules in which new accounting rules can be added between branches.
id String User-defined unique ID. Rules are ordered by ID in the YAML file.
rightBranchId String ID of the right branch of the rule.
leftBranchId String ID of the left branch of the rule.
glCode String The unique identifier of the account that is mapped to the financial resource.


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

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.


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.
Name Validation
defaultGlCode Can be null. If it is not null, it must be for an existing GL account that is in the organization's base currency.
automatedAccountingClosuresInterval Must be a non-negative whole number. Can be null or empty, in which case it will be considered zero.
id Required, must not exceed 32 characters in length, must be unique in the configuration.
leftBranchId Must 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.
rightBranchId Must 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.
glCode Must be the GL Code of an existing GL account.

Was this article helpful?