/otheritems/{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:
Other Items
postOtherItemsIdUpdate
Code samples
const inputBody = '{
"type": "object",
"properties": {
"params": {
"type": "object",
"required": [
"partNumber"
],
"properties": {
"partNumber": {
"type": "string",
"description": "Part number of the item"
},
"itemType": {
"type": "string",
"description": "Type of the item"
},
"brand": {
"type": "string",
"description": "Brand name of the item"
},
"description": {
"type": "string",
"description": "Description of the item"
}
}
}
}
}';
const headers = {
'Content-Type':'application/json',
'Accept':'application/json'
};
fetch('https://goldleaf.app/api/v1/otheritems/{itemId}/update',
{
method: 'POST',
body: inputBody,
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
POST /otheritems/{itemId}/update
Create or update an other item by ID
Creates or updates an other item identified by its ID. Requires admin or regular role, excludes customer role.
Body parameter
{
"type": "object",
"properties": {
"params": {
"type": "object",
"required": ["partNumber"],
"properties": {
"partNumber": {
"type": "string",
"description": "Part number of the item"
},
"itemType": {
"type": "string",
"description": "Type of the item"
},
"brand": {
"type": "string",
"description": "Brand name of the item"
},
"description": {
"type": "string",
"description": "Description of the item"
}
}
}
}
}
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| itemId | path | string(mongoId) | true | The ID of the other item to create or update |
| body | body | object | true | none |
| » params | body | object | false | none |
| »» partNumber | body | string | true | Part number of the item |
| »» itemType | body | string | false | Type of the item |
| »» brand | body | string | false | Brand name of the item |
| »» description | body | string | false | Description of the item |
Example responses
200 Response
{
"type": "string"
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | Item created or updated successfully | string |
| 500 | Internal Server Error | Internal server error | string |
