Skip to content

Brex: Query accounting records

Brex accounting.accountingQueryAccountingRecords: arguments, response, policy and SDK examples.

← Accounting operations · Get started

Operation brex.accounting_queryaccountingrecords

Provider route: GET /v3/accounting/records. Alter supplies the connection’s credentials and routing.

Install @alter-ai/sdk @alter-ai/brex with npm, or alter-sdk-brex with pip. Supply your connected customer’s grant ID and the arguments described below.

import { App } from "@alter-ai/sdk";
import { BrexIntegration } from "@alter-ai/brex";
async function execute(input: Parameters<BrexIntegration["accounting"]["accountingQueryAccountingRecords"]>[0]) {
const app = new App({ apiKey: process.env.ALTER_API_KEY! });
try {
const provider = new BrexIntegration(app, { grantId: process.env.PROVIDER_GRANT_ID! });
const call = await provider.accounting.accountingQueryAccountingRecords(input);
const result = await call.wait();
return result.bodyJson();
} finally {
await app.close();
}
}
import os
from alter_sdk import App
from alter_sdk_brex import BrexIntegration
async def execute(arguments):
async with App(api_key=os.environ["ALTER_API_KEY"]) as app:
provider = BrexIntegration(app, {"grant_id": os.environ["PROVIDER_GRANT_ID"]})
call = await provider.accounting.accounting_query_accounting_records(arguments)
result = await call.wait()
return result.body_json()
FieldTypePresenceDescription and constraints
$objectRootAdditional keys: not allowed
queryobjectOptionalAdditional keys: not allowed
query.cursorstringOptional
query.erp_posting_dateModelOptionalExpand Query accounting records — request body — query erp posting date
query.idsarrayOptional
query.ids[]stringEach item
query.limitnumberOptionalDefault: 10
Maximum: 100
Minimum: 1
query.review_statusstringOptionalOne of: PREPARE, REVIEW, EXPORTED, READY_FOR_EXPORT
query.single_entrybooleanOptional
query.source_typestringOptionalOne of: CARD, REIMBURSEMENT, BILL
query.updated_atModelOptionalExpand Query accounting records — request body — query updated at

Referenced models: Query accounting records — request body — query erp posting date, Query accounting records — request body — query updated at

Response media type: application/json. The table describes the pinned successful response. Referenced models link to their complete fields.

FieldTypePresenceDescription and constraints
$ModelRootExpand Query accounting records — response body

Referenced models: Query accounting records — response body

22 more schemas are linked from the tables above, on the schema pages.

Query accounting records — response body
FieldTypePresenceDescription and constraints
$objectRoot
has_next_pagebooleanRequired within parentWhether there are more results available
itemsarrayRequired within parentThe items in the response
items[]ModelEach itemExpand Get accounting record by ID — response body
next_cursorJSONRequired within parent
next_cursor (anyOf 1)stringAlternativeThe next cursor
next_cursor (anyOf 2)nullAlternative
total_countJSONOptional
total_count (anyOf 1)JSONAlternative
total_count (anyOf 1) (anyOf 1)numberAlternativeTotal count of records matching the query
Format: int32
total_count (anyOf 1) (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
total_count (anyOf 2)nullAlternative

Referenced models: Get accounting record by ID — response body

Query accounting records — request body — query erp posting date
FieldTypePresenceDescription and constraints
$objectRoot
fromstringOptionalInclusive start of the ERP posting date range - ISO 8601 UTC datetime format
Format: date-time
tostringOptionalInclusive end of the ERP posting date range - ISO 8601 UTC datetime format
Format: date-time
Query accounting records — request body — query updated at
FieldTypePresenceDescription and constraints
$objectRoot
gtstringOptionalMinimum value to filter by (exclusive) - ISO 8601 format
Format: date-time
gtestringOptionalMinimum value to filter by (inclusive) - ISO 8601 format
Format: date-time
ltstringOptionalMaximum value to filter by (exclusive) - ISO 8601 format
Format: date-time
ltestringOptionalMaximum value to filter by (inclusive) - ISO 8601 format
Format: date-time
Get accounting record by ID — response body
FieldTypePresenceDescription and constraints
$objectRoot
amountJSONRequired within parentAmount of the accounting record
amount (allOf 1)ModelAll variants applyExpand Get accounting record by ID — response body — amount amount, currency
billing_amountJSONOptional
billing_amount (anyOf 1)objectAlternativeBilling/settlement amount in the account's home currency. For multi-currency transactions (e.g., EUR bill paid from USD account), this represents the actual amount debited. Use billing_amount / original_amount to derive the effective FX rate.
billing_amount (anyOf 1) (allOf 1)ModelAll variants applyExpand Get accounting record by ID — response body — amount amount, currency
billing_amount (anyOf 2)nullAlternative
due_atJSONOptional
due_at (anyOf 1)stringAlternativeSource due at in UTC timezone. For bills only
Format: date-time
due_at (anyOf 2)nullAlternative
erp_posting_datestringRequired within parentERP impact date in UTC timezone
Format: date-time
idstringRequired within parentUnique identifier for the accounting record
invoice_numberJSONOptional
invoice_number (anyOf 1)stringAlternativeInvoice number. For bills only
invoice_number (anyOf 2)nullAlternative
line_itemsarrayRequired within parentLine items for double-entry bookkeeping
line_items[]ModelEach itemExpand Get accounting record by ID — response body — line items item
memoJSONOptional
memo (anyOf 1)stringAlternativeMemo/description
memo (anyOf 2)nullAlternative
original_amountJSONOptional
original_amount (anyOf 1)objectAlternativeOriginal amount if different from current
original_amount (anyOf 1) (allOf 1)ModelAll variants applyExpand Get accounting record by ID — response body — amount amount, currency
original_amount (anyOf 2)nullAlternative
posted_atstringRequired within parentSource posted date in UTC timezone
Format: date-time
receiptsJSONOptional
receipts (anyOf 1)arrayAlternativeAssociated receipts
receipts (anyOf 1)[]ModelEach itemExpand Get accounting record by ID — response body — receipts Associated receipts item
receipts (anyOf 2)nullAlternative
review_statusstringRequired within parentReview status
Known values: READY_FOR_EXPORT, PREPARE, REVIEW, EXPORTED
source_idJSONOptional
source_id (anyOf 1)stringAlternativeSource transaction ID
source_id (anyOf 2)nullAlternative
source_typestringRequired within parentSource type
Known values: CARD, REIMBURSEMENT, BILL
statusJSONOptional
status (anyOf 1)stringAlternativeThe source expense's approval/lifecycle status. For bills this reflects the bill's approval state (e.g. SUBMITTED = pending approval, APPROVED = approved), which is not derivable from review_status (always READY_FOR_EXPORT when polling).
Known values: APPROVED, CANCELED, DRAFT, OUT_OF_POLICY, SETTLED, SPLIT, SUBMITTED, VOID
status (anyOf 2)nullAlternative
typestringRequired within parentTypes of accounting records representing different financial transactions:

**Card-related transactions:**

- `CARD_EXPENSE_POST`: Records when a card expense is posted and settled

- `CARD_EXPENSE_REFUND`: Records when a merchant issues a refund for a card transaction

- `CARD_EXPENSE_REPAYMENT`: Records when an employee repays money to the company for a card expense

- `CARD_PAYMENT`: Records payments from customer to Brex for card balances

- `CARD_PAYMENT_REFUND`: Records refunds from Brex to customer for overpayments

- `REWARD_REDEMPTION`: Records when a reward is redeemed

**Bill-related transactions:**

- `BILL_EXPENSE`: Records when a bill expense is created

- `BILL_EXPENSE_PAYMENT`: Records when a bill is paid through ACH/wire transfer

- `BILL_EXPENSE_CARD_PAYMENT`: Records when a bill is paid using a Brex card

**Reimbursement-related transactions:**

- `REIMBURSEMENT_EXPENSE_APPROVAL`: Records approval of reimbursement (accrual basis)

- `REIMBURSEMENT_EXPENSE_POST`: Records when reimbursement is fulfilled (cash basis)

- `REIMBURSEMENT_EXPENSE_REPAYMENT`: Records repayment of a reimbursement expense

- `REIMBURSEMENT_EXPENSE_MONEY_MOVEMENT_PAYOUT`: Records payout to employee/third party

- `REIMBURSEMENT_EXPENSE_MONEY_MOVEMENT_PAYOUT_REVERSAL`: Records reversal of payout

- `REIMBURSEMENT_EXPENSE_MONEY_MOVEMENT_PAYIN`: Records payment from customer to Brex

- `REIMBURSEMENT_EXPENSE_MONEY_MOVEMENT_REFUND`: Records refund to customer's bank
Known values: CARD_EXPENSE_POST, CARD_EXPENSE_REPAYMENT, REIMBURSEMENT_EXPENSE_REPAYMENT, REIMBURSEMENT_EXPENSE_APPROVAL, REIMBURSEMENT_EXPENSE_MONEY_MOVEMENT_PAYOUT, REIMBURSEMENT_EXPENSE_MONEY_MOVEMENT_PAYIN, REIMBURSEMENT_EXPENSE_POST, CARD_PAYMENT, REWARD_REDEMPTION, REIMBURSEMENT_EXPENSE_MONEY_MOVEMENT_REFUND, CARD_EXPENSE_REFUND, CARD_PAYMENT_REFUND, REIMBURSEMENT_EXPENSE_MONEY_MOVEMENT_PAYOUT_REVERSAL, INVOICE, INVOICE_PAYMENT, BILL_EXPENSE, BILL_EXPENSE_PAYMENT, BILL_EXPENSE_CARD_PAYMENT, BILL_MONEY_MOVEMENT_PAYIN
updated_atstringRequired within parentLast update timestamp in UTC timezone
Format: date-time
userJSONOptional
user (anyOf 1)objectAlternativeUser associated with the record
user (anyOf 1) (allOf 1)ModelAll variants applyExpand Get accounting record by ID — response body — user User associated with the record account id, brex assistant, department id, department name, email, first name, id, last name, location id, location name, manager first name, manager id, manager last name, manager title id, manager title name, metadata, notification preferences, phone number, role, status, title id, title name
user (anyOf 2)nullAlternative
vendorJSONOptional
vendor (anyOf 1)objectAlternativeVendor information
vendor (anyOf 1) (allOf 1)ModelAll variants applyExpand Get accounting record by ID — response body — vendor Vendor information contact name, customer account id, customer dba name, email, id, name, payment config, phone, rail account details, website
vendor (anyOf 2)nullAlternative
versionJSONRequired within parent
version (anyOf 1)numberAlternativeVersion number
version (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$

Referenced models: Get accounting record by ID — response body — receipts Associated receipts item, Get accounting record by ID — response body — line items item, Get accounting record by ID — response body — amount amount, currency, Get accounting record by ID — response body — user User associated with the record account id, brex assistant, department id, department name, email, first name, id, last name, location id, location name, manager first name, manager id, manager last name, manager title id, manager title name, metadata, notification preferences, phone number, role, status, title id, title name, Get accounting record by ID — response body — vendor Vendor information contact name, customer account id, customer dba name, email, id, name, payment config, phone, rail account details, website

Get accounting record by ID — response body — amount amount, currency
FieldTypePresenceDescription and constraints
$objectRoot
amountJSONRequired within parent
amount (anyOf 1)numberAlternativeThe amount
amount (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
currencystringRequired within parentThe currency

SDK function policy ID: brex.accounting_queryaccountingrecords. Catalog operation: accounting:queryAccountingRecords. Rules can name either ID; function rules distinguish managed calls and conservatively cover raw calls sharing the route. Existing grant permissions and policy rules apply. wait() returns an immediate result or waits for a required approval; it never approves the request itself. Persist the approval ID to resume after a restart.

Provider errors retain their response; JSON decoding raises ProviderAPIError for provider failures. ManagedOperationError identifies contract/input/retention errors. See error handling and provider-specific behavior. Sensitive input may be refused before approval storage. A decoding error never resubmits a write.

Required provider scopes: ["accounting.record.read", "accounting.record.write"]

Official provider source

Report an issue with this page

Necessary

Required for sign-in, security, authorization, and remembering your choices.

Always active

Analytics

Helps us understand which product and documentation features are useful.

Performance diagnostics

Uses performance tracing and privacy-masked session replay to diagnose problems.

You can change these choices at any time from Cookie settings.