/workorder/{workOrderId}/item/{itemId}/update 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
postWorkOrderIdItemIdUpdate
Code samples
const inputBody = '{
"type": "object",
"properties": {
"params": {
"type": "object",
"required": [
"lineNumber",
"itemType",
"quantity"
],
"properties": {
"lineNumber": {
"type": "string",
"description": "Line number of the item"
},
"itemType": {
"type": "string",
"description": "Type of the item"
},
"quantity": {
"type": "number",
"description": "Quantity of the item"
},
"comments": {
"type": "string",
"description": "Additional comments",
"nullable": true
},
"salesOrder": {
"type": "string",
"description": "Sales order reference",
"nullable": true
},
"purchaseOrder": {
"type": "string",
"description": "Purchase order reference",
"nullable": true
}
}
}
}
}';
const headers = {
'Content-Type':'application/json',
'Accept':'application/json',
'Authorization':{
"type": "string"
}
};
fetch('https://goldleaf.app/api/v1/workorder/{workOrderId}/item/{itemId}/update',
{
method: 'POST',
body: inputBody,
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
POST /workorder/{workOrderId}/item/{itemId}/update
Update a specific item in a work order
Body parameter
{
"type": "object",
"properties": {
"params": {
"type": "object",
"required": ["lineNumber", "itemType", "quantity"],
"properties": {
"lineNumber": {
"type": "string",
"description": "Line number of the item"
},
"itemType": {
"type": "string",
"description": "Type of the item"
},
"quantity": {
"type": "number",
"description": "Quantity of the item"
},
"comments": {
"type": "string",
"description": "Additional comments",
"nullable": true
},
"salesOrder": {
"type": "string",
"description": "Sales order reference",
"nullable": true
},
"purchaseOrder": {
"type": "string",
"description": "Purchase order reference",
"nullable": true
}
}
}
}
}
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| Authorization | header | string | true | Bearer token for authorization |
| workOrderId | path | string | true | Work order ID (MongoDB ObjectId) |
| itemId | path | string | true | Item ID to update (MongoDB ObjectId) |
| body | body | object | true | Updated item attributes |
| » params | body | object | false | none |
| »» lineNumber | body | string | true | Line number of the item |
| »» itemType | body | string | true | Type of the item |
| »» quantity | body | number | true | Quantity of the item |
| »» comments | body | string¦null | false | Additional comments |
| »» salesOrder | body | string¦null | false | Sales order reference |
| »» purchaseOrder | body | string¦null | false | Purchase order reference |
Example responses
200 Response
{
"type": "string"
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | Item updated successfully | string |
| 500 | Internal Server Error | none | string |
