Brex: Update accounting records
Brex accounting.accountingAccountingControllerUpdateAccountingRecords: arguments, response, policy and SDK examples.
← Accounting operations · Get started
Operation brex.accounting_accountingcontroller_updateaccountingrecords
Provider route: POST /v3/accounting/records. Alter supplies the connection’s credentials and routing.
Call through Alter
Section titled “Call through Alter”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"]["accountingAccountingControllerUpdateAccountingRecords"]>[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.accountingAccountingControllerUpdateAccountingRecords(input); const result = await call.wait(); return result.bodyJson(); } finally { await app.close(); }}import osfrom alter_sdk import Appfrom 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_accounting_controller_update_accounting_records(arguments) result = await call.wait() return result.body_json()| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Additional keys: not allowed |
body | Model | Required within parent | Expand Update accounting records — request body — body |
Referenced models: Update accounting records — request body — body
Response
Section titled “Response”Response media type: application/json. The table describes the pinned successful response. Referenced models link to their complete fields.
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | Model | Root | Expand Update accounting records — response body |
Referenced models: Update accounting records — response body
Schemas
Section titled “Schemas”1 more schema is linked from the tables above, on the schema pages.
Update accounting records — request body — body
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Additional keys: not allowed |
accounting_fields | array | Required within parent | Maximum items: 50 Minimum items: 1 |
accounting_fields[] | object | Each item | Additional keys: not allowed |
accounting_fields[].bool_value | JSON | Optional | |
accounting_fields[].bool_value (anyOf 1) | boolean | Alternative | |
accounting_fields[].bool_value (anyOf 2) | null | Alternative | |
accounting_fields[].date_value | JSON | Optional | |
accounting_fields[].date_value (anyOf 1) | string | Alternative | Format: date Pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))$ |
accounting_fields[].date_value (anyOf 2) | null | Alternative | |
accounting_fields[].enum_value | JSON | Optional | |
accounting_fields[].enum_value (anyOf 1) | string | Alternative | Minimum length: 1 |
accounting_fields[].enum_value (anyOf 2) | null | Alternative | |
accounting_fields[].field_id | string | Required within parent | Field brex_id from accounting field discovery. Minimum length: 1 |
accounting_fields[].is_deleted | JSON | Optional | |
accounting_fields[].is_deleted (anyOf 1) | boolean | Alternative | |
accounting_fields[].is_deleted (anyOf 2) | null | Alternative | |
accounting_fields[].number_value | JSON | Optional | |
accounting_fields[].number_value (anyOf 1) | number | Alternative | |
accounting_fields[].number_value (anyOf 2) | null | Alternative | |
accounting_fields[].string_value | JSON | Optional | |
accounting_fields[].string_value (anyOf 1) | string | Alternative | |
accounting_fields[].string_value (anyOf 2) | null | Alternative | |
accounting_fields[].value_id | JSON | Optional | |
accounting_fields[].value_id (anyOf 1) | string | Alternative | Option brex_id for an option field. Minimum length: 1 |
accounting_fields[].value_id (anyOf 2) | null | Alternative | |
accounting_record_ids | array | Required within parent | Maximum items: 50 Minimum items: 1 |
accounting_record_ids[] | string | Each item | Minimum length: 1 |
Policy, approvals and errors
Section titled “Policy, approvals and errors”SDK function policy ID: brex.accounting_accountingcontroller_updateaccountingrecords. Catalog operation: accounting:AccountingController_updateAccountingRecords. 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.write"]