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.
interface ProductVerbs {
update(input: ProductUpdateInput, options?: SB.CallOptions): SB.Call<Product>
}Emits Product.updated.
Inputs
| Input | Type | Required | Description |
|---|---|---|---|
id | string | required | The id of the Product. |
name | string | The name of the Product. | |
promise | text | What the Customer can rely on. |
Returns
| Output | Type | Required | Description |
|---|---|---|---|
product | Product | required | The Product. |
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 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.
interface ProductVerbs {
delete(input: ProductDeleteInput, options?: SB.CallOptions): SB.Call<Product>
}Emits Product.deleted.
Inputs
| Input | Type | Required | Description |
|---|---|---|---|
id | string | required | The id of the Product. |
Returns
| Output | Type | Required | Description |
|---|---|---|---|
product | Product | required | The Product. |
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 product = await $.Product.delete({ id: 'prod_MJmgS5dysq' })