Demand Budget methods: update
The Demand Budget Verbs update as typed SDK methods, with inputs, result, refusals and an example.
Reference for Demand Budget, one group of Demand Budget methods.
DemandBudget.update
Changes the given properties of a Demand Budget. Verb page.
interface DemandBudgetVerbs {
update(input: DemandBudgetUpdateInput, options?: SB.CallOptions): SB.Call<DemandBudget>
}Emits DemandBudget.updated.
Inputs
| Input | Type | Required | Description |
|---|---|---|---|
id | string | required | The id of the Demand Budget. |
amount | money | The monthly spend it funds; zero is the default. | |
tier | string | One of $0, $100, $1k, $10k or $100k: the highest tier at or below the amount, whose Play mix it buys. | |
target | string | The Metric value the spend must reach, such as cost per first Order under $40. | |
stopRule | string | The reading that closes the budget, such as acquisition cost above margin for two weeks. | |
until | date | The last day the budget runs before its Decision is read. |
Returns
| Output | Type | Required | Description |
|---|---|---|---|
demandBudget | Demand Budget | required | The Demand Budget. |
Refuses when
| Check | Error | Fix | Then call |
|---|---|---|---|
| The key is valid, but its scopes do not allow this operation. | forbidden | Use a key whose scopes cover the operation, or ask an owner of the namespace to grant them. | None. |
Example
import { $ } from 'startup-builder'
const demandBudget = await $.DemandBudget.update({ id: 'demand_zQZUG08LwY', amount: { amount: 29, currency: 'USD' } })