Easy-Acumatica Docs

Transactions Service

The `TransactionsService` provides methods for retrieving financial transaction data from Acumatica ERP. Its primary function is to query the General Ledger for transaction details within a specified date range.

Importing Helpers

You will need Python's built-in `datetime` module to specify the date range and `QueryOptions` from `easy_acumatica.models` to expand the results.

python

from datetime import datetime  
from easy_acumatica.models.query_builder import QueryOptions

Service Method

get_ledger_transactions(api_version, start_date, end_date, options=None)

This method retrieves general ledger transactions for a specified period by using the `AccountDetailsForPeriodInquiry` form. Unlike most retrieval methods, this inquiry requires a `PUT` request where the date range is sent in the body. The `easy-acumatica` library handles this complexity for you.

python

# Define the start and end of the period
start_date = datetime(2024, 4, 1)
end_date = datetime(2024, 4, 30)

# The 'Results' entity must be expanded to get the transaction lines
opts = QueryOptions(expand=["Results"])

# Call the service
ledger_transactions = client.transactions.get_ledger_transactions(
    "24.200.001",
    start_date=start_date,
    end_date=end_date,
    options=opts
)

# The actual transactions are in the 'Results' list
for trx in ledger_transactions.get("Results", []):
    print(f"Ref: {trx['RefNumber']['value']}, Desc: {trx['TransactionDescription']['value']}")
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