Skip to content
SDKProductWhat you sellProduct

Product methods: update, delete

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

Reference for Product, one group of Product methods.

Product.update

Changes the given properties of a Product. Verb page.

TypeScript
interface ProductVerbs {
  update(input: ProductUpdateInput, options?: SB.CallOptions): SB.Call<Product>
}

Emits Product.updated.

Inputs

InputTypeRequiredDescription
idstringrequiredThe id of the Product.
namestringThe name of the Product.
promisetextWhat the Customer can rely on.

Returns

OutputTypeRequiredDescription
productProductrequiredThe Product.

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 product = await $.Product.update({ id: 'prod_MJmgS5dysq', name: 'Leaseline' })

Product.delete

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

TypeScript
interface ProductVerbs {
  delete(input: ProductDeleteInput, options?: SB.CallOptions): SB.Call<Product>
}

Emits Product.deleted.

Inputs

InputTypeRequiredDescription
idstringrequiredThe id of the Product.

Returns

OutputTypeRequiredDescription
productProductrequiredThe Product.

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 product = await $.Product.delete({ id: 'prod_MJmgS5dysq' })