/hosekits/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:
Hose Kits
postHoseKitCreate
Code samples
const inputBody = '{
"type": "object",
"properties": {
"partNumber": {
"type": "string",
"description": "The part number of the assembly.",
"nullable": true
},
"revision": {
"type": "string",
"description": "The revision of the assembly.",
"nullable": true
},
"description": {
"type": "string",
"description": "The description of the assembly.",
"nullable": true
},
"customerPartNumber": {
"type": "string",
"description": "The customer part number.",
"nullable": true
},
"customerRevision": {
"type": "string",
"description": "The customer revision.",
"nullable": true
},
"customerName": {
"type": "string",
"description": "The name of the customer.",
"nullable": true
},
"customerOrgId": {
"type": "string",
"format": "mongo-id",
"description": "The MongoDB ID of the customer organization.",
"nullable": true
},
"comments": {
"type": "string",
"description": "Comments about the assembly.",
"nullable": true
},
"status": {
"type": "string",
"description": "The status of the assembly.",
"nullable": true
},
"hoseAssemblies": {
"type": "array",
"items": {
"type": "object",
"properties": {
"number": {
"type": "string",
"description": "The number of the hose assembly.",
"nullable": true
},
"comments": {
"type": "string",
"description": "Comments about the hose assembly.",
"nullable": true
},
"quantity": {
"type": "number",
"description": "The quantity of the hose assembly.",
"nullable": true
},
"order": {
"type": "number",
"description": "The order of the hose assembly.",
"nullable": true
},
"deleted": {
"type": "boolean",
"description": "Flag indicating if the hose assembly is deleted.",
"nullable": true
},
"item": {
"type": "string",
"format": "mongo-id",
"description": "The MongoDB ID of the hose assembly item.",
"nullable": true
}
}
}
},
"adaptors": {
"type": "array",
"items": {
"type": "object",
"properties": {
"number": {
"type": "string",
"description": "The number of the adaptor.",
"nullable": true
},
"comments": {
"type": "string",
"description": "Comments about the adaptor.",
"nullable": true
},
"quantity": {
"type": "number",
"description": "The quantity of the adaptor.",
"nullable": true
},
"order": {
"type": "number",
"description": "The order of the adaptor.",
"nullable": true
},
"deleted": {
"type": "boolean",
"description": "Flag indicating if the adaptor is deleted.",
"nullable": true
},
"item": {
"type": "string",
"format": "mongo-id",
"description": "The MongoDB ID of the adaptor item.",
"nullable": true
}
}
}
},
"otherItems": {
"type": "array",
"items": {
"type": "object",
"properties": {
"number": {
"type": "string",
"description": "The number of the other item.",
"nullable": true
},
"comments": {
"type": "string",
"description": "Comments about the other item.",
"nullable": true
},
"quantity": {
"type": "number",
"description": "The quantity of the other item.",
"nullable": true
},
"order": {
"type": "number",
"description": "The order of the other item.",
"nullable": true
},
"deleted": {
"type": "boolean",
"description": "Flag indicating if the other item is deleted.",
"nullable": true
},
"item": {
"type": "string",
"format": "mongo-id",
"description": "The MongoDB ID of the other item.",
"nullable": true
}
}
}
}
}
}';
const headers = {
'Content-Type':'application/json',
'Accept':'application/json'
};
fetch('https://goldleaf.app/api/v1/hosekits/create',
{
method: 'POST',
body: inputBody,
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
POST /hosekits/create
Create a new kit assembly
Creates a new kit assembly for the organization with the given data, ensuring that no kit with the same part number and revision already exists.
Body parameter
{
"type": "object",
"properties": {
"partNumber": {
"type": "string",
"description": "The part number of the assembly.",
"nullable": true
},
"revision": {
"type": "string",
"description": "The revision of the assembly.",
"nullable": true
},
"description": {
"type": "string",
"description": "The description of the assembly.",
"nullable": true
},
"customerPartNumber": {
"type": "string",
"description": "The customer part number.",
"nullable": true
},
"customerRevision": {
"type": "string",
"description": "The customer revision.",
"nullable": true
},
"customerName": {
"type": "string",
"description": "The name of the customer.",
"nullable": true
},
"customerOrgId": {
"type": "string",
"format": "mongo-id",
"description": "The MongoDB ID of the customer organization.",
"nullable": true
},
"comments": {
"type": "string",
"description": "Comments about the assembly.",
"nullable": true
},
"status": {
"type": "string",
"description": "The status of the assembly.",
"nullable": true
},
"hoseAssemblies": {
"type": "array",
"items": {
"type": "object",
"properties": {
"number": {
"type": "string",
"description": "The number of the hose assembly.",
"nullable": true
},
"comments": {
"type": "string",
"description": "Comments about the hose assembly.",
"nullable": true
},
"quantity": {
"type": "number",
"description": "The quantity of the hose assembly.",
"nullable": true
},
"order": {
"type": "number",
"description": "The order of the hose assembly.",
"nullable": true
},
"deleted": {
"type": "boolean",
"description": "Flag indicating if the hose assembly is deleted.",
"nullable": true
},
"item": {
"type": "string",
"format": "mongo-id",
"description": "The MongoDB ID of the hose assembly item.",
"nullable": true
}
}
}
},
"adaptors": {
"type": "array",
"items": {
"type": "object",
"properties": {
"number": {
"type": "string",
"description": "The number of the adaptor.",
"nullable": true
},
"comments": {
"type": "string",
"description": "Comments about the adaptor.",
"nullable": true
},
"quantity": {
"type": "number",
"description": "The quantity of the adaptor.",
"nullable": true
},
"order": {
"type": "number",
"description": "The order of the adaptor.",
"nullable": true
},
"deleted": {
"type": "boolean",
"description": "Flag indicating if the adaptor is deleted.",
"nullable": true
},
"item": {
"type": "string",
"format": "mongo-id",
"description": "The MongoDB ID of the adaptor item.",
"nullable": true
}
}
}
},
"otherItems": {
"type": "array",
"items": {
"type": "object",
"properties": {
"number": {
"type": "string",
"description": "The number of the other item.",
"nullable": true
},
"comments": {
"type": "string",
"description": "Comments about the other item.",
"nullable": true
},
"quantity": {
"type": "number",
"description": "The quantity of the other item.",
"nullable": true
},
"order": {
"type": "number",
"description": "The order of the other item.",
"nullable": true
},
"deleted": {
"type": "boolean",
"description": "Flag indicating if the other item is deleted.",
"nullable": true
},
"item": {
"type": "string",
"format": "mongo-id",
"description": "The MongoDB ID of the other item.",
"nullable": true
}
}
}
}
}
}
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| body | body | object | true | none |
| » partNumber | body | string¦null | false | The part number of the assembly. |
| » revision | body | string¦null | false | The revision of the assembly. |
| » description | body | string¦null | false | The description of the assembly. |
| » customerPartNumber | body | string¦null | false | The customer part number. |
| » customerRevision | body | string¦null | false | The customer revision. |
| » customerName | body | string¦null | false | The name of the customer. |
| » customerOrgId | body | string(mongo-id)¦null | false | The MongoDB ID of the customer organization. |
| » comments | body | string¦null | false | Comments about the assembly. |
| » status | body | string¦null | false | The status of the assembly. |
| » hoseAssemblies | body | [object] | false | none |
| »» number | body | string¦null | false | The number of the hose assembly. |
| »» comments | body | string¦null | false | Comments about the hose assembly. |
| »» quantity | body | number¦null | false | The quantity of the hose assembly. |
| »» order | body | number¦null | false | The order of the hose assembly. |
| »» deleted | body | boolean¦null | false | Flag indicating if the hose assembly is deleted. |
| »» item | body | string(mongo-id)¦null | false | The MongoDB ID of the hose assembly item. |
| » adaptors | body | [object] | false | none |
| »» number | body | string¦null | false | The number of the adaptor. |
| »» comments | body | string¦null | false | Comments about the adaptor. |
| »» quantity | body | number¦null | false | The quantity of the adaptor. |
| »» order | body | number¦null | false | The order of the adaptor. |
| »» deleted | body | boolean¦null | false | Flag indicating if the adaptor is deleted. |
| »» item | body | string(mongo-id)¦null | false | The MongoDB ID of the adaptor item. |
| » otherItems | body | [object] | false | none |
| »» number | body | string¦null | false | The number of the other item. |
| »» comments | body | string¦null | false | Comments about the other item. |
| »» quantity | body | number¦null | false | The quantity of the other item. |
| »» order | body | number¦null | false | The order of the other item. |
| »» deleted | body | boolean¦null | false | Flag indicating if the other item is deleted. |
| »» item | body | string(mongo-id)¦null | false | The MongoDB ID of the other item. |
Example responses
406 Response
{
"type": "object",
"properties": {
"message": {
"type": "string",
"example": "A kit with this part number and revision already exists"
},
"details": {
"type": "string",
"example": "Duplicate entry detected"
}
}
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 201 | Created | the newly created hose kit | None |
| 406 | Not Acceptable | Not acceptable (duplicate partNumber and revision) | Inline |
| 500 | Internal Server Error | Internal server error | Inline |
Response Schema
Status Code 406
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| » message | string | false | none | none |
| » details | string | false | none | none |
Status Code 500
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| » message | string | false | none | none |
| » details | string | false | none | none |
