Skip to content

BudgetsV1

Defined in: src/budgets/client.gen.ts:149

new BudgetsV1(_core): BudgetsV1

Defined in: src/budgets/client.gen.ts:150

BrexCore

BudgetsV1

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

Defined in: src/budgets/client.gen.ts:159

Archive a Spend Limit

Archives a Spend Limit, making it unusable for future expenses and removing it from the UI

POST /v1/budgets/{id}/archive — requires OAuth scope: budgets

string

RequestOptions

Promise<void>


create(body, options?): Promise<{ account_id: string; budget_id: string; budget_status: "DELETED" | "APPROVED" | "EXPIRED" | "TERMINATED"; budget_type: "BUDGET" | "SPEND_LIMIT"; creator_user_id?: string | null; current_period_balance?: { balance?: { amount: number; currency: string | null; } | null; end_date?: string | null; start_date?: string | null; } | null; description?: string | null; end_date?: string | null; limit?: { amount: number; currency: string | null; } | null; limit_type?: "HARD" | "SOFT" | null; limit_visibility: "PRIVATE" | "SHARED"; member_user_ids: string[]; name: string; owner_user_ids: string[]; parent_budget_id?: string | null; period_type: "WEEKLY" | "MONTHLY" | "QUARTERLY" | "YEARLY" | "ONE_TIME"; spend_type: "BUDGET_PROVISIONED_CARDS_ONLY" | "NON_BUDGET_PROVISIONED_CARDS_ALLOWED"; start_date?: string | null; templateId?: string | null; }>

Defined in: src/budgets/client.gen.ts:176

Create Spend Limit

Creates a Spend Limit

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

string

Description

Description of what the Spend Limit is used for.

string | null

Format: date

Description

The UTC date when the Spend Limit should stop counting.

string | null

{ amount: number; currency: string | null; }

number

Format: int64

Description

The amount of money, in the smallest denomination of the currency indicated by currency. For example, when currency is USD, amount is in cents.

Example

700

string | null

Description

The type of currency, in ISO 4217 format.

Default

USD

Example

USD

"HARD" | "SOFT"

"PRIVATE" | "SHARED"

string[] | null

Description

User IDs of the members of the Spend Limit.

string

Description

Name for the Spend Limit.

string[] | null

Description

User IDs of the owners of the Spend Limit.

string

Description

ID of parent Budget.

"WEEKLY" | "MONTHLY" | "QUARTERLY" | "YEARLY" | "ONE_TIME"

string | null

"BUDGET_PROVISIONED_CARDS_ONLY" | "NON_BUDGET_PROVISIONED_CARDS_ALLOWED"

string | null

Format: date

Description

The UTC date when the Spend Limit should start counting.

RequestOptions

Promise<{ account_id: string; budget_id: string; budget_status: "DELETED" | "APPROVED" | "EXPIRED" | "TERMINATED"; budget_type: "BUDGET" | "SPEND_LIMIT"; creator_user_id?: string | null; current_period_balance?: { balance?: { amount: number; currency: string | null; } | null; end_date?: string | null; start_date?: string | null; } | null; description?: string | null; end_date?: string | null; limit?: { amount: number; currency: string | null; } | null; limit_type?: "HARD" | "SOFT" | null; limit_visibility: "PRIVATE" | "SHARED"; member_user_ids: string[]; name: string; owner_user_ids: string[]; parent_budget_id?: string | null; period_type: "WEEKLY" | "MONTHLY" | "QUARTERLY" | "YEARLY" | "ONE_TIME"; spend_type: "BUDGET_PROVISIONED_CARDS_ONLY" | "NON_BUDGET_PROVISIONED_CARDS_ALLOWED"; start_date?: string | null; templateId?: string | null; }>


get(id, options?): Promise<{ account_id: string; budget_id: string; budget_status: "DELETED" | "APPROVED" | "EXPIRED" | "TERMINATED"; budget_type: "BUDGET" | "SPEND_LIMIT"; creator_user_id?: string | null; current_period_balance?: { balance?: { amount: number; currency: string | null; } | null; end_date?: string | null; start_date?: string | null; } | null; description?: string | null; end_date?: string | null; limit?: { amount: number; currency: string | null; } | null; limit_type?: "HARD" | "SOFT" | null; limit_visibility: "PRIVATE" | "SHARED"; member_user_ids: string[]; name: string; owner_user_ids: string[]; parent_budget_id?: string | null; period_type: "WEEKLY" | "MONTHLY" | "QUARTERLY" | "YEARLY" | "ONE_TIME"; spend_type: "BUDGET_PROVISIONED_CARDS_ONLY" | "NON_BUDGET_PROVISIONED_CARDS_ALLOWED"; start_date?: string | null; templateId?: string | null; }>

Defined in: src/budgets/client.gen.ts:194

Get Spend Limit

Retrieves a Spend Limit by ID

GET /v1/budgets/{id} — requires OAuth scope: budgets.readonly, budgets

string

RequestOptions

Promise<{ account_id: string; budget_id: string; budget_status: "DELETED" | "APPROVED" | "EXPIRED" | "TERMINATED"; budget_type: "BUDGET" | "SPEND_LIMIT"; creator_user_id?: string | null; current_period_balance?: { balance?: { amount: number; currency: string | null; } | null; end_date?: string | null; start_date?: string | null; } | null; description?: string | null; end_date?: string | null; limit?: { amount: number; currency: string | null; } | null; limit_type?: "HARD" | "SOFT" | null; limit_visibility: "PRIVATE" | "SHARED"; member_user_ids: string[]; name: string; owner_user_ids: string[]; parent_budget_id?: string | null; period_type: "WEEKLY" | "MONTHLY" | "QUARTERLY" | "YEARLY" | "ONE_TIME"; spend_type: "BUDGET_PROVISIONED_CARDS_ONLY" | "NON_BUDGET_PROVISIONED_CARDS_ALLOWED"; start_date?: string | null; templateId?: string | null; }>


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

Defined in: src/budgets/client.gen.ts:213

List Spend Limits

Lists Spend Limits belonging to this account

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

string | null

number | null

RequestOptions

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


update(id, body, options?): Promise<{ account_id: string; budget_id: string; budget_status: "DELETED" | "APPROVED" | "EXPIRED" | "TERMINATED"; budget_type: "BUDGET" | "SPEND_LIMIT"; creator_user_id?: string | null; current_period_balance?: { balance?: { amount: number; currency: string | null; } | null; end_date?: string | null; start_date?: string | null; } | null; description?: string | null; end_date?: string | null; limit?: { amount: number; currency: string | null; } | null; limit_type?: "HARD" | "SOFT" | null; limit_visibility: "PRIVATE" | "SHARED"; member_user_ids: string[]; name: string; owner_user_ids: string[]; parent_budget_id?: string | null; period_type: "WEEKLY" | "MONTHLY" | "QUARTERLY" | "YEARLY" | "ONE_TIME"; spend_type: "BUDGET_PROVISIONED_CARDS_ONLY" | "NON_BUDGET_PROVISIONED_CARDS_ALLOWED"; start_date?: string | null; templateId?: string | null; }>

Defined in: src/budgets/client.gen.ts:230

Update Spend Limit

Updates a Spend Limit

PUT /v1/budgets/{id} — requires OAuth scope: budgets Sends an Idempotency-Key header: options.idempotencyKey, or an auto-generated UUID.

string

string | null

Description

Description of what the Spend Limit is used for.

string | null

Format: date

Description

The UTC date when the Spend Limit should stop counting.

{ amount: number; currency: string | null; } | null

"HARD" | "SOFT" | null

"PRIVATE" | "SHARED" | null

string[] | null

Description

User IDs of the members of the Spend Limit.

string | null

Description

Name for the Spend Limit.

string[] | null

Description

User IDs of the owners of the Spend Limit.

"WEEKLY" | "MONTHLY" | "QUARTERLY" | "YEARLY" | "ONE_TIME" | null

"BUDGET_PROVISIONED_CARDS_ONLY" | "NON_BUDGET_PROVISIONED_CARDS_ALLOWED" | null

string | null

Format: date

Description

The UTC date when the Spend Limit should start counting.

RequestOptions

Promise<{ account_id: string; budget_id: string; budget_status: "DELETED" | "APPROVED" | "EXPIRED" | "TERMINATED"; budget_type: "BUDGET" | "SPEND_LIMIT"; creator_user_id?: string | null; current_period_balance?: { balance?: { amount: number; currency: string | null; } | null; end_date?: string | null; start_date?: string | null; } | null; description?: string | null; end_date?: string | null; limit?: { amount: number; currency: string | null; } | null; limit_type?: "HARD" | "SOFT" | null; limit_visibility: "PRIVATE" | "SHARED"; member_user_ids: string[]; name: string; owner_user_ids: string[]; parent_budget_id?: string | null; period_type: "WEEKLY" | "MONTHLY" | "QUARTERLY" | "YEARLY" | "ONE_TIME"; spend_type: "BUDGET_PROVISIONED_CARDS_ONLY" | "NON_BUDGET_PROVISIONED_CARDS_ALLOWED"; start_date?: string | null; templateId?: string | null; }>