Easy-Acumatica Docs

Business Accounts Service

This guide covers the BusinessAccountsService, which is your primary tool for retrieving business account records through the Acumatica contract-based API. Use it to list or filter for customers, vendors, or combined account types in your Acumatica ERP instance.

Importing Helpers

Before using the service, import the necessary helpers: QueryOptions for query configuration and F for building filter expressions.

python

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

Service Method

get_business_accounts(api_version, options)

Retrieves a list of business accounts using the /BusinessAccount endpoint. To retrieve a specific account, filter using QueryOptions and the BusinessAccountID field.

Example 1: Get all active vendor accounts
python

# 1. Define query options for active vendors
query = (
    QueryOptions()
    .filter("Status eq 'Active' and Type eq 'Vendor'")
    .select("BusinessAccountID", "BusinessAccountName", "Status")
)

# 2. Fetch the accounts
vendors = client.business_accounts.get_business_accounts("24.200.001", options=query)
for vendor in vendors:
    print(f"ID: {vendor['BusinessAccountID']['value']}, Name: {vendor['BusinessAccountName']['value']}")

Example 2: Get a single account by ID
python

# 1. Define filter for a specific BusinessAccountID
query = QueryOptions(
    filter=F.BusinessAccountID == "000001",
    expand=["MainContact"]
)

# 2. Fetch the specific business account
accounts = client.business_accounts.get_business_accounts("24.200.001", options=query)
if accounts:
    account = accounts[0]
    print(f"Retrieved Account: {account['BusinessAccountName']['value']}")
else:
    print("Account not found.")
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