Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

/workorder/create

This action creates a new work order for a property.

Request

FieldDescriptionRequired
valuesWork order field valuesYes

The values field must be a JSON object. The keys in this object must be a canonical work order field name. The value in this object depends on the type of the work order field and should be set as follows:

Work Order Field TypeValid values(s)
textText value
dateDate value. Accepted formats: MM/DD/YYYY, YYYY-MM-DD, YYYYMMDD
dropdownCanonical value from the options in the fields.CANONICAL_WO_FIELD object returned by /workorder/fields
arrayAn array of values. The work_items work order field have this type.

The following fields are always required in values:

Required FieldsDescriptionType
addressStreet namestring
cityCitystring
stateUS State Identifier (use /workorder/fields)number
zipZipcodestring
work_typeWork Type Identifier (use /workorder/fields)number
client_companyClient Company Identifier (use /workorder/fields)number
date_dueWork Order Date Duestring

The work_items work order field must be an array and each item in this array must be a JSON object with the following parameters:

Work Item FieldsDescriptionTypeRequired
idUnique identifier for the invoice line itemnumberYes, if creating a invoice line item
item_otherCustom line item stringstringYes, if creating a custom line item
qtyItem quantitynumberYes
priceItem pricenumberYes, if creating a custom line item
instructionsItem instructionsstringNo

If price is not provided for a invoice line item, it will be auto populated based on the invoice item pricing rules.

Example:

{
  "values": {
    "wo_number": "B847293838",
    "address": "16168 MAIN MARKET RD",
    "city": "BURTON",
    "state": 35,
    "zip": "44021",
    "work_type": 28813,
    "client_company": 12344,
    "date_due": "01/15/2021",
    "work_items": [{
      "id": 42931,
      "qty": 2,
      "price": 30,
      "instructions": "Some grass instructions"
    }, {
      "id": 42928,
      "qty": 3,
      "price": 10
    }]
  }
}
curl -H 'Content-Type: application/json' \
     -H 'Authorization: Bearer ACCESS_TOKEN' \
     -d '{"values":{"wo_number":"B847293838","address":"16168 MAIN MARKET RD","city":"BURTON","state":35,"zip":"44021","work_type":28813,"client_company":12344,"date_due":"01/15/2021","work_items":[{"id":42931,"qty":2,"price":30,"instructions":"Some grass instructions"},{"id":42928,"qty":3,"price":10}]}}' \
     https://ppw.web/svc/workorder/create

Response

FieldDescriptionType
report_idUnique identifier for the new work ordernumber
org_property_idUnique property identifiernumber

Example successful response:

{
  "report_id": 10640,
  "org_property_id": 217
}

Errors

Error TypeDescriptionStatus
values_requiredvalues parameter is invalid or not specified400
field_requiredA required work order field is not specified in values400
invalid_fieldA work order field specified in values is invalid400
invalid_dateThe value of a date work order field in values is invalid400
invalid_optionThe value of a dropdown work order field in values is invalid400
invalid_work_itemsThe one or more items in work_items is invalid400
duplicateA work order with the specified wo_number already exists400
stop_workStop work is set for the property. Cannot create work order.400
freq_controlsFrequency control error400