/hoseassembly/price 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 Assembly
postHoseAssemblyPrice
Code samples
const inputBody = '{
"type": "object",
"properties": {
"params": {
"type": "object",
"required": [
"hoseId",
"length",
"lengthUnit"
],
"properties": {
"hoseId": {
"type": "string",
"format": "objectId",
"description": "MongoDB ObjectId of the hose."
},
"end1Id": {
"type": "string",
"format": "objectId",
"description": "MongoDB ObjectId of end1.",
"nullable": true
},
"end2Id": {
"type": "string",
"format": "objectId",
"description": "MongoDB ObjectId of end2.",
"nullable": true
},
"ferrule1Id": {
"type": "string",
"format": "objectId",
"description": "MongoDB ObjectId of ferrule1.",
"nullable": true
},
"ferrule2Id": {
"type": "string",
"format": "objectId",
"description": "MongoDB ObjectId of ferrule2.",
"nullable": true
},
"wrapId": {
"type": "string",
"format": "objectId",
"description": "MongoDB ObjectId of wrap style.",
"nullable": true
},
"customerOrgId": {
"type": "string",
"format": "objectId",
"description": "MongoDB ObjectId of customer organization.",
"nullable": true
},
"length": {
"type": "number",
"format": "float",
"description": "Length of the hose."
},
"lengthUnit": {
"type": "object",
"required": [
"unit"
],
"properties": {
"unit": {
"type": "string",
"description": "Unit of length (e.g., \"inch\", \"mm\")."
}
}
},
"proofTest": {
"type": "boolean",
"description": "Whether proof test is required.",
"nullable": true
},
"burstTest": {
"type": "boolean",
"description": "Whether burst test is required.",
"nullable": true
},
"wrapStyle": {
"type": "object",
"properties": {
"wrapType": {
"type": "string",
"nullable": true
},
"colour": {
"type": "string",
"nullable": true
},
"imageName": {
"type": "string",
"nullable": true
},
"coverage": {
"type": "object",
"properties": {
"coverageType": {
"type": "string",
"nullable": true
},
"imageName": {
"type": "string",
"nullable": true
},
"length": {
"type": "number",
"format": "float",
"nullable": true
},
"length2": {
"type": "number",
"format": "float",
"nullable": true
},
"offset": {
"type": "number",
"format": "float",
"nullable": true
}
}
}
}
},
"extraItems": {
"type": "array",
"items": {
"type": "object",
"properties": {
"item": {
"type": "string",
"format": "objectId"
},
"quantity": {
"type": "number",
"format": "float"
},
"number": {
"type": "integer",
"nullable": true
},
"location": {
"type": "string",
"nullable": true
},
"itemType": {
"type": "string",
"nullable": true
},
"unitOfMeasure": {
"type": "string",
"nullable": true
},
"comments": {
"type": "string",
"nullable": true
}
}
}
}
}
}
}
}';
const headers = {
'Content-Type':'application/json',
'Accept':'application/json'
};
fetch('https://goldleaf.app/api/v1/hoseassembly/price',
{
method: 'POST',
body: inputBody,
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
POST /hoseassembly/price
Calculate price for a temporary hose assembly configuration
Calculates the price for a temporary hose assembly configuration based on parts, length, wrap style, and extra items.
Body parameter
{
"type": "object",
"properties": {
"params": {
"type": "object",
"required": ["hoseId", "length", "lengthUnit"],
"properties": {
"hoseId": {
"type": "string",
"format": "objectId",
"description": "MongoDB ObjectId of the hose."
},
"end1Id": {
"type": "string",
"format": "objectId",
"description": "MongoDB ObjectId of end1.",
"nullable": true
},
"end2Id": {
"type": "string",
"format": "objectId",
"description": "MongoDB ObjectId of end2.",
"nullable": true
},
"ferrule1Id": {
"type": "string",
"format": "objectId",
"description": "MongoDB ObjectId of ferrule1.",
"nullable": true
},
"ferrule2Id": {
"type": "string",
"format": "objectId",
"description": "MongoDB ObjectId of ferrule2.",
"nullable": true
},
"wrapId": {
"type": "string",
"format": "objectId",
"description": "MongoDB ObjectId of wrap style.",
"nullable": true
},
"customerOrgId": {
"type": "string",
"format": "objectId",
"description": "MongoDB ObjectId of customer organization.",
"nullable": true
},
"length": {
"type": "number",
"format": "float",
"description": "Length of the hose."
},
"lengthUnit": {
"type": "object",
"required": ["unit"],
"properties": {
"unit": {
"type": "string",
"description": "Unit of length (e.g., \"inch\", \"mm\")."
}
}
},
"proofTest": {
"type": "boolean",
"description": "Whether proof test is required.",
"nullable": true
},
"burstTest": {
"type": "boolean",
"description": "Whether burst test is required.",
"nullable": true
},
"wrapStyle": {
"type": "object",
"properties": {
"wrapType": {
"type": "string",
"nullable": true
},
"colour": {
"type": "string",
"nullable": true
},
"imageName": {
"type": "string",
"nullable": true
},
"coverage": {
"type": "object",
"properties": {
"coverageType": {
"type": "string",
"nullable": true
},
"imageName": {
"type": "string",
"nullable": true
},
"length": {
"type": "number",
"format": "float",
"nullable": true
},
"length2": {
"type": "number",
"format": "float",
"nullable": true
},
"offset": {
"type": "number",
"format": "float",
"nullable": true
}
}
}
}
},
"extraItems": {
"type": "array",
"items": {
"type": "object",
"properties": {
"item": {
"type": "string",
"format": "objectId"
},
"quantity": {
"type": "number",
"format": "float"
},
"number": {
"type": "integer",
"nullable": true
},
"location": {
"type": "string",
"nullable": true
},
"itemType": {
"type": "string",
"nullable": true
},
"unitOfMeasure": {
"type": "string",
"nullable": true
},
"comments": {
"type": "string",
"nullable": true
}
}
}
}
}
}
}
}
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| body | body | object | true | none |
| » params | body | object | false | none |
| »» hoseId | body | string(objectId) | true | MongoDB ObjectId of the hose. |
| »» end1Id | body | string(objectId)¦null | false | MongoDB ObjectId of end1. |
| »» end2Id | body | string(objectId)¦null | false | MongoDB ObjectId of end2. |
| »» ferrule1Id | body | string(objectId)¦null | false | MongoDB ObjectId of ferrule1. |
| »» ferrule2Id | body | string(objectId)¦null | false | MongoDB ObjectId of ferrule2. |
| »» wrapId | body | string(objectId)¦null | false | MongoDB ObjectId of wrap style. |
| »» customerOrgId | body | string(objectId)¦null | false | MongoDB ObjectId of customer organization. |
| »» length | body | number(float) | true | Length of the hose. |
| »» lengthUnit | body | object | true | none |
| »»» unit | body | string | true | Unit of length (e.g., "inch", "mm"). |
| »» proofTest | body | boolean¦null | false | Whether proof test is required. |
| »» burstTest | body | boolean¦null | false | Whether burst test is required. |
| »» wrapStyle | body | object | false | none |
| »»» wrapType | body | string¦null | false | none |
| »»» colour | body | string¦null | false | none |
| »»» imageName | body | string¦null | false | none |
| »»» coverage | body | object | false | none |
| »»»» coverageType | body | string¦null | false | none |
| »»»» imageName | body | string¦null | false | none |
| »»»» length | body | number(float)¦null | false | none |
| »»»» length2 | body | number(float)¦null | false | none |
| »»»» offset | body | number(float)¦null | false | none |
| »» extraItems | body | [object] | false | none |
| »»» item | body | string(objectId) | false | none |
| »»» quantity | body | number(float) | false | none |
| »»» number | body | integer¦null | false | none |
| »»» location | body | string¦null | false | none |
| »»» itemType | body | string¦null | false | none |
| »»» unitOfMeasure | body | string¦null | false | none |
| »»» comments | body | string¦null | false | none |
Example responses
500 Response
{
"type": "string"
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | Price calculated successfully | None |
| 500 | Internal Server Error | Server error | string |
