Skip to content

Fields

Defined in: src/fields/client.gen.ts:8

new Fields(_core): Fields

Defined in: src/fields/client.gen.ts:9

BrexCore

Fields

create(body, options?): Promise<{ brex_id: string; group?: "TRAVEL" | "ACCOUNTING" | "USER" | "ERP" | null; is_disabled: boolean; name: string | null; remote_id?: string | null; updated_at: string; }>

Defined in: src/fields/client.gen.ts:19

Create a custom field

Create a custom field

POST /v1/fields — requires OAuth scope: fields.write Sends an Idempotency-Key header: options.idempotencyKey, or an auto-generated UUID.

"TRAVEL" | "ACCOUNTING" | "USER" | "ERP"

string | null

Description

The ID of the Accounting Integration to associate this field with. This property is required when group is ERP: it must reference an existing Accounting Integration, and requests that omit it or send null for an ERP field are rejected. For all other groups (ACCOUNTING, USER, TRAVEL) integration_id is not applicable and should be left null.

Example

int_123

boolean | null

Description

Indicates whether the field is disabled. A disabled field is not selectable: it is no longer offered as an option in the Brex dropdown and cannot be applied to new transactions. Records that already reference the field are unaffected.

string

Description

The name of the field

string | null

Description

Remote/external ID of custom field from external system (e.g. ERP or HRIS system)

Example

foo_bar

RequestOptions

Promise<{ brex_id: string; group?: "TRAVEL" | "ACCOUNTING" | "USER" | "ERP" | null; is_disabled: boolean; name: string | null; remote_id?: string | null; updated_at: string; }>


delete(id, options?): Promise<void>

Defined in: src/fields/client.gen.ts:37

Delete a custom field

Delete a custom field by Brex ID

DELETE /v1/fields/{id} — requires OAuth scope: fields.write

string

RequestOptions

Promise<void>


get(id, options?): Promise<{ brex_id: string; group?: "TRAVEL" | "ACCOUNTING" | "USER" | "ERP" | null; is_disabled: boolean; name: string | null; remote_id?: string | null; updated_at: string; }>

Defined in: src/fields/client.gen.ts:53

Get custom field

Get a custom field by Brex ID

GET /v1/fields/{id} — requires OAuth scope: fields.read, fields.write

string

RequestOptions

Promise<{ brex_id: string; group?: "TRAVEL" | "ACCOUNTING" | "USER" | "ERP" | null; is_disabled: boolean; name: string | null; remote_id?: string | null; updated_at: string; }>


list(query?, options?): PagePromise<{ items: object[]; next_cursor?: string | null; }>

Defined in: src/fields/client.gen.ts:70

List custom fields

List custom fields under the same account

GET /v1/fields — requires OAuth scope: fields.read, fields.write Await for a single page, or for await to iterate items across all pages.

string | null

Description

The cursor to use for pagination. This is the next_cursor value returned from the previous response.

string[] | null

Description

The Brex identifiers of the field to filter by

Example

extended_field_foobar

number | null

Description

Controls the maximum number of field values returned in the response. It can’t be greater than 1000.

RequestOptions

PagePromise<{ items: object[]; next_cursor?: string | null; }>


update(id, body, options?): Promise<{ brex_id: string; group?: "TRAVEL" | "ACCOUNTING" | "USER" | "ERP" | null; is_disabled: boolean; name: string | null; remote_id?: string | null; updated_at: string; }>

Defined in: src/fields/client.gen.ts:86

Update a custom field

Update a field by ID

PUT /v1/fields/{id} — requires OAuth scope: fields.write

string

boolean | null

Description

Indicates whether the field is disabled. A disabled field is not selectable: it is no longer offered as an option in the Brex dropdown and cannot be applied to new transactions. Records that already reference the field are unaffected.

string | null

Description

The name of the field

RequestOptions

Promise<{ brex_id: string; group?: "TRAVEL" | "ACCOUNTING" | "USER" | "ERP" | null; is_disabled: boolean; name: string | null; remote_id?: string | null; updated_at: string; }>