Skip to content

Budget methods: update, delete

The Budget Verbs update, delete as typed SDK methods, with inputs, result, refusals and an example.

Reference for Budget, one group of Budget methods.

Budget.update

Changes the given properties of a Budget. Verb page.

TypeScript
interface BudgetVerbs {
  update(input: BudgetUpdateInput, options?: SB.CallOptions): SB.Call<Budget>
}

Emits Budget.updated.

Inputs

InputTypeRequiredDescription
idstringrequiredThe id of the Budget.
accountstringThe chart-of-accounts code it plans, such as expense.ads.
periodPeriodThe Period it plans.
amountmoneyThe amount set for the account in the Period.

Returns

OutputTypeRequiredDescription
budgetBudgetrequiredThe Budget.

Refuses when

CheckErrorFixThen call
The key is valid, but its scopes do not allow this operation.forbiddenUse a key whose scopes cover the operation, or ask an owner of the namespace to grant them.None.

Example

TypeScript
import { $ } from 'startup-builder'

const budget = await $.Budget.update({ id: 'budget_qnCdsFGLVN', account: 'expense.ads' })

Budget.delete

Deletes a Budget: a soft delete that keeps its history, undone by Thing.restore. Verb page.

TypeScript
interface BudgetVerbs {
  delete(input: BudgetDeleteInput, options?: SB.CallOptions): SB.Call<Budget>
}

Emits Budget.deleted.

Inputs

InputTypeRequiredDescription
idstringrequiredThe id of the Budget.

Returns

OutputTypeRequiredDescription
budgetBudgetrequiredThe Budget.

Refuses when

CheckErrorFixThen call
The key is valid, but its scopes do not allow this operation.forbiddenUse a key whose scopes cover the operation, or ask an owner of the namespace to grant them.None.

Example

TypeScript
import { $ } from 'startup-builder'

const budget = await $.Budget.delete({ id: 'budget_qnCdsFGLVN' })