Skip to content

Product Template methods: update, delete

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

Reference for Product Template, one group of Product Template methods.

ProductTemplate.update

Changes the given properties of a Product Template. Verb page.

TypeScript
interface ProductTemplateVerbs {
  update(input: ProductTemplateUpdateInput, options?: SB.CallOptions): SB.Call<ProductTemplate>
}

Emits ProductTemplate.updated.

Inputs

InputTypeRequiredDescription
idstringrequiredThe id of the Product Template.
slugstringThe page path under /start/templates/products.
kindstringThe abstract Product: data, software, agent, or service.
supplystringWho supplies the work: digital, which is unlimited, or human, which is recruited and credentialed.
workerstringWho does the work: agents, humans, or agents-and-humans.
buyerstringWho buys: human, agent, or human-or-agent.
earningModelstringHow it earns: subscription, usage, commerce, marketplace, or directory.
assurancetextWhat the buyer can rely on, in one sentence.

Returns

OutputTypeRequiredDescription
productTemplateProduct TemplaterequiredThe Product Template.

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 productTemplate = await $.ProductTemplate.update({ id: 'ptpl_mLTPhHFQYD', slug: 'leaseline' })

ProductTemplate.delete

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

TypeScript
interface ProductTemplateVerbs {
  delete(input: ProductTemplateDeleteInput, options?: SB.CallOptions): SB.Call<ProductTemplate>
}

Emits ProductTemplate.deleted.

Inputs

InputTypeRequiredDescription
idstringrequiredThe id of the Product Template.

Returns

OutputTypeRequiredDescription
productTemplateProduct TemplaterequiredThe Product Template.

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 productTemplate = await $.ProductTemplate.delete({ id: 'ptpl_mLTPhHFQYD' })