Skip to content

Order methods: cancel, confirm, deliver, dispute

The Order Verbs cancel, confirm, deliver, dispute as typed SDK methods, with inputs, result, refusals and an example.

Reference for Order, one group of Order methods.

Order.cancel

Cancel ends an Order before fulfillment and returns any payment in full. Verb page.

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

Emits Order.canceled.

Inputs

InputTypeRequiredDescription
orderOrderrequiredThe unfulfilled Order.

Returns

OutputTypeRequiredDescription
orderOrderrequiredThe canceled Order.

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.
The record changed since it was read, so the write would overwrite a newer version.conflictRead the record again, then retry the write against its current state.None.
The record is not in a state that allows this Verb, so the call is refused.refusedRead the record, run the Verb that moves it to an allowed state, then retry.None.

Example

TypeScript
import { $ } from 'startup-builder'

const order = await $.Order.cancel({ order: 'order_dswDnxf2vt' })

Order.confirm

Confirm records the Customer’s sign-off on delivered work, which closes the Order and earns the Startup its fee. Verb page.

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

Emits Order.confirmed.

Inputs

InputTypeRequiredDescription
orderOrderrequiredThe delivered Order.
linesjsonThe lines confirmed; every delivered line when absent. Each confirmed line bills on its own.

Returns

OutputTypeRequiredDescription
orderOrderrequiredThe closed Order.

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.
The record is not in a state that allows this Verb, so the call is refused.refusedRead the record, run the Verb that moves it to an allowed state, then retry.None.

Example

TypeScript
import { $ } from 'startup-builder'

const order = await $.Order.confirm({ order: 'order_dswDnxf2vt' })

Order.deliver

Deliver hands the finished work of a Service Order to its Customer and opens the acceptance window. Verb page.

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

Emits Order.delivered.

Inputs

InputTypeRequiredDescription
orderOrderrequiredThe Order whose work is done.
workjsonrequiredThe deliverable and its evidence.
linesjsonThe lines delivered; every open line when absent. Each delivered line opens its own acceptance window.

Returns

OutputTypeRequiredDescription
orderOrderrequiredThe delivered Order.

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.
The record is not in a state that allows this Verb, so the call is refused.refusedRead the record, run the Verb that moves it to an allowed state, then retry.None.

Example

TypeScript
import { $ } from 'startup-builder'

const order = await $.Order.deliver({ order: 'order_dswDnxf2vt', work: {} })

Order.dispute

Dispute contests a delivered Order under its Outcome Contract and starts the remedy the contract names. Verb page.

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

Emits Order.disputed.

Inputs

InputTypeRequiredDescription
orderOrderrequiredThe delivered Order.
reasontextrequiredWhat falls short of the promise.
linesjsonThe lines disputed; every delivered line when absent. Undisputed lines stay open to confirm.

Returns

OutputTypeRequiredDescription
orderOrderrequiredThe disputed Order.

Refuses when

CheckErrorFixThen call
The input does not match the schema of the operation.invalid-inputRead the schema of the operation, then send every required field with the right type.None.
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.
The record is not in a state that allows this Verb, so the call is refused.refusedRead the record, run the Verb that moves it to an allowed state, then retry.None.

Example

TypeScript
import { $ } from 'startup-builder'

const order = await $.Order.dispute({ order: 'order_dswDnxf2vt', reason: 'Example reason' })