Skip to main content
PUT
Update order type

Authorizations

Authorization
string
header
required

Use a valid Bearer token to authenticate.

Path Parameters

id
string
required

Unique identifier for the order type that generated by system. Example: 6710a2f4c1d2e3f4a5b6c7d8

Body

application/json
name
string
required

Name of the order type, unique in the organization. Max 100 characters. Example: Express Delivery

code
string
required

Short code, 1-10 uppercase letters or digits, unique in the organization. Cannot change once the order type has orders. Example: EXP

draftRevision
integer
required

The draftRevision you last read. A stale value is refused with 409. Example: 3

fields
object[]
required

List of order fields. The first field is the order number: it must be type text or number, and it is always required and unique within the order type. Each field: id (letters, digits, _, -), title, type, and optional description, required, show, unique, default, archived. type is one of text, number, option, date, dateTime, time, phoneNumber, geolocation, reference, lineItems, user, boolean. Type-specific keys: maxLength (text, phoneNumber), min/max (number, date, dateTime, time), options (option, list of unique strings), reference (reference), columns (lineItems).

statuses
object[]
required

List of order statuses. Each status: id, label, category, order (integer), and optional color, publicLabel, viewAccess ({ "roles": [roleId] }, empty means every role). category is one of new, inProgress, completed. Exactly one status must be new and at least one must be completed before the order type can be published.

configuration
object
required

Order type configuration: cancelStatusId (a status of category completed used by Cancel order; null when cancelling is not allowed) and uniqueBy (derived from the first field on save).

orderSteps
object[]
required

The order steps graph, at most 200 steps. Every step has id (lowercase letters, digits and -, max 40 characters), type, title (max 80 characters), position ({ x, y }) and next (port name to list of step ids; not used on finishOrder). Step type:

  • trigger: event is onOrderCreated or onTaskFinished. For onTaskFinished also taskTypeId (the task type, flowId, whose finished tasks create orders), onlyIf, quantity (mode perTask or perRow) and mapping.
  • createTask: taskTypeId (task type, flowId), assignee (mode unassigned, user or field), hub (mode order or fixed), quantity (mode perOrder or perRow), taskData, saveToOrder, retry (maxAttempts 1-10).
  • condition: rules (max 20 rules, max 20 conditions each; operators eq, neq, gt, gte, lt, lte, contains, isEmpty). Each rule is a port rule:.
  • updateOrder: set (mapping rows) and status (mode fixed or map).
  • finishOrder: statusId.
  • callWebhook: request (url, method POST or PUT, headers, timeoutSec 1-30, body with mode order or template) and saveResponse. Ports success and failed. Secret header values are never returned (value: null, hasValue: true). Mapping rows (max 50) are { target, source }; a source is { "value": ... } or { "ref": "$..." }.
description
string
canvas
object

Optional editor layout: viewport ({ x, y, zoom }) and listOrder (list of step ids).

Response

Success

status
boolean

Status of response.

message
string

Message of API response.

data
object

New revision and the check report.