Management of Account Groups
If you are using the contract-based REST API to integrate MYOB Acumatica with external systems, these external systems can create, modify, and remove account groups. For more information about account groups, see Account Groups: General Information.
Testing of the Requests
- Deploy a new MYOB Acumatica instance with the U100 dataset. For details on deploying an instance, see To Deploy an MYOB Acumatica Instance.
- On the Enable/Disable Features (CS100000) form, make sure the Projects feature is enabled.
- To sign in to the instance in the client application, use the tenant name (which you specified when you created the instance) and the HEADOFFICE branch.
- If you use Postman as the client application for testing, in the IntegrationDevelopmentGuide.postman_collection.json collection (which is located in the IntegrationDevelopment\Help folder of the Help-and-Training-Examples repository on GitHub), make sure the collection variables have the proper values.
<MYOB Acumatica instance URL>
is the URL of the MYOB Acumatica
instance (such as https://my.acumatica.com/MyInstance
). You can omit
the instance name in the URL (such as https://my.acumatica.com
) if the
instance is installed in the root of the website.Step 1: Create an Account Group
You start by creating an account group with the ACCG02 identifier, as shown in the following code.
PUT / HTTP/1.1
Host: [<MYOB Acumatica instance URL>]/entity/Default/23.200.001/AccountGroup
Accept: application/json
Content-Type: application/json
{
"AccountGroupID" : {"value" : "ACCG02"},
"Description" : {"value" : "Test Account Group"}
}
Step 2: Add Accounts to the Account Group
Now you need to add accounts to the account group. You add the 40000 account to the ACCG02 account group as follows.
PUT / HTTP/1.1
Host: [<MYOB Acumatica instance URL>]/entity/Default/23.200.001/Account
Accept: application/json
Content-Type: application/json
{
"AccountCD" : {"value" : "40000"},
"AccountGroup" : {"value" : "ACCG02"}
}
Next, you add the 40010 account to the ACCG02 account group, as shown in the following code.
PUT / HTTP/1.1
Host: [<MYOB Acumatica instance URL>]/entity/Default/23.200.001/Account
Accept: application/json
Content-Type: application/json
{
"AccountCD" : {"value" : "40010"},
"AccountGroup" : {"value" : "ACCG02"}
}
Step 3: Specify the Default Account of the Account Group
You need to specify the 40000 account as the default account of the ACCG02 account group, as shown in the following code example.
PUT / HTTP/1.1
Host: [<MYOB Acumatica instance URL>]/entity/Default/23.200.001/AccountGroup
Accept: application/json
Content-Type: application/json
{
"DefaultAccountID" : {"value" : "40000"},
"AccountGroupID" : {"value" : "ACCG02"}
}
Step 4: Retrieve the List of Accounts of the Account Group
You need to obtain the list of accounts of the ACCG02 account group as follows.
GET ?$filter=AccountGroup%20eq%20'ACCG02'&$select=AccountCD HTTP/1.1
Host: [<MYOB Acumatica instance URL>]/entity/Default/23.200.001/Account
Accept: application/json
Content-Type: application/json
Step 5: Remove an Account from the Group
Finally, you remove the 40010 account from the ACCG02 account group, as shown in the following code.
PUT / HTTP/1.1
Host: [<MYOB Acumatica instance URL>]/entity/Default/23.200.001/Account
Accept: application/json
Content-Type: application/json
{
"AccountCD" : {"value" : "40010"},
"AccountGroup" : {"value" : null}
}