# Query accounting records

Query accounting records by IDs or with filters for polling. When building integrations with Brex accounting workflow, use filter-based polling as a fallback mechanism. Suggested cadence is 1 hour.

For card and reimbursement records:
Use review_status to filter by accounting workflow stage (e.g., READY_FOR_EXPORT, EXPORTED).

For bill records:
Use source_type=BILL with updated_at[gt] to poll for updated bill records.

Filter Constraints:
- review_status is only supported with CARD and REIMBURSEMENT source types

Endpoint: GET /v3/accounting/records
Version: 1.0.0-alpha
Security: oauth2

## Query parameters:

  - `ids` (array)
    Filter by accounting record IDs. ID size is limited to 500. Example: ids=accr_xxx&ids=accr_yyy

  - `review_status` (string)
    Filter by review status. Supported values: PREPARE, REVIEW, EXPORTED, READY_FOR_EXPORT.
    Enum: "PREPARE", "REVIEW", "EXPORTED", "READY_FOR_EXPORT"

  - `limit` (number)
    Maximum number of records to return

  - `cursor` (string)
    Cursor for pagination

  - `single_entry` (boolean)
    Whether to return single entry line items

  - `updated_at` (object)
    Filter by updated_at timestamp range in UTC. Accepts gt (greater than), gte (greater than or equal), lt (less than), lte (less than or equal). Example: updated_at[gte]=2025-01-01

  - `source_type` (string)
    Filter by accounting record source type. This is a high-level filter that maps to specific accounting record types. Example: source_type=BILL
    Enum: "CARD", "REIMBURSEMENT", "BILL"

## Response 200 fields (application/json):

  - `items` (array, required)
    List of accounting records

  - `items.id` (string, required)
    Unique identifier for the accounting record
    Example: "accr_abc123"

  - `items.amount` (object, required)
    Amount of the accounting record

  - `items.amount.amount` (number, required)
    The amount
    Example: 100

  - `items.amount.currency` (string, required)
    The currency
    Example: "USD"

  - `items.original_amount` (object,null)
    Original amount if different from current

  - `items.original_amount.amount` (number, required)
    The amount
    Example: 100

  - `items.original_amount.currency` (string, required)
    The currency
    Example: "USD"

  - `items.type` (string, required)
    Types 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
    Enum: "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"

  - `items.review_status` (string, required)
    Review status
    Enum: "READY_FOR_EXPORT", "PREPARE", "REVIEW", "EXPORTED"

  - `items.source_id` (string,null)
    Source transaction ID

  - `items.source_type` (string, required)
    Source type
    Enum: "CARD", "REIMBURSEMENT", "BILL"

  - `items.erp_posting_date` (string, required)
    ERP impact date in UTC timezone

  - `items.updated_at` (string, required)
    Last update timestamp in UTC timezone

  - `items.version` (number, required)
    Version number

  - `items.receipts` (array,null)
    Associated receipts

  - `items.receipts.id` (string, required)
    Unique identifier for the receipt

  - `items.receipts.download_uris` (array,null)
    Presigned S3 URLs to download receipt files (expire in 15 minutes)

  - `items.user` (object,null)
    User associated with the record

  - `items.user.id` (string, required)
    The ID of the user
    Example: "VXNlcjpjdXVzZXJfMTIzNA=="

  - `items.user.first_name` (string, required)
    The user's first name
    Example: "John"

  - `items.user.last_name` (string, required)
    The user's last name
    Example: "Doe"

  - `items.user.email` (string, required)
    The user's email address
    Example: "john.doe@example.com"

  - `items.user.role` (string, required)
    The user's role in the system
    Enum: "ACCOUNT_ADMIN", "AP_CLERK", "BOOKKEEPER", "CARD_ADMIN", "EMPLOYEE", "EMPLOYEE_WITHOUT_CORP_CARDS", "EXPENSE_ADMIN", "SUPER_ADMIN", "USER_MANAGEMENT_ADMIN"

  - `items.user.status` (string, required)
    The user's status in the system
    Enum: "ACTIVE", "ARCHIVED", "DELETED", "DISABLED", "INACTIVE", "INVITED", "PENDING_ACTIVATION"

  - `items.user.manager_id` (string)
    The ID of the user's manager
    Example: "VXNlcjpjdXVzZXJfMTIzNA=="

  - `items.user.department_id` (string)
    The ID of the user's department
    Example: "VXNlcjpjdXVzZXJfMTIzNA=="

  - `items.user.department_name` (string)
    The user's department name
    Example: "Engineering"

  - `items.user.location_id` (string)
    The ID of the user's location
    Example: "VXNlcjpjdXVzZXJfMTIzNA=="

  - `items.user.location_name` (string)
    The user's location name
    Example: "San Francisco"

  - `items.user.title_id` (string)
    The user's title ID
    Example: "VGl0bGU6dGl0bGVfMTIzNA=="

  - `items.user.title_name` (string)
    The user's title display name
    Example: "Software Engineer"

  - `items.user.manager_first_name` (string)
    The user's manager first name
    Example: "Jane"

  - `items.user.manager_last_name` (string)
    The user's manager last name
    Example: "Smith"

  - `items.user.manager_title_id` (string)
    The user's manager title ID
    Example: "VGl0bGU6dGl0bGVfMTIzNA=="

  - `items.user.manager_title_name` (string)
    The user's manager title display name
    Example: "Engineering Manager"

  - `items.vendor` (object,null)
    Vendor information

  - `items.vendor.id` (string, required)
    The unique identifier for the vendor
    Example: "vendor_123"

  - `items.vendor.name` (string, required)
    The name of the vendor
    Example: "Acme Corp"

  - `items.vendor.contact_name` (string,null)
    The name of the contact for the vendor
    Example: "Jane Smith"

  - `items.vendor.email` (string,null)
    The email for the vendor
    Example: "contact@acme.com"

  - `items.vendor.website` (string,null)
    The website of the vendor
    Example: "https://acme.com"

  - `items.vendor.phone` (string,null)
    The phone number for the vendor
    Example: "+1-555-123-4567"

  - `items.memo` (string,null)
    Memo/description

  - `items.posted_at` (string, required)
    Source posted date in UTC timezone

  - `items.due_at` (string,null)
    Source due at in UTC timezone. For bills only

  - `items.invoice_number` (string,null)
    Invoice number. For bills only

  - `items.line_items` (array, required)
    Line items for double-entry bookkeeping

  - `items.line_items.id` (string, required)
    Unique identifier for the line item
    Example: "arli_abc123"

  - `items.line_items.type` (string, required)
    Type of line item
    Enum: "CREDIT", "DEBIT"

  - `items.line_items.amount` (object, required)
    Amount for this line item. Amount is always positive for AccountingRecordLineItem.

  - `items.line_items.amount.amount` (number, required)
    The amount
    Example: 100

  - `items.line_items.amount.currency` (string, required)
    The currency
    Example: "USD"

  - `items.line_items.original_amount` (object,null)
    Original amount for this line item. Amount is always positive for AccountingRecordLineItem.

  - `items.line_items.original_amount.amount` (number, required)
    The amount
    Example: 100

  - `items.line_items.original_amount.currency` (string, required)
    The currency
    Example: "USD"

  - `items.line_items.memo` (string,null)
    Memo/description

  - `items.line_items.accounting_field_values` (array, required)
    Accounting field mappings

  - `items.line_items.accounting_field_values.brex_field_id` (string, required)
    Brex internal field identifier
    Example: "ef_123"

  - `items.line_items.accounting_field_values.remote_field_id` (string,null, required)
    Remote system field identifier
    Example: "1"

  - `items.line_items.accounting_field_values.brex_field_value_id` (string, required)
    Brex internal field value identifier
    Example: "efo_123"

  - `items.line_items.accounting_field_values.remote_field_value_id` (string,null, required)
    Remote system field value identifier
    Example: "123"

  - `total_count` (number,null)
    Total count of records matching the query

  - `next_cursor` (string,null)
    Cursor for the next page of results

  - `has_next_page` (boolean, required)
    Whether there are more results available

## Response 400 fields (application/json):

  - `error_code` (string, required)
    Machine-readable error code
    Enum: "ACTIVE_INTEGRATION_EXISTS", "FORBIDDEN", "INTEGRATION_NOT_ACTIVE", "INTERNAL_ERROR", "INVALID_REQUEST", "NOT_FOUND", "UNAUTHORIZED", "DUPLICATE_ACCOUNTING_RECORD_IDS", "ACCOUNTING_RECORD_NOT_READY_FOR_EXPORT", "VENDOR_ACCOUNT_ID_MISMATCH"

  - `message` (string, required)
    Human-readable error message
    Example: "The request is malformed or contains invalid data."

  - `details` (object,null)
    Additional error context

  - `details.existing_integration_id` (string)
    ID of the existing active integration
    Example: "int_abc123"

  - `details.existing_vendor` (string)
    Vendor of the existing integration
    Example: "ERP_A"

  - `details.requested_vendor` (string)
    Vendor that was requested to be created
    Example: "ERP_B"

  - `details.integration_id` (string)
    Integration ID associated with the error
    Example: "int_abc123"

  - `details.current_status` (string)
    Current status of the integration when the error occurred
    Example: "DISABLED"

  - `details.duplicate_accounting_record_ids` (array)
    Accounting record IDs that triggered the error
    Example: ["accr_abc123","accr_def456"]

  - `details.not_ready_for_export_accounting_record_ids` (array)
    Accounting record IDs that are not ready for export
    Example: ["accr_ghi789"]

  - `details.not_found_export_entry_source_ids` (array)
    Accounting record IDs that could not be found
    Example: ["accr_ghi789"]


