> 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/advanced-filters/postworkorders-postworkorders-token-software_token.md).

# PostWorkorders \[/PostWorkorders/{?token,software\_token}]

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": [
    {
        "BeginTime": "08:30",
        "TotalTime": "03:45",
        "WorkRemark": "",
        "WorkDate": "26-09-2013",
        "EndTime": "12:15",
        "Travel": "1",
        "EmployeeNr":"11",
        "HourType":"001"
    }
] 

```

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) |

#### Post workorders \[POST]

* Parameters
  * token (string,required ,`0f24d1e07c8609c0fb111fbcc168f9aaa`) ... WorkorderApp customer token
  * software\_token (string,required , `c316c4532fa7cccdcd572491d9552f80945a51366`) ... WorkorderApp external software token
* Request Correct list of workorders posted. `response` will contain a list of added workorder where each row has the row\_id of the added workorder (application/json)
  * \[ { "WorkorderNo": "AB756X", "ProjectNr": "001", "ExternProjectNr": "EX01", "CustomerName": "Test", "CustomerDebtorNr": "A985785", "CustomerStreet": "Adres", "CustomerStreetNo": "5", "CustomerEmail": "[john.doe@example.com](https://mailto:john.doe@example.com)", "CustomerZIP": "3436ZZ", "CustomerCity": "NIeuwegein", "CustomerContactPerson": "John Doe", "CustomerPhone": "0611111111", "CustomerRemark": "Geen opmerking", "CustomerLatitude": null, "CustomerLongitude": null, "CustomerNameInvoice": "John Doe", "CustomerDebtorNrInvoice": "B985785", "CustomerStreetInvoice": "De Dompelaar", "CustomerStreetNoInvoice": "1-D", "CustomerEmailInvoice": "[john.doe@example.com](https://mailto:john.doe@example.com)", "CustomerZIPInvoice": "3454WJ", "CustomerCityInvoice": "Amsterdam", "CustomerContactPersonInvoice": "John Doe", "CustomerPhoneInvoice": "0611111111", "CustomerRemarkInvoice": "Geen", "TypeOfWork": "Installatie", "WorkDescription": "Verschillende werkzaamheden", "PaymentMethod": "niet van toepassing", "EmployeeNr": "123", "WorkDate": "11-06-2013", "WorkTime": "10:30", "WorkEndDate": "11-06-2013", "WorkEndTime": "12:30", "InternalWorkDescription": "", "WorkDuration": "0", "WorkStatus": "", "WorkDeadline": "", "PickupPlanning": "0", "WebPlanning": "0", "CpnCode": "", "AdrCode": "", "ShortWorkDescription": "", "Comment": "", "ErrorCode": "", "ErrorMessage": "", "SolutionCode": "", "SolutionMessage": "", "MinimumHours": "0.00", "RoundingAmount": "0.00", "Attachments": \[ { "File": "[https://www.werkbonapp.nl/uploads/documents/1389703238\_test.pdf"](https://www.werkbonapp.nl/uploads/documents/1389703238_test.pdf%22) }, { "File": "[https://www.werkbonapp.nl/uploads/documents/201410031416\_test.xlsx"](https://www.werkbonapp.nl/uploads/documents/201410031416_test.xlsx%22) } ], "Materials": \[ { "MaterialCode": "A786878", "MaterialNr": "1", "MaterialPrice": "0,00", "MaterialName": "Kleinmateriaal", "MaterialUnit": "M2", "MaterialType": null, "MaterialFreeField1": null, "MaterialFreeField2": null, "MaterialFreeField3": null, "MaterialFreeField4": null, "MaterialFreeField5": null } ] } ]
* Response 200 (application/json)
  * { "code": 200, "messages": \[], "response": \[ { "workorder\_no": "AB756X" "row\_id": 169824, }, { "workorder\_no": "AB756X1" "row\_id": 169825, } ] }
* Request Correct workorder posted including Forms (application/json)
  * \[ { "WorkorderNo": "AB756X", "ProjectNr": "001", "ExternProjectNr": "EX01", "CustomerName": "Test", "CustomerDebtorNr": "A985785", "CustomerStreet": "Adres", "CustomerStreetNo": "5", "CustomerEmail": "[john.doe@example.com](https://mailto:john.doe@example.com)", "CustomerZIP": "3436ZZ", "CustomerCity": "NIeuwegein", "CustomerContactPerson": "John Doe", "CustomerPhone": "0611111111", "CustomerRemark": "Geen opmerking", "CustomerNameInvoice": "John Doe1", "CustomerDebtorNrInvoice": "B9857851", "CustomerStreetInvoice": "De Dompelaar1", "CustomerStreetNoInvoice": "1-D1", "CustomerEmailInvoice": "[john.doe@example.com1](https://mailto:john.doe@example.com1)", "CustomerZIPInvoice": "3454WJ1", "CustomerCityInvoice": "Amsterdam1", "CustomerContactPersonInvoice": "John Doe1", "CustomerPhoneInvoice": "06111111111", "CustomerRemarkInvoice": "Geen1", "TypeOfWork": "Installatie1", "WorkDescription": "Verschillende werkzaamheden1", "PaymentMethod": "niet van toepassing1", "EmployeeNr": "1231", "WorkDate": "11-06-2011", "WorkTime": "10:30", "WorkEndDate": "11-06-2011", "WorkEndTime": "11:30", "InternalWorkDescription": "", "WorkDuration": "0", "WorkStatus": "", "WorkDeadline": "", "PickupPlanning": "0", "WebPlanning": "0", "CpnCode": "", "AdrCode": "", "Forms":\[ { "Name": "Form 1", "Data": "", "ObjectCode": "" } ] } ]
* Response 200 (application/json)
  * { "code": 200, "messages": \[], "response": \[ { "workorder\_no": "AB756X1" "row\_id": 169825, } ] }
* Request Required value missing. (application/json)
  * \[ { "WorkorderNo": "AB756X", "ProjectNr": "001", "ExternProjectNr": "EX01", "CustomerName": "Test", "CustomerDebtorNr": "A985785", "CustomerStreet": "Adres", "CustomerStreetNo": "5", "CustomerEmail": "[john.doe@example.com](https://mailto:john.doe@example.com)", "CustomerZIP": "3436ZZ", "CustomerCity": "NIeuwegein", "CustomerContactPerson": "John Doe", "CustomerPhone": "0611111111", "CustomerRemark": "Geen opmerking", "TypeOfWork": "Installatie1", "WorkDescription": "Verschillende werkzaamheden1", "PaymentMethod": "niet van toepassing1", "EmployeeNr": "1231", "WorkDate": "11-06-2011", "WorkTime": "10:31" } ]
* Response 200 (application/json)
  * { "code": 1501, "messages": \[ "Required field missing: WorkorderNo", "Required field missing: CustomerZIP", "Required field missing: CustomerCity", "Required field missing: CustomerContactPerson", "Required field missing: CustomerNameInvoice", "Required field missing: CustomerDebtorNrInvoice", "Required field missing: CustomerStreetInvoice", ], "response": null }


---

# 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/advanced-filters/postworkorders-postworkorders-token-software_token.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.
