Easy-Acumatica Docs

Accounts Service

The `AccountService` is a sub-service for managing General Ledger (GL) Accounts and Account Groups in Acumatica. It provides methods to retrieve accounts, create and manage account groups, and assign accounts to those groups.

Importing Helpers

When querying for accounts, you may need to import the `QueryOptions` and `F` filter factory helpers.

python

from easy_acumatica.models.query_builder import QueryOptions
from easy_acumatica.models.filter_builder import F

Service Methods

get_accounts(api_version, options=None)

Retrieves a list of GL Accounts. This method supports the full range of OData query parameters through the `QueryOptions` object, allowing for powerful and specific queries to filter, select, expand, or paginate the results.

python

# Create a filter to find all 'Asset' type accounts
options = QueryOptions(
    filter=F.Type == 'Asset',
    select=["AccountCD", "Description", "Type"]
)

# Fetch the filtered list of accounts
asset_accounts = client.accounts.get_accounts("24.200.001", options=options)
create_account_group(api_version, group_id, description)

Creates a new account group. This is useful for organizing your GL accounts into logical categories.

python

# Create a new account group for long-term assets
new_group = client.accounts.create_account_group(
    "24.200.001",
    group_id="ASSET-L",
    description="Long-Term Assets"
)
add_account_to_group(api_version, accountCD, groupID)

Assigns an existing GL Account to a specific Account Group using their respective identifiers.

python

# Assign an account to the newly created group
updated_account = client.accounts.add_account_to_group(
    "24.200.001",
    accountCD="170100",  # Account Identifier
    groupID="ASSET-L"    # Group Identifier
)
remove_account_from_group(api_version, accountCD)

Removes a GL Account from its currently assigned Account Group. This is achieved by updating the account's `AccountGroup` property to `null`.

python

# Remove the account from any group it belongs to
updated_account = client.accounts.remove_account_from_group(
    "24.200.001",
    accountCD="170100"
)
set_default_account_for_group(api_version, group_id, account_id)

Specifies the default account for a given account group.

python

# Set a default account for an account group
updated_group = client.accounts.set_default_account_for_group(
    "24.200.001",
    group_id="ASSET-L",
    account_id="170100"
)
Easy-Acumatica v0.3.9 — Created and Developed by Matthew Hirstius (Nioron07).
Significant Contributions made by Chris Xu
Want to see the NPM version? See it here