/workorders/create v1.0.0
Scroll down for code samples, example requests and responses. Select a language for code samples from the tabs above or the mobile navigation menu.
Base URLs:
Work Orders
postWorkORdersCreate
Code samples
const inputBody = '{
"type": "object",
"required": [
"number"
],
"properties": {
"number": {
"type": "string",
"description": "The order number, must be a non-empty string."
},
"items": {
"type": "array",
"items": {
"type": "object",
"properties": {
"purchaseOrder": {
"type": "string",
"description": "The purchase order associated with the item.",
"nullable": true
},
"salesOrder": {
"type": "string",
"description": "The sales order associated with the item.",
"nullable": true
},
"comments": {
"type": "string",
"description": "Comments about the item.",
"nullable": true
},
"quantity": {
"type": "number",
"description": "The quantity of the item.",
"nullable": true
},
"deleted": {
"type": "boolean",
"description": "Flag indicating if the item is deleted.",
"nullable": true
},
"item": {
"type": "string",
"format": "mongo-id",
"description": "The MongoDB ID of the item.",
"nullable": true
},
"lineNumber": {
"type": "number",
"description": "The line number of the item.",
"nullable": true
}
}
},
"nullable": true
},
"description": {
"type": "string",
"description": "The description of the order.",
"nullable": true
},
"status": {
"type": "string",
"description": "The status of the order.",
"nullable": true
},
"revision": {
"type": "string",
"description": "The revision of the order.",
"nullable": true
},
"comments": {
"type": "string",
"description": "Comments about the order.",
"nullable": true
},
"taxes": {
"type": "array",
"items": {
"type": "object",
"properties": {
"lineNumber": {
"type": "number",
"description": "The line number of the tax.",
"nullable": true
}
}
},
"nullable": true
},
"dueDate": {
"type": "string",
"format": "date",
"description": "The due date of the order.",
"nullable": true
},
"startDate": {
"type": "string",
"format": "date",
"description": "The start date of the order.",
"nullable": true
}
}
}';
const headers = {
'Content-Type':'application/json',
'Accept':'application/json'
};
fetch('https://goldleaf.app/api/v1/workorders/create',
{
method: 'POST',
body: inputBody,
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
POST /workorders/create
Create a work order
Creates a work order for the organization.
Body parameter
{
"type": "object",
"required": ["number"],
"properties": {
"number": {
"type": "string",
"description": "The order number, must be a non-empty string."
},
"items": {
"type": "array",
"items": {
"type": "object",
"properties": {
"purchaseOrder": {
"type": "string",
"description": "The purchase order associated with the item.",
"nullable": true
},
"salesOrder": {
"type": "string",
"description": "The sales order associated with the item.",
"nullable": true
},
"comments": {
"type": "string",
"description": "Comments about the item.",
"nullable": true
},
"quantity": {
"type": "number",
"description": "The quantity of the item.",
"nullable": true
},
"deleted": {
"type": "boolean",
"description": "Flag indicating if the item is deleted.",
"nullable": true
},
"item": {
"type": "string",
"format": "mongo-id",
"description": "The MongoDB ID of the item.",
"nullable": true
},
"lineNumber": {
"type": "number",
"description": "The line number of the item.",
"nullable": true
}
}
},
"nullable": true
},
"description": {
"type": "string",
"description": "The description of the order.",
"nullable": true
},
"status": {
"type": "string",
"description": "The status of the order.",
"nullable": true
},
"revision": {
"type": "string",
"description": "The revision of the order.",
"nullable": true
},
"comments": {
"type": "string",
"description": "Comments about the order.",
"nullable": true
},
"taxes": {
"type": "array",
"items": {
"type": "object",
"properties": {
"lineNumber": {
"type": "number",
"description": "The line number of the tax.",
"nullable": true
}
}
},
"nullable": true
},
"dueDate": {
"type": "string",
"format": "date",
"description": "The due date of the order.",
"nullable": true
},
"startDate": {
"type": "string",
"format": "date",
"description": "The start date of the order.",
"nullable": true
}
}
}
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| body | body | object | true | none |
| » number | body | string | true | The order number, must be a non-empty string. |
| » items | body | [object]¦null | false | none |
| »» purchaseOrder | body | string¦null | false | The purchase order associated with the item. |
| »» salesOrder | body | string¦null | false | The sales order associated with the item. |
| »» comments | body | string¦null | false | Comments about the item. |
| »» quantity | body | number¦null | false | The quantity of the item. |
| »» deleted | body | boolean¦null | false | Flag indicating if the item is deleted. |
| »» item | body | string(mongo-id)¦null | false | The MongoDB ID of the item. |
| »» lineNumber | body | number¦null | false | The line number of the item. |
| » description | body | string¦null | false | The description of the order. |
| » status | body | string¦null | false | The status of the order. |
| » revision | body | string¦null | false | The revision of the order. |
| » comments | body | string¦null | false | Comments about the order. |
| » taxes | body | [object]¦null | false | none |
| »» lineNumber | body | number¦null | false | The line number of the tax. |
| » dueDate | body | string(date)¦null | false | The due date of the order. |
| » startDate | body | string(date)¦null | false | The start date of the order. |
Example responses
500 Response
{
"type": "string"
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 201 | Created | the newly created item | None |
| 500 | Internal Server Error | none | string |
