Skip to content

Order methods: revise, screen, start

The Order Verbs revise, screen, start as typed SDK methods, with inputs, result, refusals and an example.

Reference for Order, one group of Order methods.

Order.revise

Revise sends delivered lines back for one counted revision, with the changes the Customer asks for. Verb page.

TypeScript
interface OrderVerbs {
  revise(input: OrderReviseInput, options?: SB.CallOptions): SB.Call<Order>
}

Emits Order.revised.

Inputs

InputTypeRequiredDescription
orderOrderrequiredThe delivered Order.
linesjsonThe lines sent back; every delivered line when absent.
changestextrequiredWhat the Customer wants changed, such as a shorter summary.

Returns

OutputTypeRequiredDescription
orderOrderrequiredThe Order, its fulfillment set to revising.

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 order = await $.Order.revise({ order: 'order_dswDnxf2vt', changes: 'Example changes' })

Order.screen

Screen scores an Order’s payment before it is charged and allows, authenticates, holds or blocks it by the Startup’s risk Policy. Verb page.

TypeScript
interface OrderVerbs {
  screen(input: OrderScreenInput, options?: SB.CallOptions): SB.Call<OrderScreenOutput>
}

Emits Order.screened.

Inputs

InputTypeRequiredDescription
orderOrderrequiredThe placed Order whose payment is screened.

Returns

OutputTypeRequiredDescription
outcomestringrequiredallow charges, authenticate asks the buyer to confirm with their card issuer, review waits for an Approval, block cancels.
risknumberrequiredThe payment’s risk score from 0 to 99, as Stripe scored it.
rulestringThe risk Policy rule that decided the outcome, when one did.
orderOrderrequiredThe Order screened.

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 { outcome, risk, rule, order } = await $.Order.screen({ order: 'order_dswDnxf2vt' })

Order.start

Start checks a Service Order’s inputs against its brief, then moves it from intake to working and starts its deadline. Verb page.

TypeScript
interface OrderVerbs {
  start(input: OrderStartInput, options?: SB.CallOptions): SB.Call<Order>
}

Emits Order.started.

Inputs

InputTypeRequiredDescription
orderOrderrequiredThe Order in intake.
receivedjsonrequiredWhat the Customer supplied, measured as the brief measures it, such as a 79,400-word manuscript.

Returns

OutputTypeRequiredDescription
orderOrderrequiredThe Order, its fulfillment set to working, or still intake while a Question is open.

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 order = await $.Order.start({ order: 'order_dswDnxf2vt', received: {} })