Create Work Order
Creates a new work order.
URLs
Environment | Method | URL |
---|---|---|
Sandbox | https://api-sandbox.fndev.net/api/rest/v2/workorders | |
Production | https://api.fieldnation.com/api/rest/v2/workorders |
Path Parameters
Not applicable.
Query Parameters
Parameter | Type | Example | Notes |
---|---|---|---|
access_token | string | abc123defg459hijk786lmn45 | Required. |
Body Parameters
Body parameters can vary depending on your work order options. If you use a work order template, some of these parameters will be automatically set.
Create Work Order Examples
Here are some JSON examples to help you get started.
Tip: Refer to Work Order Locations, Schedules, and Pay Rates for additional options and examples.
This example uses a Custom Location, where the provider should Arrive at a specific date and time. The pay rate is Fixed Pay. It does not include a work order template.
{
"title":"Fix Copier on 2nd Floor",
"type_of_work":{
"id":76
},
"manager": {
"id": 776
},
"description":{
"html":"<p>copier is displaying error code <b>206</b>.</p>"
},
"confidential":{
"html":""
},
"location":{
"mode":"custom",
"display_name":"ABC Corp",
"address1":"123 Main Street",
"address2":"Building 4C",
"city":"Phoenix",
"state":"AZ",
"zip":"85001",
"country":"US",
"type":{
"id":1
}
},
"schedule":{
"service_window":{
"mode":"exact",
"start":{
"utc":"2018-11-07 13:00:00"
}
}
},
"pay":{
"type":"fixed",
"base":{
"amount":400,
"units":1
}
},
"template":null
}
This example includes a client id and a project id, where the provider should Complete work between specific hours. The pay rate is Per Hour Pay.
{
"title":"Fix Copier on 2nd Floor",
"type_of_work":{
"id":76
},
"client":{
"id": 188
},
"project":{
"id":239
},
"description":{
"html":"<p>copier is displaying error code <b>206</b>.</p>"
},
"confidential":{
"html":""
},
"location":{
"mode":"custom",
"display_name":"ABC Corp",
"address1":"123 Main Street",
"address2":"Building 4C",
"city":"Phoenix",
"state":"AZ",
"zip":"85001",
"country":"US",
"type":{
"id":1
}
},
"schedule":{
"service_window":{
"mode":"hours",
"start":{
"utc":"2018-11-07 13:00:00"
},
"end":{
"utc":"2018-11-08 15:00:00"
}
}
},
"pay":{
"type":"hourly",
"base":{
"amount":25,
"units":4
}
},
"template":null
}
This example uses a work order template with a prefilled client, project, type of work, and pay rate. The provider should Complete work anytime over a date range. Refer to Get Templates to return a list of your work order template ids.
{
"title":"Fix Copier on 2nd Floor",
"template":{
"id":68
},
"location":{
"mode":"custom",
"display_name":"ABC Corp",
"address1":"123 Main Street",
"address2":"Building 4C",
"city":"Phoenix",
"state":"AZ",
"zip":"85001",
"country":"US",
"type":{
"id":1
}
},
"schedule":{
"service_window":{
"mode":"between",
"start":{
"utc":"2018-11-06 13:00:00"
},
"end":{
"utc":"2018-11-06 22:00:00"
}
}
}
}
This example adds a bonus and penalty to the pay object. Refer to Bonuses and Penalties for more information.
{
"title":"ATM Repair Bonus/Penalty",
"type_of_work":{
"id":76
},
"description":{
"html":"monthly ATM maintenance."
},
"location":{
"mode":"custom",
"display_name":"ABC Corp",
"address1":"123 Main Street",
"address2":"Building 4C",
"city":"Phoenix",
"state":"AZ",
"zip":"85001",
"country":"US",
"type":{
"id":1
}
},
"schedule":{
"service_window":{
"mode":"exact",
"start":{
"utc":"2019-1-07 13:00:00"
}
}
},
"pay":{
"type":"fixed",
"base":{
"amount":400,
"units":1
},
"bonuses":{
"results":[
{
"id":3
}
]
},
"penalties":{
"results":[
{
"id":6
}
]
}
}
}
You can send custom field values in a custom_fields > results > results array. All other custom field parameters are read-only. Refer to Custom Fields for more information.
"custom_fields":{
"results":[
{
"results":[
{
"id":129,
"value":"1001258"
}
]
}
]
}
You can send contacts in the results array. Refer to Contacts for additional role types and contact parameters.
"contacts":{
"results":[
{
"role":"Location Contact",
"name":"Site Contact",
"email":"sitecontact@email.com",
"phone":"4805551234"
},
{
"role":"Project manager",
"name":"Project Manager",
"email":"projectmgr@email.com",
"phone":"4805551234"
}
]
}
A new work order includes Set ETA, “Enter closeout notes,” “Check in,” and “Check out” tasks in the On Site group by default. You can send additional tasks in the results array. Refer to Tasks for more information.
Note: The tasks object returns a paginated list of results. When you create a new work order, this object returns only four tasks by default. For a complete list of tasks, you can Get Work Order by ID or Get Tasks by Work Order.
This example creates a task to Upload/take photo in the Post Work group.
"tasks":{
"results":[
{
"group":{
"id":"post"
},
"type":{
"id":6
},
"label":"finished work."
}
]
Response
Returns the Work Order Response. Refer to Work Orders for parameter details and examples.
Errors
Standard HTTP and OAuth error codes.Examples
Missing required parameter.
{
"message": "Parameter \"title\" is required and was not passed in request payload",
"trace": [],
"extra": []
}