Tree
URL | Verbs | Function |
---|---|---|
/Tree | GET | Query a list of all Trees |
/Tree/<treeName> | GET | Query a list of Branches for a particular Tree |
/Tree/<treeName>/<branch> | GET | Query a particular branch for a particular Tree |
/Tree/<treeName>/<branch> | POST | Change a branch or Add a new branch |
/Tree/<treeName>/<branch>?treeZone=9 | POST | Update GL Budgets |
Supported modifiers
Query String | Definition | Sample |
---|---|---|
treeZone | Return a list of Trees for a particular Tree Zone | treeZone=5 |
isShortCode | When requesting a specific <branch>, indicates the <branch> is actually the short code | isShortCode=true |
isRecursive | Return a recursive list of sub branches for each branch | isRecursive=true |
Security Linked Menu
Menu Item | Located |
---|---|
Tree Maintenance | System / Trees |
Sample XML Response
<?xml version="1.0" encoding="UTF-8"?>
<Tree> <Name>Financial Reporting</Name> <Branches collection='true' count='3'> <Branch> <Name>Balance Sheet</Name> <ShortCode/> <Path>Balance Sheet</Path> <BranchCount>4</BranchCount> </Branch> <Branch> <Name>Profit and Loss</Name> <ShortCode/> <Path>Profit and Loss</Path> <BranchCount>6</BranchCount> </Branch> <Branch> <Name>Suspense</Name> <ShortCode/> <Path>Suspense</Path> </Branch> </Branches> </Tree>
When POSTing to update Trees, the payload takes different forms depending on what type of update is being requested.
- To change an existing branch you address the branch to be changed via the URL, and the contents of the payload indicates what you want to change it to. In the next example we are renaming the "Suspense" branch of the "Balance Sheet" tree to "Suspense Account" and changing the Short Code to "SUSPACC":
- eg http://server:port/<company>/Tree/Balance Sheet/Suspense
Sample XML Response
<?xml version="1.0" encoding="UTF-8"?>
<Branch> <Name>Suspense Account</Name> <ShortCode>SUSPACC</ShortCode> <!-- You can optionally use these next elements to set the Posting state of Transaction Trees, must include treeZone=9 in URL --> <TreeLine>GL Analysis</TreeLine> <Postable>true</Postable> </Branch>
- To Add a new branch to the root of the Tree you specify the Tree in the URL and the details of the new branch in the payload. This example is adding a "Suspense" branch to the "Balance Sheet" tree, along with its Short Code.
Sample XML Response
<?xml version="1.0" encoding="UTF-8"?>
<SubBranch> <Name>Suspense</Name> <ShortCode>SUSP</ShortCode> <!-- You can optionally use these next elements to set the Posting state of Transaction Trees, must include treeZone=9 in URL --> <TreeLine>GL Analysis</TreeLine> <Postable>true</Postable> </SubBranch>
- To Add a new sub-branch to an existing branch of the Tree you specify the Tree and branch (however many levels as in the URL and the details of the new branch in the payload. This example is adding an "Inventory" branch to the "Financial Reporting" tree, along with its Short Code under the Current Assets branch which is in itself a sub branch of the Balance Sheet branch
- eg http://server:port/<company>/Tree/Financial Reporting/Balance Sheet/Current Assets
Sample XML Response
<?xml version="1.0" encoding="UTF-8"?>
<SubBranch> <Name>Inventory</Name> <ShortCode>INV</ShortCode> <!-- You can optionally use these next elements to set the Posting state of Transaction Trees, must include treeZone=9 in URL--> <TreeLine>GL Analysis</TreeLine> <Postable>true</Postable> </SubBranch>
- To update/add a budget figure to a Tree branch you specify the full path to the tree branch in the URL and the details of the budget in the payload. This example is updating the FINAL budget figure for the September 2018/2019 calendar period for the Inventory tree branch added in the previous example.
- NOTE You MUST specify the Transaction Tree zone on the URL
- eg http://server:port/<company>/Tree/Financial Reporting/Balance Sheet/Current Assets/Inventory?treeZone=9
Sample XML Response
<?xml version="1.0" encoding="UTF-8"?>
<Budget> <GLAccount>10.10.1020</GLAccount> <Name>FINAL</Name> <Year>2018/2019</Year> <Period>September</Period> <Value>689.45</Value> <Quantity>6</Quantity> </Budget>