Fields
Defined in: src/fields/client.gen.ts:8
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new Fields(
_core):Fields
Defined in: src/fields/client.gen.ts:9
Parameters
Section titled “Parameters”Returns
Section titled “Returns”Fields
Methods
Section titled “Methods”create()
Section titled “create()”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.
Parameters
Section titled “Parameters”"TRAVEL" | "ACCOUNTING" | "USER" | "ERP"
integration_id?
Section titled “integration_id?”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_123is_disabled?
Section titled “is_disabled?”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
remote_id?
Section titled “remote_id?”string | null
Description
Remote/external ID of custom field from external system (e.g. ERP or HRIS system)
Example
foo_baroptions?
Section titled “options?”Returns
Section titled “Returns”Promise<{ brex_id: string; group?: "TRAVEL" | "ACCOUNTING" | "USER" | "ERP" | null; is_disabled: boolean; name: string | null; remote_id?: string | null; updated_at: string; }>
delete()
Section titled “delete()”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
Parameters
Section titled “Parameters”string
options?
Section titled “options?”Returns
Section titled “Returns”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
Parameters
Section titled “Parameters”string
options?
Section titled “options?”Returns
Section titled “Returns”Promise<{ brex_id: string; group?: "TRAVEL" | "ACCOUNTING" | "USER" | "ERP" | null; is_disabled: boolean; name: string | null; remote_id?: string | null; updated_at: string; }>
list()
Section titled “list()”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.
Parameters
Section titled “Parameters”query?
Section titled “query?”cursor?
Section titled “cursor?”string | null
Description
The cursor to use for pagination. This is the next_cursor value returned from the previous response.
field_id[]?
Section titled “field_id[]?”string[] | null
Description
The Brex identifiers of the field to filter by
Example
extended_field_foobarlimit?
Section titled “limit?”number | null
Description
Controls the maximum number of field values returned in the response. It can’t be greater than 1000.
options?
Section titled “options?”Returns
Section titled “Returns”PagePromise<{ items: object[]; next_cursor?: string | null; }>
update()
Section titled “update()”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
Parameters
Section titled “Parameters”string
is_disabled?
Section titled “is_disabled?”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
options?
Section titled “options?”Returns
Section titled “Returns”Promise<{ brex_id: string; group?: "TRAVEL" | "ACCOUNTING" | "USER" | "ERP" | null; is_disabled: boolean; name: string | null; remote_id?: string | null; updated_at: string; }>