Skip to content

Referral methods: update, delete

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

Reference for Referral, one group of Referral methods.

Referral.update

Changes the given properties of a Referral. Verb page.

TypeScript
interface ReferralVerbs {
  update(input: ReferralUpdateInput, options?: SB.CallOptions): SB.Call<Referral>
}

Emits Referral.updated.

Inputs

InputTypeRequiredDescription
idstringrequiredThe id of the Referral.
rewardmoneyWhat the referrer earns.
rewardKindstringWhat the referrer earns: earlier access, or cash, which pays only after Live.

Returns

OutputTypeRequiredDescription
referralReferralrequiredThe Referral.

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 referral = await $.Referral.update({ id: 'referral_I89J7wngKt', reward: { amount: 29, currency: 'USD' } })

Referral.delete

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

TypeScript
interface ReferralVerbs {
  delete(input: ReferralDeleteInput, options?: SB.CallOptions): SB.Call<Referral>
}

Emits Referral.deleted.

Inputs

InputTypeRequiredDescription
idstringrequiredThe id of the Referral.

Returns

OutputTypeRequiredDescription
referralReferralrequiredThe Referral.

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 referral = await $.Referral.delete({ id: 'referral_I89J7wngKt' })