Skip to main content
POST
Create a work order

Autorisations

X-API-KEY
string
header
requis
OW-KEY
string
header
requis

OpenWrench shared secret. Required on every request alongside X-API-KEY; issued together with your API key.

Corps

application/json

Work-order create payload (verified against the shared work-order constructor). createdBy, supplierFacilityId, buyerFacilityId and buyerCompanyId are always overwritten server-side from the API key and the location - caller-supplied values for them are ignored. Unknown fields are ignored.

title
string
requis

REQUIRED

locationId
integer<int64>
requis

REQUIRED. The buyer location the work order is for; also determines the server-set buyerFacilityId and buyerCompanyId.

problemTypeId
integer

Optional; when omitted the first leaf problem type of the location's buyer company is used. Must reference an existing problem type.

woPriorityId
integer

Optional; when omitted a default priority for the buyer company is chosen (preference order 3,4,5,2,1, following linkedTo mappings).

woNumber
string
poNumber
string
buyerProjectIds
integer<int64>[]
isPM
boolean
isCapex
boolean
isStale
boolean
isSupplierInitiated
boolean

Set to true by the server for third-party supplier keys; a value in the body is ignored there. Keys of a buyer's internal service team and paying suppliers creating for a client they manage keep the value they send.

isCustomerInitiated
boolean
isWarranty
boolean
status
string

Ignored for third-party supplier keys: the server seeds SupplierInitiatedPendingApproval and the buyer's approval configuration resolves the initial status. Honoured only for keys of a buyer's internal service team and for paying suppliers creating at a location of a client they manage; must be a valid work-order status name (invalid names are rejected), and when omitted the initial status is derived from the buyer company's configuration.

description
string
assetId
integer<int64>

Must reference an existing asset; its areaId is inherited when areaId is not given

subAssetIds
integer<int64>[]
isAssetDown
boolean

Default false

areaId
integer<int64>
workCategoryId
integer
needApproval
boolean

NOTE: the key is needApproval (no 's')

requiresSignature
boolean
approvalRequiredFrom
object[]

ApprovalRequirement objects

images
string[]
parts
integer<int64>[]

Part ids (mapped to the work order's partIds)

skipSupplier
boolean
contractorDetails
object

ContractorDetails object

assignmentChanges
object[]

AssignmentChange objects

scheduledAt
string<date-time>

ISO 8601 date-time

estimatedCompletionDate
string<date-time>

ISO 8601 date-time

dueDate
string<date-time>

ISO 8601 date-time

price
number
currencyId
string
terms
string
nte
number
nteInLocationCurrency
number
locationCurrencyId
string
currencyExchangeRateLocationToSupplier
number
currencyExchangeRateBuyerToLocation
number
statusChanges
object[]

StatusChange objects

submittedByName
string
hasBuyerArchived
boolean
hasSupplierArchived
boolean
buyerAttachments
object[]
supplierAttachments
object[]
fromRequestPortal
boolean
fromClientPortal
boolean
forcePendingStatusOnCreateFromPortal
boolean
resolutionTypeId
integer
plannedMaintenanceScheduleId
integer<int64>
taskCompletionMandatory
boolean
isPrivate
boolean
walkThroughId
integer<int64>

Must be set together with siteSurveyTaskTitleId

siteSurveyTaskTitleId
string

Must be set together with walkThroughId

includeWalkthroughTaskList
boolean
supplierPrimaryContactEmail
string

Réponse

Successful response

type
string
requis

Entity type label, e.g. "WorkOrder". Endpoints that derive it via Scala reflection (most generic list/get endpoints) may return the fully qualified server class name instead (e.g. "models.workorder.WorkOrder"); treat this field as informational.

data
object
requis

Work order (abridged - the full model has 150+ fields including hydrated location/asset/facility/approval-hierarchy objects). For third-party suppliers (keys not belonging to an internal service team) responses are masked: buyer-private fields are removed/blanked by the API masking layer.

status
enum<string>
requis

"ok" on success

Options disponibles:
ok