BudgetsV1
Defined in: src/budgets/client.gen.ts:149
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new BudgetsV1(
_core):BudgetsV1
Defined in: src/budgets/client.gen.ts:150
Parameters
Section titled “Parameters”Returns
Section titled “Returns”BudgetsV1
Methods
Section titled “Methods”archive()
Section titled “archive()”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
Parameters
Section titled “Parameters”string
options?
Section titled “options?”Returns
Section titled “Returns”Promise<void>
create()
Section titled “create()”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.
Parameters
Section titled “Parameters”description
Section titled “description”string
Description
Description of what the Spend Limit is used for.
end_date?
Section titled “end_date?”string | null
Format: date
Description
The UTC date when the Spend Limit should stop counting.
entity_id?
Section titled “entity_id?”string | null
{ amount: number; currency: string | null; }
limit.amount
Section titled “limit.amount”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
700limit.currency
Section titled “limit.currency”string | null
Description
The type of currency, in ISO 4217 format.
Default
USDExample
USDlimit_type
Section titled “limit_type”"HARD" | "SOFT"
limit_visibility
Section titled “limit_visibility”"PRIVATE" | "SHARED"
member_user_ids?
Section titled “member_user_ids?”string[] | null
Description
User IDs of the members of the Spend Limit.
string
Description
Name for the Spend Limit.
owner_user_ids?
Section titled “owner_user_ids?”string[] | null
Description
User IDs of the owners of the Spend Limit.
parent_budget_id
Section titled “parent_budget_id”string
Description
ID of parent Budget.
period_type
Section titled “period_type”"WEEKLY" | "MONTHLY" | "QUARTERLY" | "YEARLY" | "ONE_TIME"
policy_id?
Section titled “policy_id?”string | null
spend_type
Section titled “spend_type”"BUDGET_PROVISIONED_CARDS_ONLY" | "NON_BUDGET_PROVISIONED_CARDS_ALLOWED"
start_date?
Section titled “start_date?”string | null
Format: date
Description
The UTC date when the Spend Limit should start counting.
options?
Section titled “options?”Returns
Section titled “Returns”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
Parameters
Section titled “Parameters”string
options?
Section titled “options?”Returns
Section titled “Returns”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()
Section titled “list()”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.
Parameters
Section titled “Parameters”query?
Section titled “query?”cursor?
Section titled “cursor?”string | null
limit?
Section titled “limit?”number | null
options?
Section titled “options?”Returns
Section titled “Returns”PagePromise<{ items: object[]; next_cursor?: string | null; }>
update()
Section titled “update()”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.
Parameters
Section titled “Parameters”string
description?
Section titled “description?”string | null
Description
Description of what the Spend Limit is used for.
end_date?
Section titled “end_date?”string | null
Format: date
Description
The UTC date when the Spend Limit should stop counting.
limit?
Section titled “limit?”{ amount: number; currency: string | null; } | null
limit_type?
Section titled “limit_type?”"HARD" | "SOFT" | null
limit_visibility?
Section titled “limit_visibility?”"PRIVATE" | "SHARED" | null
member_user_ids?
Section titled “member_user_ids?”string[] | null
Description
User IDs of the members of the Spend Limit.
string | null
Description
Name for the Spend Limit.
owner_user_ids?
Section titled “owner_user_ids?”string[] | null
Description
User IDs of the owners of the Spend Limit.
period_type?
Section titled “period_type?”"WEEKLY" | "MONTHLY" | "QUARTERLY" | "YEARLY" | "ONE_TIME" | null
spend_type?
Section titled “spend_type?”"BUDGET_PROVISIONED_CARDS_ONLY" | "NON_BUDGET_PROVISIONED_CARDS_ALLOWED" | null
start_date?
Section titled “start_date?”string | null
Format: date
Description
The UTC date when the Spend Limit should start counting.
options?
Section titled “options?”Returns
Section titled “Returns”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; }>