Skip to content

Service methods: close, open, pause, setCapacity

The Service Verbs close, open, pause, setCapacity as typed SDK methods, with inputs, result, refusals and an example.

Service.openMode do
curl -X POST https://api.sb/catalogmend.com/services/service_Eq1ssq4AOW/open \
  -H "Authorization: Bearer $SB_TOKEN"
API referenceService.open
npx startup-builder do Service.open --data '{"service":"service_Eq1ssq4AOW"}'
CLI referenceService.open
{
  "name": "do",
  "arguments": {
    "code": "return await $.Service.open({ service: 'service_Eq1ssq4AOW' })"
  }
}
MCP referenceService.open
import { $ } from 'startup-builder'

const service = await $.Service.open({ service: 'service_Eq1ssq4AOW' })
SDK referenceService.open

Reference for Service, one group of Service methods.

Service.close

Close stops a Service taking new Orders for good, while every placed Order runs to its end. Verb page.

TypeScript
interface ServiceVerbs {
  close(input: ServiceCloseInput, options?: SB.CallOptions): SB.Call<Service>
}

Emits Service.closed.

Inputs

InputTypeRequiredDescription
serviceServicerequiredThe Service to close.
reasontextrequiredWhy it closes.

Returns

OutputTypeRequiredDescription
serviceServicerequiredThe closed Service.

Refuses when

CheckErrorFixThen call
The key is valid, but its scopes do not allow this operationforbiddenUse a key whose scopes cover the operation, or ask an owner of the namespace to grant them.None.
service is missing, or is not a serviceinvalid-inputSend service as a service, then call it again.None.
reason is missing, or is not a textinvalid-inputSend reason as a text, then call it again.None.
The Idempotency-Key was sent before with another operation or other inputidempotency-mismatchSend a new key for new input; reuse a key only to retry the same request.None.

Example

TypeScript
import { $ } from 'startup-builder'

const service = await $.Service.close({ service: 'service_Eq1ssq4AOW', reason: 'Example reason' }, { idempotencyKey: 'catalogmend-service-close-1' })

Service.open

Open starts a Service taking new Orders on every published Offer that sells it. Verb page.

TypeScript
interface ServiceVerbs {
  open(input: ServiceOpenInput, options?: SB.CallOptions): SB.Call<Service>
}

Emits Service.opened.

Inputs

InputTypeRequiredDescription
serviceServicerequiredThe Service to open.

Returns

OutputTypeRequiredDescription
serviceServicerequiredThe Service, now taking new Orders.

Refuses when

CheckErrorFixThen call
The key is valid, but its scopes do not allow this operationforbiddenUse a key whose scopes cover the operation, or ask an owner of the namespace to grant them.None.
service is missing, or is not a serviceinvalid-inputSend service as a service, then call it again.None.
The Idempotency-Key was sent before with another operation or other inputidempotency-mismatchSend a new key for new input; reuse a key only to retry the same request.None.

Example

TypeScript
import { $ } from 'startup-builder'

const service = await $.Service.open({ service: 'service_Eq1ssq4AOW' }, { idempotencyKey: 'catalogmend-service-open-1' })

Service.pause

Pause stops a Service taking new Orders until a stated time, while every placed Order runs to its end. Verb page.

TypeScript
interface ServiceVerbs {
  pause(input: ServicePauseInput, options?: SB.CallOptions): SB.Call<Service>
}

Emits Service.paused.

Inputs

InputTypeRequiredDescription
serviceServicerequiredThe Service to pause.
reasontextrequiredWhy it pauses, shown to buyers.
untildatetimeWhen it reopens on its own.

Returns

OutputTypeRequiredDescription
serviceServicerequiredThe paused Service.

Refuses when

CheckErrorFixThen call
The key is valid, but its scopes do not allow this operationforbiddenUse a key whose scopes cover the operation, or ask an owner of the namespace to grant them.None.
service is missing, or is not a serviceinvalid-inputSend service as a service, then call it again.None.
reason is missing, or is not a textinvalid-inputSend reason as a text, then call it again.None.
The Idempotency-Key was sent before with another operation or other inputidempotency-mismatchSend a new key for new input; reuse a key only to retry the same request.None.

Example

TypeScript
import { $ } from 'startup-builder'

const service = await $.Service.pause({ service: 'service_Eq1ssq4AOW', reason: 'Example reason' }, { idempotencyKey: 'catalogmend-service-pause-1' })

Service.setCapacity

SetCapacity sets the most work a Service holds in flight, in the unit its intake counts. Verb page.

TypeScript
interface ServiceVerbs {
  setCapacity(input: ServiceSetCapacityInput, options?: SB.CallOptions): SB.Call<Service>
}

Emits Service.capacitySet.

Inputs

InputTypeRequiredDescription
serviceServicerequiredThe Service.
capacityintegerrequiredThe most work in flight, in the intake’s unit, such as listings.

Returns

OutputTypeRequiredDescription
serviceServicerequiredThe Service with its new capacity.

Refuses when

CheckErrorFixThen call
The key is valid, but its scopes do not allow this operationforbiddenUse a key whose scopes cover the operation, or ask an owner of the namespace to grant them.None.
service is missing, or is not a serviceinvalid-inputSend service as a service, then call it again.None.
capacity is missing, or is not a integerinvalid-inputSend capacity as a integer, then call it again.None.
The Idempotency-Key was sent before with another operation or other inputidempotency-mismatchSend a new key for new input; reuse a key only to retry the same request.None.

Example

TypeScript
import { $ } from 'startup-builder'

const service = await $.Service.setCapacity({ service: 'service_Eq1ssq4AOW', capacity: 1 }, { idempotencyKey: 'catalogmend-service-set-capacity-1' })