/otheritems/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:
Other Items
postOtherItemsCreate
Code samples
const inputBody = '{
"type": "object",
"required": [
"partNumber"
],
"properties": {
"partNumber": {
"type": "string",
"description": "The part number of the item, must be a non-empty string."
},
"itemType": {
"type": "string",
"description": "The type of the item.",
"nullable": true
},
"brand": {
"type": "string",
"description": "The brand of the item.",
"nullable": true
},
"description": {
"type": "string",
"description": "The description of the item.",
"nullable": true
},
"material": {
"type": "string",
"description": "The material of the item.",
"nullable": true
},
"imageName": {
"type": "string",
"description": "The image name associated with the item.",
"nullable": true
},
"weightLbs": {
"type": "number",
"format": "decimal",
"description": "The weight of the item in pounds.",
"nullable": true
},
"itemId": {
"type": "string",
"format": "mongo-id",
"description": "The MongoDB ID of the item, optional and can be nullable.",
"nullable": true
}
}
}';
const headers = {
'Content-Type':'application/json',
'Accept':'application/json'
};
fetch('https://goldleaf.app/api/v1/otheritems/create',
{
method: 'POST',
body: inputBody,
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
POST /otheritems/create
Create an item
Creates an item for the organization with the given properties.
Body parameter
{
"type": "object",
"required": ["partNumber"],
"properties": {
"partNumber": {
"type": "string",
"description": "The part number of the item, must be a non-empty string."
},
"itemType": {
"type": "string",
"description": "The type of the item.",
"nullable": true
},
"brand": {
"type": "string",
"description": "The brand of the item.",
"nullable": true
},
"description": {
"type": "string",
"description": "The description of the item.",
"nullable": true
},
"material": {
"type": "string",
"description": "The material of the item.",
"nullable": true
},
"imageName": {
"type": "string",
"description": "The image name associated with the item.",
"nullable": true
},
"weightLbs": {
"type": "number",
"format": "decimal",
"description": "The weight of the item in pounds.",
"nullable": true
},
"itemId": {
"type": "string",
"format": "mongo-id",
"description": "The MongoDB ID of the item, optional and can be nullable.",
"nullable": true
}
}
}
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| body | body | object | true | none |
| » partNumber | body | string | true | The part number of the item, must be a non-empty string. |
| » itemType | body | string¦null | false | The type of the item. |
| » brand | body | string¦null | false | The brand of the item. |
| » description | body | string¦null | false | The description of the item. |
| » material | body | string¦null | false | The material of the item. |
| » imageName | body | string¦null | false | The image name associated with the item. |
| » weightLbs | body | number(decimal)¦null | false | The weight of the item in pounds. |
| » itemId | body | string(mongo-id)¦null | false | The MongoDB ID of the item, optional and can be nullable. |
Example responses
500 Response
{
"type": "string"
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 201 | Created | the newly created item | None |
| 500 | Internal Server Error | Internal server error | string |
