/inventoryitem/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:
Inventory
postInventoryItemUpdate
Code samples
const inputBody = '{
"type": "object",
"properties": {
"params": {
"type": "object",
"properties": {
"item": {
"type": "string",
"description": "MongoDB ObjectId of the item",
"example": "60f6c4d2b4e6a51234567890"
},
"warehouseId": {
"type": "string",
"description": "MongoDB ObjectId of the warehouse",
"example": "60f6c4d2b4e6a59876543210"
},
"onHand": {
"type": "number",
"description": "Quantity currently on hand",
"example": 100
},
"committed": {
"type": "number",
"description": "Quantity committed to orders",
"example": 50
},
"onOrder": {
"type": "number",
"description": "Quantity currently on order",
"example": 30
},
"unitOfMeasure": {
"type": "string",
"example": "pcs"
},
"itemType": {
"type": "string",
"example": "part"
},
"warehouseName": {
"type": "string",
"example": "Main Warehouse"
},
"brandName": {
"type": "string",
"example": "Parker"
},
"partNumber": {
"type": "string",
"example": "123-ABC"
},
"orgPartNumber": {
"type": "string",
"example": "ORG-123-ABC"
}
}
}
}
}';
const headers = {
'Content-Type':'application/json',
'Accept':'application/json'
};
fetch('https://goldleaf.app/api/v1/inventoryitem/update',
{
method: 'POST',
body: inputBody,
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
POST /inventoryitem/update
Create or update an inventory item
Creates a new inventory item or updates an existing one. Only accessible by users with admin or regular roles.
Body parameter
{
"type": "object",
"properties": {
"params": {
"type": "object",
"properties": {
"item": {
"type": "string",
"description": "MongoDB ObjectId of the item",
"example": "60f6c4d2b4e6a51234567890"
},
"warehouseId": {
"type": "string",
"description": "MongoDB ObjectId of the warehouse",
"example": "60f6c4d2b4e6a59876543210"
},
"onHand": {
"type": "number",
"description": "Quantity currently on hand",
"example": 100
},
"committed": {
"type": "number",
"description": "Quantity committed to orders",
"example": 50
},
"onOrder": {
"type": "number",
"description": "Quantity currently on order",
"example": 30
},
"unitOfMeasure": {
"type": "string",
"example": "pcs"
},
"itemType": {
"type": "string",
"example": "part"
},
"warehouseName": {
"type": "string",
"example": "Main Warehouse"
},
"brandName": {
"type": "string",
"example": "Parker"
},
"partNumber": {
"type": "string",
"example": "123-ABC"
},
"orgPartNumber": {
"type": "string",
"example": "ORG-123-ABC"
}
}
}
}
}
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| body | body | object | true | none |
| » params | body | object | false | none |
| »» item | body | string | false | MongoDB ObjectId of the item |
| »» warehouseId | body | string | false | MongoDB ObjectId of the warehouse |
| »» onHand | body | number | false | Quantity currently on hand |
| »» committed | body | number | false | Quantity committed to orders |
| »» onOrder | body | number | false | Quantity currently on order |
| »» unitOfMeasure | body | string | false | none |
| »» itemType | body | string | false | none |
| »» warehouseName | body | string | false | none |
| »» brandName | body | string | false | none |
| »» partNumber | body | string | false | none |
| »» orgPartNumber | body | string | false | none |
Example responses
500 Response
{
"type": "object",
"properties": {
"message": {
"type": "string"
},
"details": {
"type": "string"
}
}
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | Inventory item successfully created or updated | None |
| 500 | Internal Server Error | Internal server error | Inline |
Response Schema
Status Code 500
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| » message | string | false | none | none |
| » details | string | false | none | none |
