> For the complete documentation index, see [llms.txt](https://knowledge.out-smart.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://knowledge.out-smart.com/openapi/work-orders.md).

# Work Orders

## Post workorders

> This api is used to post one or more workorders to WorkorderApp.  \
> A workorder can contain the following data:\
> \
> \| Parameter | Detail | Required | Type (size) |\
> \| --- | --- | --- | --- |\
> \| WorkorderNo | Unique number from ERP/CRM | Yes | Varchar (255) |\
> \| ProjectNr | Internal Project number | No | Varchar (255) |\
> \| ExternProjectNr | External Project number | No | Varchar (255) |\
> \| CustomerName | Customer name | Yes | Varchar (255) |\
> \| CustomerDebtorNr | Customer Debtor number | Yes | Varchar (255) |\
> \| CustomerStreet | Customer street | Yes | Varchar (255) |\
> \| CustomerStreetNo | Customer street number | No | Varchar (255) |\
> \| CustomerEmail | Customer Email | No | Varchar (255) |\
> \| CustomerZIP | Customer zip code | Yes | Varchar (255) |\
> \| CustomerCity | Customer city | Yes | Varchar (255) |\
> \| CustomerContactPerson | Customer contact person | Yes | Varchar (255) |\
> \| CustomerPhone | Customer phone number | No | Varchar (255) |\
> \| CustomerRemark | Customer remark | No | Text (64kb) |\
> \| CustomerLatitude | Latitude of work location, used for navigation and to display on maps. | No | Float(10,6) |\
> \| CustomerLongitude | Longitude of work location, used for navigation and to display on maps. | No | Float(10,6) |\
> \| CustomerNameInvoice | Invoice customer name | Yes | Varchar (255) |\
> \| CustomerDebtorNrInvoice | Invoice customer debtor number | Yes | Varchar (255) |\
> \| CustomerStreetInvoice | Invoice customer street name | Yes | Varchar (255) |\
> \| CustomerStreetNoInvoice | Invoice customer street number | No | Varchar (255) |\
> \| CustomerEmailInvoice | Invoice customer email | No | Varchar (255) |\
> \| CustomerZIPInvoice | Invoice customer zip code | Yes | Varchar (255) |\
> \| CustomerCityInvoice | Invoice customer city | Yes | Varchar (255) |\
> \| CustomerContactPersonInvoice | Invoice customer contact person | Yes | Varchar (255) |\
> \| CustomerPhoneInvoice | Invoice customer phone number | No | Varchar (255) |\
> \| CustomerRemarkInvoice | Invoice customer remark | No | Text (64kb) |\
> \| TypeOfWork | Installatie, Garantie, Levering, Onderhoud, Project, Regie, Reparatie, Service, Storing, Verkoop, Verhuur | Yes | Varchar (255) |\
> \| WorkDescription | Work description of the workorder. Visible for customer when signing and when receiving the PDF. | No | Text (64kb) |\
> \| InternalWorkDescription | Internal work description of the workorder. Only visible for the employee | No | Text (64kb) |\
> \| PaymentMethod | niet van toepassing, op rekening, contact voldaan, pin betaling, conform offerte | Yes | Varchar (255) |\
> \| EmployeeNr | Employee Number | No | Varchar (255) |\
> \| WorkDate | Scheduled date for work (d-m-Y) | No | Varchar (255) |\
> \| WorkTime | Scheduled time for work (H:i) | No | Varchar (255) |\
> \| WorkEndDate | Scheduled end date for work (d-m-Y) | No | Varchar (255) |\
> \| WorkEndTime | Scheduled end time for work (H:i) | No | Varchar (255) |\
> \| WorkDeadline | Scheduled deadline for the workorder. | No | Varchar (255) |\
> \| WorkDuration | Duration of the workorder (in minutes). Used to fill WorkEndDate and WorkEndTime based on WorkDate and WorkTime. | No | Integer |\
> \| WorkStatus | Internal work status code. Can be added through status API. | No | Varchar (255) |\
> \| PickupPlanning | Indication if the work order should be added to batch to be picked up. Value should be 0 or 1. | No | Integer |\
> \| WebPlanning | Indication if webplanning is enabled for this order. | No | Integer |\
> \| CpnCode | Contact person code | No | Varchar (255) |\
> \| AdrCode | Address code | No | Varchar (255) |\
> \| ShortWorkDescription | Short work description. For example 1 line to show in an overview | No | Varchar (255) |\
> \| Comment | Additional field for the employee to leave their comment | No | Varchar (255) |\
> \| ErrorCode | Selected code as added in the errors API | No | Varchar (255) |\
> \| ErrorMessage | Message corresponding to the selected Error, can be changed by the employee | No | Varchar (255) |\
> \| SolutionCode | Selected code as added in the solutions API | No | Varchar (255) |\
> \| SolutionMessage | Message corresponding to the selected Solution, can be changed by the employee | No | Varchar (255) |\
> \| PriorityCode | Selected code as added in the priorities API | No | Varchar (255) |\
> \| PriorityMessage | Message corresponding to the selected Priority, can be changed by the employee | No | Varchar (255) |\
> \| MinimumHours | Minimum amount of hours that the customer should sign for. For example: The customer should always sign for 2 hours. If the employee only registers 25 minutes the customer still gets to see 2 hours. | No | Decimal (7,2) |\
> \| RoundingAmount | Amount of minutes that the total time should be rounded to. For exammple: Your company only works with amounts of 30 minutes. If the user only registers 40 minutes the customer will have to sign for 60 minutes. | No | Varchar (255) |\
> \| Attachments | An array containing multiple files. See specification below. | No | Array |\
> \| Materials | An array containing material rows. See specification below. | No | Array |\
> \| Workperiods | An array containing workperiod rows. See specification below. | No | Array |\
> \| Forms | Array of forms. Each row contains Name, Data and ObjectCode | No | Array |\
> \| Employees | Array of employee numbers. | No | Array |\
> \| WorkObjects | Array of objects codes. | No | Array |\
> \
> Attachments specification\
> \
> \| Parameter | Detail | Required | Type (size) |\
> \| --- | --- | --- | --- |\
> \| File | URL of the attachment file. This has to be an existing file. The file is saved on our server. | No | Varchar (255) |\
> \| Data | Base64 encoded file data. | No | Base64 |\
> \| FileName | Filename of the Base64 encoded data. | No | Varchar (255) |\
> \
> An attachment can be added by providing a valid URL or by providing Base64 encoded data and filename.  \
> Material specification\
> \
> \| Parameter | Detail | Required | Type |\
> \| --- | --- | --- | --- |\
> \| MaterialCode | Article number, code or barcode of this material. Example: A786878 | Yes | Varchar (255) |\
> \| MaterialNr | Amount of this material used. Example: 1 | Yes | Decimal |\
> \| MaterialPrice | Price of this material. Example: 0,00 | Yes | Decimal |\
> \| MaterialName | Material name and/or description. Example: Kleinmateriaal | Yes | Varchar (255) |\
> \| MaterialUnit | Unit of this material. Example: M2 | No | Varchar (255) |\
> \| MaterialType | User defined material type | No | Varchar (255) |\
> \| MaterialFreeField1 | User defined field 1 | No | Varchar (255) |\
> \| MaterialFreeField2 | User defined field 2 | No | Varchar (255) |\
> \| MaterialFreeField3 | User defined field 3 | No | Varchar (255) |\
> \| MaterialFreeField4 | User defined field 4 | No | Varchar (255) |\
> \| MaterialFreeField5 | User defined field 5 | No | Varchar (255) |\
> \
> Workperiod specification\
> \
> \| Parameter | Detail | Required | Type |\
> \| --- | --- | --- | --- |\
> \| WorkDate | Date specified in d-m-Y | Yes | Varchar (255) |\
> \| BeginTime | Time specified in H:i | Yes | Varchar (255) |\
> \| EndTime | Time specified in H:i | Yes | Varchar (255) |\
> \| Break | Break time in minutes | No | Int (11) |\
> \| TotalTime | Sum of EndTime - BeginTime - Break formatted in H:i | Yes | Varchar (255) |\
> \| Travel | Travel distance | No | Int (11) |\
> \| WorkRemark | Work remark | No | Text |\
> \| HourType | Hour type code | No | Varchar (55) |\
> \| EmployeeNr | Employee nunber | No | Varchar (55) |\
> \
> Example array:\
> \
> \`\`\` json\
> "Workperiods": \[\
> &#x20;   {\
> &#x20;       "BeginTime": "08:30",\
> &#x20;       "TotalTime": "03:45",\
> &#x20;       "WorkRemark": "",\
> &#x20;       "WorkDate": "26-09-2013",\
> &#x20;       "EndTime": "12:15",\
> &#x20;       "Travel": "1",\
> &#x20;       "EmployeeNr":"11",\
> &#x20;       "HourType":"001"\
> &#x20;   }\
> ] \
> \
> \`\`\`\
> \
> Forms specification\
> \
> \| Parameter | Detail | Required | Type |\
> \| --- | --- | --- | --- |\
> \| Name | Name of the form. Will be visible to employee and used to search for data. | Yes | Varchar (255) |\
> \| Data | JSON data of the Form elements. See forms API for description. When this is empty we will use the name to lookup a predefined form. | No | Text (64kb) |\
> \| ObjectCode | Object connected to the form. We will search our list of object for the corresponding object. | No | Varchar (255) |\
> \
> \*\*Freefields\*\*\
> \
> Additional freefields can be added to the workorder data. Freefield data can be supplied bij adding a \`FreeFields\` JSON object with the workorder json data. Freefields will only be added to the results when declared, use the \[Freefields]\(<https://documenter.getpostman.com/view/3100119/UVRDG5v7#a4d1b560-dd2b-4936-9ffe-80aee3514507>) endpoint to see which fields have been set. Freefields are numbered 1-50.

````json
{"openapi":"3.1.0","info":{"title":"OpenApi","version":"1.0.0"},"servers":[{"url":"{{api_url}}"},{"url":"https://www.werkbonapp.nl"}],"security":[{"BearerAuth":[]}],"components":{"securitySchemes":{"BearerAuth":{"type":"http","scheme":"bearer"}}},"paths":{"/PostWorkorders/":{"post":{"summary":"Post workorders","parameters":[{"name":"token","in":"query","schema":{"type":"string"}},{"name":"software_token","in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"Response_200"}},"tags":["Work Orders"],"description":"This api is used to post one or more workorders to WorkorderApp.  \nA workorder can contain the following data:\n\n| Parameter | Detail | Required | Type (size) |\n| --- | --- | --- | --- |\n| WorkorderNo | Unique number from ERP/CRM | Yes | Varchar (255) |\n| ProjectNr | Internal Project number | No | Varchar (255) |\n| ExternProjectNr | External Project number | No | Varchar (255) |\n| CustomerName | Customer name | Yes | Varchar (255) |\n| CustomerDebtorNr | Customer Debtor number | Yes | Varchar (255) |\n| CustomerStreet | Customer street | Yes | Varchar (255) |\n| CustomerStreetNo | Customer street number | No | Varchar (255) |\n| CustomerEmail | Customer Email | No | Varchar (255) |\n| CustomerZIP | Customer zip code | Yes | Varchar (255) |\n| CustomerCity | Customer city | Yes | Varchar (255) |\n| CustomerContactPerson | Customer contact person | Yes | Varchar (255) |\n| CustomerPhone | Customer phone number | No | Varchar (255) |\n| CustomerRemark | Customer remark | No | Text (64kb) |\n| CustomerLatitude | Latitude of work location, used for navigation and to display on maps. | No | Float(10,6) |\n| CustomerLongitude | Longitude of work location, used for navigation and to display on maps. | No | Float(10,6) |\n| CustomerNameInvoice | Invoice customer name | Yes | Varchar (255) |\n| CustomerDebtorNrInvoice | Invoice customer debtor number | Yes | Varchar (255) |\n| CustomerStreetInvoice | Invoice customer street name | Yes | Varchar (255) |\n| CustomerStreetNoInvoice | Invoice customer street number | No | Varchar (255) |\n| CustomerEmailInvoice | Invoice customer email | No | Varchar (255) |\n| CustomerZIPInvoice | Invoice customer zip code | Yes | Varchar (255) |\n| CustomerCityInvoice | Invoice customer city | Yes | Varchar (255) |\n| CustomerContactPersonInvoice | Invoice customer contact person | Yes | Varchar (255) |\n| CustomerPhoneInvoice | Invoice customer phone number | No | Varchar (255) |\n| CustomerRemarkInvoice | Invoice customer remark | No | Text (64kb) |\n| TypeOfWork | Installatie, Garantie, Levering, Onderhoud, Project, Regie, Reparatie, Service, Storing, Verkoop, Verhuur | Yes | Varchar (255) |\n| WorkDescription | Work description of the workorder. Visible for customer when signing and when receiving the PDF. | No | Text (64kb) |\n| InternalWorkDescription | Internal work description of the workorder. Only visible for the employee | No | Text (64kb) |\n| PaymentMethod | niet van toepassing, op rekening, contact voldaan, pin betaling, conform offerte | Yes | Varchar (255) |\n| EmployeeNr | Employee Number | No | Varchar (255) |\n| WorkDate | Scheduled date for work (d-m-Y) | No | Varchar (255) |\n| WorkTime | Scheduled time for work (H:i) | No | Varchar (255) |\n| WorkEndDate | Scheduled end date for work (d-m-Y) | No | Varchar (255) |\n| WorkEndTime | Scheduled end time for work (H:i) | No | Varchar (255) |\n| WorkDeadline | Scheduled deadline for the workorder. | No | Varchar (255) |\n| WorkDuration | Duration of the workorder (in minutes). Used to fill WorkEndDate and WorkEndTime based on WorkDate and WorkTime. | No | Integer |\n| WorkStatus | Internal work status code. Can be added through status API. | No | Varchar (255) |\n| PickupPlanning | Indication if the work order should be added to batch to be picked up. Value should be 0 or 1. | No | Integer |\n| WebPlanning | Indication if webplanning is enabled for this order. | No | Integer |\n| CpnCode | Contact person code | No | Varchar (255) |\n| AdrCode | Address code | No | Varchar (255) |\n| ShortWorkDescription | Short work description. For example 1 line to show in an overview | No | Varchar (255) |\n| Comment | Additional field for the employee to leave their comment | No | Varchar (255) |\n| ErrorCode | Selected code as added in the errors API | No | Varchar (255) |\n| ErrorMessage | Message corresponding to the selected Error, can be changed by the employee | No | Varchar (255) |\n| SolutionCode | Selected code as added in the solutions API | No | Varchar (255) |\n| SolutionMessage | Message corresponding to the selected Solution, can be changed by the employee | No | Varchar (255) |\n| PriorityCode | Selected code as added in the priorities API | No | Varchar (255) |\n| PriorityMessage | Message corresponding to the selected Priority, can be changed by the employee | No | Varchar (255) |\n| MinimumHours | Minimum amount of hours that the customer should sign for. For example: The customer should always sign for 2 hours. If the employee only registers 25 minutes the customer still gets to see 2 hours. | No | Decimal (7,2) |\n| RoundingAmount | Amount of minutes that the total time should be rounded to. For exammple: Your company only works with amounts of 30 minutes. If the user only registers 40 minutes the customer will have to sign for 60 minutes. | No | Varchar (255) |\n| Attachments | An array containing multiple files. See specification below. | No | Array |\n| Materials | An array containing material rows. See specification below. | No | Array |\n| Workperiods | An array containing workperiod rows. See specification below. | No | Array |\n| Forms | Array of forms. Each row contains Name, Data and ObjectCode | No | Array |\n| Employees | Array of employee numbers. | No | Array |\n| WorkObjects | Array of objects codes. | No | Array |\n\nAttachments specification\n\n| Parameter | Detail | Required | Type (size) |\n| --- | --- | --- | --- |\n| File | URL of the attachment file. This has to be an existing file. The file is saved on our server. | No | Varchar (255) |\n| Data | Base64 encoded file data. | No | Base64 |\n| FileName | Filename of the Base64 encoded data. | No | Varchar (255) |\n\nAn attachment can be added by providing a valid URL or by providing Base64 encoded data and filename.  \nMaterial specification\n\n| Parameter | Detail | Required | Type |\n| --- | --- | --- | --- |\n| MaterialCode | Article number, code or barcode of this material. Example: A786878 | Yes | Varchar (255) |\n| MaterialNr | Amount of this material used. Example: 1 | Yes | Decimal |\n| MaterialPrice | Price of this material. Example: 0,00 | Yes | Decimal |\n| MaterialName | Material name and/or description. Example: Kleinmateriaal | Yes | Varchar (255) |\n| MaterialUnit | Unit of this material. Example: M2 | No | Varchar (255) |\n| MaterialType | User defined material type | No | Varchar (255) |\n| MaterialFreeField1 | User defined field 1 | No | Varchar (255) |\n| MaterialFreeField2 | User defined field 2 | No | Varchar (255) |\n| MaterialFreeField3 | User defined field 3 | No | Varchar (255) |\n| MaterialFreeField4 | User defined field 4 | No | Varchar (255) |\n| MaterialFreeField5 | User defined field 5 | No | Varchar (255) |\n\nWorkperiod specification\n\n| Parameter | Detail | Required | Type |\n| --- | --- | --- | --- |\n| WorkDate | Date specified in d-m-Y | Yes | Varchar (255) |\n| BeginTime | Time specified in H:i | Yes | Varchar (255) |\n| EndTime | Time specified in H:i | Yes | Varchar (255) |\n| Break | Break time in minutes | No | Int (11) |\n| TotalTime | Sum of EndTime - BeginTime - Break formatted in H:i | Yes | Varchar (255) |\n| Travel | Travel distance | No | Int (11) |\n| WorkRemark | Work remark | No | Text |\n| HourType | Hour type code | No | Varchar (55) |\n| EmployeeNr | Employee nunber | No | Varchar (55) |\n\nExample array:\n\n``` json\n\"Workperiods\": [\n    {\n        \"BeginTime\": \"08:30\",\n        \"TotalTime\": \"03:45\",\n        \"WorkRemark\": \"\",\n        \"WorkDate\": \"26-09-2013\",\n        \"EndTime\": \"12:15\",\n        \"Travel\": \"1\",\n        \"EmployeeNr\":\"11\",\n        \"HourType\":\"001\"\n    }\n] \n\n```\n\nForms specification\n\n| Parameter | Detail | Required | Type |\n| --- | --- | --- | --- |\n| Name | Name of the form. Will be visible to employee and used to search for data. | Yes | Varchar (255) |\n| Data | JSON data of the Form elements. See forms API for description. When this is empty we will use the name to lookup a predefined form. | No | Text (64kb) |\n| ObjectCode | Object connected to the form. We will search our list of object for the corresponding object. | No | Varchar (255) |\n\n**Freefields**\n\nAdditional freefields can be added to the workorder data. Freefield data can be supplied bij adding a `FreeFields` JSON object with the workorder json data. Freefields will only be added to the results when declared, use the [Freefields](https://documenter.getpostman.com/view/3100119/UVRDG5v7#a4d1b560-dd2b-4936-9ffe-80aee3514507) endpoint to see which fields have been set. Freefields are numbered 1-50."}}}}
````

## UpdateWorkorder (Documents)

> This API is used to update an existing workorder. The row\_id of workorder\_no can be used to identify the specific workorder.

```json
{"openapi":"3.1.0","info":{"title":"OpenApi","version":"1.0.0"},"servers":[{"url":"{{api_url}}"},{"url":"https://www.werkbonapp.nl"}],"security":[{"BearerAuth":[]}],"components":{"securitySchemes":{"BearerAuth":{"type":"http","scheme":"bearer"}}},"paths":{"/UpdateWorkorder/":{"get":{"summary":"UpdateWorkorder (Documents)","parameters":[{"name":"token","in":"query","schema":{"type":"string"}},{"name":"software_token","in":"query","schema":{"type":"string"}},{"name":"row_id","in":"query","schema":{"type":"integer"}},{"name":"ClearDocuments","in":"query","schema":{"type":"boolean"}},{"name":"ProcessDocuments","in":"query","schema":{"type":"boolean"}}],"responses":{"200":{"description":"Response_200"}},"tags":["Work Orders"],"description":"This API is used to update an existing workorder. The row_id of workorder_no can be used to identify the specific workorder."}}}}
```

## Update an existing workorder

> This API is used to update an existing workorder. The row\_id of workorder\_no can be used to identify the specific workorder.

```json
{"openapi":"3.1.0","info":{"title":"OpenApi","version":"1.0.0"},"servers":[{"url":"{{api_url}}"},{"url":"https://www.werkbonapp.nl"}],"security":[{"BearerAuth":[]}],"components":{"securitySchemes":{"BearerAuth":{"type":"http","scheme":"bearer"}}},"paths":{"/UpdateWorkorder/":{"post":{"summary":"Update an existing workorder","parameters":[{"name":"token","in":"query","schema":{"type":"string"}},{"name":"software_token","in":"query","schema":{"type":"string"}},{"name":"row_id","in":"query","schema":{"type":"integer"}},{"name":"workorder_no","in":"query","schema":{"type":"string"}},{"name":"workdate","in":"query","schema":{"type":"string"}},{"name":"worktime","in":"query","schema":{"type":"string"}},{"name":"employee_nr","in":"query","schema":{"type":"integer"}},{"name":"workstatus","in":"query","schema":{"type":"integer"}}],"responses":{"200":{"description":"Response_200"}},"tags":["Work Orders"],"description":"This API is used to update an existing workorder. The row_id of workorder_no can be used to identify the specific workorder."}}}}
```

## Get workorder

> A workorder contains the following data:\
> \
> \| Parameter | Detail |\
> \| --- | --- |\
> \| Id | WBA database unique row number |\
> \| WorkorderNo | Unique number originated from ERP/CRM |\
> \| Order Nr | Unique Workorder number created in tablet app |\
> \| WorkDate | Scheduled date for work (d-m-Y) |\
> \| WorkTime | Scheduled time for work (H:i) |\
> \| WorkEndDate | Scheduled end date for work (d-m-Y) |\
> \| WorkEndTime | Scheduled end time for work (H:i) |\
> \| ProjectNr | Internal Project number |\
> \| ExternProjectNr | External Project number |\
> \| CustomerName | Customer name |\
> \| CustomerDebtorNr | Customer debtor number |\
> \| CustomerStreet | Customer street |\
> \| CustomerStreetNo | Customer street number |\
> \| CustomerEmail | Customer Email |\
> \| CustomerZIP | Customer zip code |\
> \| CustomerCity | Customer city |\
> \| CustomerContactPerson | Customer contact person |\
> \| CustomerPhone | Customer phone number |\
> \| CustomerRemark | Customer remark |\
> \| CustomerNameInvoice | Invoice customer name |\
> \| CustomerDebtorNrInvoice | Invoice customer debtor number |\
> \| CustomerStreetInvoice | Invoice customer street name |\
> \| CustomerStreetNoInvoice | Invoice customer street number |\
> \| CustomerEmailInvoice | Invoice customer email |\
> \| CustomerZIPInvoice | Invoice customer zip code |\
> \| CustomerCityInvoice | Invoice customer city |\
> \| CustomerContactPersonInvoice | Invoice customer contact person |\
> \| CustomerPhoneInvoice | Invoice customer phone number |\
> \| CustomerRemarkInvoice | Invoice customer remark |\
> \| TypeOfWork | Installatie, Garantie, Levering, Onderhoud, Project, Regie, Reparatie,Service, Storing, Verkoop, Verhuur |\
> \| WorkDescription | Work description of executed work |\
> \| WorkInstruction | Work instructions from ERP / CRM (future use) |\
> \| PaymentMethod | niet van toepassing, op rekening, contact voldaan, pin betaling, conform offerte |\
> \| CreationDate | Date time of creation of workorder in WBA backoffice |\
> \| EmployeeNr | Employee Number |\
> \| Signature | Signature file name |\
> \| SignatureUrl | Url to download/open signature image |\
> \| PdfUrl | Url to download/open PDF |\
> \| WordUrl | Url to download/open Word document |\
> \| WorksheetCode | Unique code to use when retrieving a document |\
> \| Status | Status of the workorder |\
> \| WorkFinished | Indication if the work is finished. When the value is 1 the employee marked the work ready in the tablet. |\
> \| Archived | Indication if the workorder is archived |\
> \| Photos | Array of photo objects (URL's) |\
> \| Workperiods | Array of Workperiods |\
> \| Materials | Array of used materials (MaterialNr is amount of materials) |\
> \| Documents | Array of file names |\
> \| Forms | Array of forms. Each row contains Name, Data and ObjectCode |\
> \| Employees | Array of employee numbers. |\
> \| WorkObjects | Array of objects codes. |

```json
{"openapi":"3.1.0","info":{"title":"OpenApi","version":"1.0.0"},"servers":[{"url":"{{api_url}}"},{"url":"https://www.werkbonapp.nl"}],"security":[{"BearerAuth":[]}],"components":{"securitySchemes":{"BearerAuth":{"type":"http","scheme":"bearer"}}},"paths":{"/GetWorkorder/":{"get":{"summary":"Get workorder","parameters":[{"name":"token","in":"query","schema":{"type":"string"}},{"name":"software_token","in":"query","schema":{"type":"string"}},{"name":"row_id","in":"query","schema":{"type":"string"}},{"name":"workorder_no","in":"query","schema":{"type":"string"}},{"name":"update_status","in":"query","schema":{"type":"boolean"}}],"responses":{"200":{"description":"Response_200"}},"tags":["Work Orders"],"description":"A workorder contains the following data:\n\n| Parameter | Detail |\n| --- | --- |\n| Id | WBA database unique row number |\n| WorkorderNo | Unique number originated from ERP/CRM |\n| Order Nr | Unique Workorder number created in tablet app |\n| WorkDate | Scheduled date for work (d-m-Y) |\n| WorkTime | Scheduled time for work (H:i) |\n| WorkEndDate | Scheduled end date for work (d-m-Y) |\n| WorkEndTime | Scheduled end time for work (H:i) |\n| ProjectNr | Internal Project number |\n| ExternProjectNr | External Project number |\n| CustomerName | Customer name |\n| CustomerDebtorNr | Customer debtor number |\n| CustomerStreet | Customer street |\n| CustomerStreetNo | Customer street number |\n| CustomerEmail | Customer Email |\n| CustomerZIP | Customer zip code |\n| CustomerCity | Customer city |\n| CustomerContactPerson | Customer contact person |\n| CustomerPhone | Customer phone number |\n| CustomerRemark | Customer remark |\n| CustomerNameInvoice | Invoice customer name |\n| CustomerDebtorNrInvoice | Invoice customer debtor number |\n| CustomerStreetInvoice | Invoice customer street name |\n| CustomerStreetNoInvoice | Invoice customer street number |\n| CustomerEmailInvoice | Invoice customer email |\n| CustomerZIPInvoice | Invoice customer zip code |\n| CustomerCityInvoice | Invoice customer city |\n| CustomerContactPersonInvoice | Invoice customer contact person |\n| CustomerPhoneInvoice | Invoice customer phone number |\n| CustomerRemarkInvoice | Invoice customer remark |\n| TypeOfWork | Installatie, Garantie, Levering, Onderhoud, Project, Regie, Reparatie,Service, Storing, Verkoop, Verhuur |\n| WorkDescription | Work description of executed work |\n| WorkInstruction | Work instructions from ERP / CRM (future use) |\n| PaymentMethod | niet van toepassing, op rekening, contact voldaan, pin betaling, conform offerte |\n| CreationDate | Date time of creation of workorder in WBA backoffice |\n| EmployeeNr | Employee Number |\n| Signature | Signature file name |\n| SignatureUrl | Url to download/open signature image |\n| PdfUrl | Url to download/open PDF |\n| WordUrl | Url to download/open Word document |\n| WorksheetCode | Unique code to use when retrieving a document |\n| Status | Status of the workorder |\n| WorkFinished | Indication if the work is finished. When the value is 1 the employee marked the work ready in the tablet. |\n| Archived | Indication if the workorder is archived |\n| Photos | Array of photo objects (URL's) |\n| Workperiods | Array of Workperiods |\n| Materials | Array of used materials (MaterialNr is amount of materials) |\n| Documents | Array of file names |\n| Forms | Array of forms. Each row contains Name, Data and ObjectCode |\n| Employees | Array of employee numbers. |\n| WorkObjects | Array of objects codes. |"}}}}
```

## Get workorders

> Use this endpoint to get a list of workorders from the Outsmart account.\
> \
> To avoid receiving a large amount of workorders at once, please consider adding filters according to your requirements.\
> \
> \*\*Freefields\*\*\
> \
> Additional freefields can be added to the workorder data. To include these in the results, add the URL parameter \`includeFreefields\` with value \`true\`. Freefields will only be added to the results when declared, use the \[Freefields]\(<https://documenter.getpostman.com/view/3100119/UVRDG5v7#a4d1b560-dd2b-4936-9ffe-80aee3514507>) endpoint to see which fields have been set. Freefields are numbered 1-50.\
> \
> \*\*Filtering\*\*\
> \
> This endpoint supports filtering options. Read the section on applying filters to the request \[here]\(<https://documenter.getpostman.com/view/3100119/UVRDG5v7#advanced-filters>).  \
> Filters can be applied to the following field values\
> \
> \*   JobNr\
> \*   OrderNr\
> \*   WorkorderNo\
> \*   Reference\
> \*   ExternalReference\
> \*   ProjectNr\
> \*   WorkDate\
> \*   WorkTime\
> \*   WorkEndDate\
> \*   WorkEndTime\
> \*   ExternProjectNr\
> \*   CustomerDebtorNr\
> \*   CustomerDebtorNrInvoice\
> \*   TypeOfWork\
> \*   CreationDate\
> \*   MutationDate\
> \*   EmployeeNr\
> \*   WorkStatus\
> \*   archived\
> &#x20;   \
> \
> \*\*Example with filters\*\*\
> \
> In order to get specific results, multiple filters can be applied by adding multiple \`key\[]\`, \`value\[]\`, and \`operator\[]\` URL parameters. For example with the request below:\
> \
> {api\_url}/GetWorkorders/?token={client\_token}\&software\_token={software\_token}\&status=Compleet\&update\_status=false\&key\\\[\\]=MutationDate\&value\\\[\\]=2022-01-01 00:00:00\&operator\\\[\\]=ge\
> \
> The example above makes use of several URL parameters and a filter set on \`MutationDate\` to get all the completed workorders that have been modified after new years 2022. The following parameters and filter are applied:\
> \
> \*   The URL parameter \`status\` is given the value 'Compleet' to get all completed orders\
> \*   The URL parameter \`update\_status\` is given the value \`false\` as indication that we don't want the status to be directly updated\
> \*   A filter is added on the field \`MutationDate\` with the operator set as \`ge\` (greaterequals) on the value \`2022-01-01 00:00:00\`. This will make sure this request only receives workorders that have been modified after the given date and time.\
> &#x20;   \
> \
> Additional filters can by applied by adding more of the filter URL parameters. Do note that currently all added filters will be applied as AND, there is currently no way to check 2 filters with OR keyword. So all the applied filters will have to be checked as true on the workorders returned.

```json
{"openapi":"3.1.0","info":{"title":"OpenApi","version":"1.0.0"},"servers":[{"url":"{{api_url}}"},{"url":"https://www.werkbonapp.nl"}],"security":[{"BearerAuth":[]}],"components":{"securitySchemes":{"BearerAuth":{"type":"http","scheme":"bearer"}}},"paths":{"/GetWorkorders/":{"get":{"summary":"Get workorders","parameters":[{"name":"token","in":"query","schema":{"type":"string"}},{"name":"software_token","in":"query","schema":{"type":"string"}},{"name":"status","in":"query","description":"Possible values: Alle, Klaargezet, Opgehaald, Ingepland, Compleet, Afgehandeld","schema":{"type":"string"}},{"name":"update_status","in":"query","description":"Boolean value\n\nDetermines whether the workorders status should be updated upon being requested. Changes the status for orders that are 'Compleet' to 'Afgehandeld'.","schema":{"type":"string"}},{"name":"workstatus","in":"query","description":"Workstatus given to the workorder. These are custom statusses that can be changed by the user. Use the 'workstatusses' endpoint to get the available statusses for the account","schema":{"type":"string"}},{"name":"key[]","in":"query","description":"Filter parameter. Name of the field to apply filter to","schema":{"type":"string"}},{"name":"value[]","in":"query","description":"Filter parameter. Search value for the filter","schema":{"type":"string"}},{"name":"operator[]","in":"query","description":"Filter parameter. Operator applied to the filter query","schema":{"type":"string"}},{"name":"includeFreefields","in":"query","description":"Boolean value. Determines whether freefields are included in the response. Default value is false","schema":{"type":"string"}}],"responses":{"200":{"description":"Response_200"}},"tags":["Work Orders"],"description":"Use this endpoint to get a list of workorders from the Outsmart account.\n\nTo avoid receiving a large amount of workorders at once, please consider adding filters according to your requirements.\n\n**Freefields**\n\nAdditional freefields can be added to the workorder data. To include these in the results, add the URL parameter `includeFreefields` with value `true`. Freefields will only be added to the results when declared, use the [Freefields](https://documenter.getpostman.com/view/3100119/UVRDG5v7#a4d1b560-dd2b-4936-9ffe-80aee3514507) endpoint to see which fields have been set. Freefields are numbered 1-50.\n\n**Filtering**\n\nThis endpoint supports filtering options. Read the section on applying filters to the request [here](https://documenter.getpostman.com/view/3100119/UVRDG5v7#advanced-filters).  \nFilters can be applied to the following field values\n\n*   JobNr\n*   OrderNr\n*   WorkorderNo\n*   Reference\n*   ExternalReference\n*   ProjectNr\n*   WorkDate\n*   WorkTime\n*   WorkEndDate\n*   WorkEndTime\n*   ExternProjectNr\n*   CustomerDebtorNr\n*   CustomerDebtorNrInvoice\n*   TypeOfWork\n*   CreationDate\n*   MutationDate\n*   EmployeeNr\n*   WorkStatus\n*   archived\n    \n\n**Example with filters**\n\nIn order to get specific results, multiple filters can be applied by adding multiple `key[]`, `value[]`, and `operator[]` URL parameters. For example with the request below:\n\n{api_url}/GetWorkorders/?token={client_token}&software_token={software_token}&status=Compleet&update_status=false&key\\[\\]=MutationDate&value\\[\\]=2022-01-01 00:00:00&operator\\[\\]=ge\n\nThe example above makes use of several URL parameters and a filter set on `MutationDate` to get all the completed workorders that have been modified after new years 2022. The following parameters and filter are applied:\n\n*   The URL parameter `status` is given the value 'Compleet' to get all completed orders\n*   The URL parameter `update_status` is given the value `false` as indication that we don't want the status to be directly updated\n*   A filter is added on the field `MutationDate` with the operator set as `ge` (greaterequals) on the value `2022-01-01 00:00:00`. This will make sure this request only receives workorders that have been modified after the given date and time.\n    \n\nAdditional filters can by applied by adding more of the filter URL parameters. Do note that currently all added filters will be applied as AND, there is currently no way to check 2 filters with OR keyword. So all the applied filters will have to be checked as true on the workorders returned."}}}}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://knowledge.out-smart.com/openapi/work-orders.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
