Generate Account Statement

Generates a comprehensive account statement for a specified account with transaction history and balance information.

An account statement includes these details.

  • Transaction History—List of all financial transactions, such as invoices, credit memos, debit memos, payments, and refunds, within a specified date range.
  • Open Balances—Non-zero balances for invoices and other transactions.
  • Account Summary—Aggregated totals including beginning balance, total charges, total payments, and ending balance.
  • Multi-currency Support—Transactions across multiple currencies.

This action is available in API version 66.0 and later.

Supported REST HTTP Methods 

URI:/services/data/v68.0/actions/standard/generateAccountStatement

Formats: JSON, XML

HTTP Methods: POST

Authentication:Authorization: Bearer TOKEN

Where TOKEN is a placeholder for your OAuth access token.

Inputs 

InputTypeDescription
accountIdstringRequired. ID of the account for which to generate the statement of account.
associatedAccountIdsstringList of associated account IDs from hierarchy to include in the statement. You can specify a maximum of 50 accounts.
correlationIdstringCorrelation ID that tracks messages related to the request. These messages are logged in Splunk by the different services involved in the request. If this ID isn’t specified, a random Universally Unique Identifier (UUID) is created.
customFieldsstringJSON string specifying custom fields to include in the statement. As a best practice, we recommend that you limit the number of custom fields up to 30 fields. Valid objects to specify the associated fields are Invoice, CreditMemo, Payment, DebitMemo, Refund, or Account. Available in API version 67.0 and later.
documentTemplateIdstringDocument template ID to use for PDF generation. If you don’t specify a value, the default account statement template is used.
shouldShowOpenBalancesOnlybooleanIndicates whether to show only accounts with non-zero balances (true) or complete transaction history within date range (false).
sortBystringRequired. Criteria for sorting transactions. The default and valid value is Date.
sortingOrderstringSort order for transactions. Values are Ascending or Descending. The default value is Desc.
startDatedateRequired. The date from when the transaction history is to be considered in YYYY MM DD format. This parameter value is required when the shouldShowOpenBalancesOnly parameter value is false. The date must be within the last 90 days and can’t be in the future.
transactionTypesstringList of transaction types to include in the statement. If you don’t specify a value or if it’s empty, all transaction types are included. Valid values are All, Invoice, CreditMemo, Payment, DebitMemo, or Refund.

Example:

1{"Invoice": ["field1", "field2"], "Account": {"base": ["field1"], "associated": ["field2"]}}

Outputs 

OutputTypeDescription
accountIdstringID of the account for which to generate the account statement.
requestIdentifierstringUnique request identifier for tracking the async operation.
statusUrlstringURL that tracks the status of the request and retrieves the generated document.
templateIdstringDocument template ID that’s used for PDF generation.

Example 

POST

This example shows a sample request for the Generate Account Statement action.

1{
2  "inputs": [
3    {
4      "accountId": "001000000000001AAA",
5      "shouldShowOpenBalancesOnly": false,
6      "startDate": "2025-01-01",
7      "transactionTypes": [
8        "All"
9      ],
10      "sortBy": "Date",
11      "sortingOrder": "Descending",
12      "associatedAccountIds": [
13        "001000000000002AAA",
14        "001000000000003AAA"
15      ],
16      "documentTemplateId": "a0T000000000001AAA",
17      "customFields": "{\"Invoice\": [\"TotalAmountWithTax\"], \"Account\": {\"base\": [\"Phone\", \"Fax\"], \"associated\": [\"Website\"]}}}"
18    }
19  ]
20}

This example shows a sample response for the Generate Account Statement action.

1{
2  "accountId": "001AAC0001O5W9pYBF",
3  "errors": [],
4  "requestIdentifier": "3267407f-0c96-4b8a-a8e0-bb7a71c91a2f",
5  "statusUrl": "16PAAC000008AIM",
6  "success": true,
7  "templateId": "2dtAAC000002oiIYBQ"
8}