Beta version
Basic URL: https://api.goodloading.com/api/external/calculation
Endpoint
POST /calculation
Request Headers
Name | Value | Mandatory | Description |
---|---|---|---|
Authorization | Bearer <token> | Yes | Authorisation key |
Request Body
Field | Type | Mandatory | Value |
---|---|---|---|
name | string | No | Name of the project |
note | string | No | Description of the project |
loads | array | Yes | Loads board |
load.id | number | No | Load identifier |
load.quantity | integer | Yes | Loads quantity. Must be an integer greater than 0. |
load.name | string | Yes | Load name |
load.length | number | Yes | One load length. Must be greater than 0. |
load.width | number | Yes | One load width. Must be greater than 0. |
load.height | number | Yes | One load height. Must be greater than 0. |
load.weight | number | Yes | One load weight. Must be greater than or equal to 0. |
load.priority | integer | Yes | Load priority. The value must be an integer greater than or equal to 0. Default value: 0. |
load.stacking | boolean / integer | Yes | Load stacking. The false value means that it is nonstackable, the true value means that it is stackable. Indicating an integer greater than 0 means that the load is stackable with a limited number of stacks. Default value: true |
load.allowToRotate | boolean | No | Assumes true or false. Setting the value as true allows for replacing the width with the length while calculating, i.e. it allows for rotating the load relative to the base. Default value true |
load.rotateFreely | boolean | No | Assumes true or false. Setting the value as true allows for replacing the dimension with eachother while calculating, i.e. it allows for rotating the load on any side. Default value false |
load.color | string | No | Load color in hex code format. |
origin | {id: number, name: string} |
No | Loading location (multi stops) |
destination | {id: number, name: string} |
No | Unloading location (multi stops) |
pctSupport | number | No | Percentage of load area served |
alongFloor | boolean | No | Assumes true or false. Setting the value to true causes loads to be loaded along the floor |
maxWeightOnTop | number | No | Maximum weight that can be placed over the load |
boxesAllowedBellow | array of numbers | No | Board id of boxes that can be placed under the load |
loadType | number | No | 0: box,1:barrel,2:pipe default(0) |
loadingSpaces | array | Yes | Load space board |
loadingSpace. quantity |
integer | Yes | Load space quantity. Must be an integer greater than 0. |
loadingSpace.name | string | Yes | Load space name. |
loadingSpace.type | string | No | Load space type. One of the following values may be set:
– vehicle. |
loadingSpace.parts | array | Yes | Load space parts board. E.g. a set will have two parts |
loadingSpace.part. length |
number | Yes | Load space part length. Must be greater than 0. |
loadingSpace.part. width |
number | Yes | Load space part width. Must be greater than 0. |
loadingSpace.part. height |
number | Yes | Load space part height. Must be greater than 0. |
loadingSpace.part. limit |
number | Yes | Load space part load capacity. Must be greater than or equal to 0. |
loadinSpace.part. axis |
array | No | Load space axles board. If indicated, it must include exactly two elements. |
loadingSpace.part. axi.distanceFromSpaceFront |
number | Yes | Axle distance from the beginning of the load space. |
loadingSpace.part. axi.emptySpaceLoad |
number | Yes | Axle load with an empty load space. The value must be a number greater than or equal to 0. |
loadingSpace.part. axi.maxLoad |
number | Yes | The highest permissible axle load. The value must be a number greater than or equal to 0. |
loadingSpace.stops | array | No | A series of stops. |
loadingSpace.stop.id | number | Yes | Stop identifier. |
loadingSpace.stop.name | string | Yes | Stop name |
loadingSpace.stop.address | string | No | Stop address |
loadingSpace.stop.city | string | No | Stop city |
loadingSpace.stop.country | string | No | Stop country |
loadingSpace.stop.postalCode | string | No | Stop postal code |
loadingSpace.stop.coordinates | string | No | Stop location coordinates |
loadingSpace.stop.coordinates.lat | number | Yes | Stop latitude |
loadingSpace.stop.coordinates.lon | number | Yes | Stop longitude |
options | json | Yes | Calculation options |
options.allowOverweight | boolean | No | Setting the value as true will result in not distributing the loads in the load space if the weight exceeds the permissible load capacity. Default value: false. |
options.unit | string | No | Units of the indicated dimensions. One of the two values may be set:
– cm Default value: “cm” |
options.keepLoadsTogether | boolean | No | Setting the value as true will result in distributing the loads from a given group together. Default value: false. |
options.newAlgorithm | boolean | No | Setting the value to true causes the new algorithm to be used. Default value: true. |
options.loadingOrder | string | No | Values: “default” : based on the loads object order “weight” : based on loads’ weight “volume”” based on loads’ volume “priority” : based on loads’ priority |
options.multiStops | boolean | No | Setting the value to false stops the multi from being considered. Default value: false |
Inquiry example
{ "loads": [ { "id": 12, "quantity": 2, "name": "test load 1", "length": 120, "width": 80, "height": 100, "weight": 100, "priority": 0, "stacking": true, "allowToRotate": true, "origin": { "id": 1, "name": "stop 1" }, "destination": { "id": 3, "name": "stop 3" }, "pctSupport": 90, "alongFlooor": true, "maxWeightOnTop": 100, "boxesBelowAllowed": [2] }, { "id": 2, "quantity": 3, "name": "test load 2", "length": 100, "width": 60, "height": 20, "weight": 100, "priority": 0, "stacking": 2, "allowToRotate": true, "origin": { "id": 1, "name": "stop 1" }, "destination": { "id": 2, "name": "stop 2" } } ], "loadingSpaces": [ { "quantity": 1, "name": "test truck 2", "stops": [ { "id": 1, "name": "stop 1" }, { "id": 2, "name": "stop 2" }, { "id": 3, "name": "stop 3" } ], "parts": [ { "length": 1300, "width": 200, "height": 200, "limit": 24000, "axis": [ { "distanceFromSpaceFront": -200, "emptySpaceLoad": 800, "maxLoad": 10000 }, { "distanceFromSpaceFront": 1000, "emptySpaceLoad": 800, "maxLoad": 10000 } ] } ], "type": "vehicle" } ], "options": { "allowOverweight": false, "unit": "cm", "keepLoadsTogether": false, "newAlgorithm": true, "multiStops": true } }
Response
Http status | Description |
---|---|
200 | The calculation result is returned |
400 | Input data validation error |
401 | Authorisation error |
429 | Allowed number of inquires has been exceeded |
Response Body
Name | Type | Value |
---|---|---|
loadingSpaces | array | Load space board |
loadingSpace.id | integer | Load space identifier |
loadingSpace.name | string | Load space name. |
loadingSpace.type | string | Load space type: “vehicle” “sea” “air x” “air y” “pallet” |
loadingSpace.parts | array | Load space parts board. E.g. a set will have two parts. |
loadingSpace.part.length | number | Load space part length. |
loadingSpace.part.width | number | Load space part width. |
loadingSpace.part.height | number | Load space part height. |
loadingSpace.part.limit | number | Load space part load capacity. |
loadinSpace.part.axis | array | Load space axles board. |
loadingSpace.part. axi.distanceFromSpaceFront | number | Axle distance from the beginning of the load space. |
loadingSpace.part. axi.emptySpaceLoad |
number | Axle load with an empty load space. |
loadingSpace.part. axi.maxLoad |
number | The highest permissible axle load. |
loadingSpace.part. axi.addedLoad |
number | Axle load of the distributed loads.
|
loadingSpace.part.loads | array | Loads stowed in a particular part of the load compartment (single stop). |
loadingSpace.part.stops | array | Stops indicate a particular part of the load compartment (multi stop). |
loadinfSpace.part.stop.stopId | number | Stop identifier. |
loadingSpace.part.stop.name | string | Stop name. |
loadingSpace.part.stop.summary | json | Summary for a given load space part. |
loadingSpace.part.stop.summary.occupiedLdm | number | Occupied Idm. |
loadingSpace.part.stop.summary.freeLdm | number | Free ldm. |
loadingSpace.part.stop.summary.occupiedSurface | number | Occupied area. |
loadingSpace.part.stop.summary.freeSurface | number | Free area. |
loadingSpace.part.stop.summary.occupiedVolume | number | Occupied volume. |
loadingSpace.part.stop.summary.freeVolume | number | Free volume. |
loadingSpace.part.stop.summary.percentLdmUsd | number | Loading meter used (percent). |
loadingSpace.part.stop.summary.percentVolumeUsd | number | Volume used (percent). |
loadingSpace.part.stop.loads | json | Loads specified in a given part of the loading space at a given stop. |
loadingSpace.part.load.id | number | Load identifier |
loadingSpace.part.load.allowToRotate | boolean | Value indicated for the free rotation option. |
loadingSpace.part.load.quantity | integer | Quantity of loads from a given group distributed in a given space part. |
loadingSpace.part.load.name | string | Load name |
loadingSpace.part.load.priority | integer | Load priority |
loadingSpace.part.load.weight | number | One load weight. |
loadingSpace.part.load.length | number | Basic load length. |
loadingSpace.part.load.width | number | Basic load width. |
loadingSpace.part.load.height | number | Basic load height. |
loadingSpace.part.load.stacking | boolean / integer | Value set for stacking the load |
loadingSpace.part.load.placement | array | Board with the distribution of loads in a given load space part. |
loadingSpace.part.load.placement.length | number | Distributed load length. The values of length and width may be replaced in relation to the basic values, if the allowToRotate option is set as true. |
loadingSpace.part.load.placement.width | number | Distributed load width. |
loadingSpace.part.load.placement.height | number | Distributed load height. |
loadingSpace.part.load.placement.position | json | Load position in the load space part. Looking from the beginning of the space, position x: 0, y: 0, z: 0 is the right lower corner of the space.
Assumed axle indication:
|
loadingSpace.part.load.placement.position.x | number | Position on the x axle |
loadingSpace.part.load.placement.position.y | number | Position on the y axle |
loadingSpace.part.load.placement.position.z | number | Position on the z axle |
loadingSpace.part.load.placement.loadsPerAxis | json | Quantity of loads distributed along a given axle |
loadingSpace.part.load.placement.loadsPerAxis.x | integer | Quantity of loads along the x axle. |
loadingSpace.part.load.placement.loadsPerAxis.y | integer | Quantity of loads along the y axle. |
loadingSpace.part.load.placement.loadsPerAxis.z | integer | Quantity of loads along the z axle. |
loadingSpace.part.summary | json | Summary for a given load space part. |
loadingSpace.part.summary.occupiedLdm | number | Occupied Idm |
loadingSpace.part.summary.freeLdm | number | Free ldm |
loadingSpace.part.summary.occupiedSurface | Occupied space | |
loadingSpace.part.summary.freeSurface | number | Free space |
loadingSpace.part.summary.occupiedVolume | number | Occupied volume |
loadingSpace.part.summary.freeVolume | number | Free volume |
notFittedLoads | array | Loads which did not fit in any load space |
notFittedLoad.id | number | Loads identifier |
notFittedLoad.length | number | Loads length |
notFittedLoad.width | number | Loads width |
notFittedLoad.height | number | Loads height |
notFittedLoad.weight | number | One load weight |
notFittedLoad.quantity | integer | Loads quantity |
notFittedLoad.priority | integer | Priority |
notFittedLoad.name | string | Loads name |
notFittedLoad.stacking | boolean / integer | Value set for stacking the load |
notFittedLoad.allowToRotate | boolean | Value indicated for the free rotation option |
options | json | Calculation options |
options.allowToOverweight | boolean | Value set for the option allowing for exceeding the maximum load capacity. |
options.unit | string | Unit set |
options.keepLoadsTogether | boolean | Value set for the option keeping the loads from a given group together. |
_links | array | Further possible actions board |
link.rel | string | relation |
link.href | string | address |
Answer example
{ "loadingSpaces": [ { "id": 1, "name": "test truck 2", "parts": [ { "height": 200, "length": 1300, "width": 200, "limit": 24000, "loads": [], "stops": [ { "name": "stop 1", "id": 1, "loads": [ { "id": 10012, "allowToRotate": true, "stacking": null, "name": "test load 1", "loadType": 0, "priority": 0, "quantity": 2, "width": 100, "length": 80, "height": 120, "weight": 100, "diameter": 0, "origin": { "id": 1, "name": "stop 1" }, "destination": { "id": 3, "name": "stop 3" }, "placement": [ { "height": 120, "length": 80, "width": 100, "loadsPerAxis": { "x": 1, "y": 1, "z": 1 }, "position": { "x": 0, "y": 0, "z": 0 } }, { "height": 120, "length": 80, "width": 100, "loadsPerAxis": { "x": 1, "y": 1, "z": 1 }, "position": { "x": 100, "y": 0, "z": 0 } } ] }, { "id": 10002, "allowToRotate": true, "stacking": 2, "name": "test load 2", "loadType": 0, "priority": 0, "quantity": 3, "width": 100, "length": 20, "height": 60, "weight": 100, "diameter": 0, "origin": { "id": 1, "name": "stop 1" }, "destination": { "id": 2, "name": "stop 2" }, "placement": [ { "height": 60, "length": 20, "width": 100, "loadsPerAxis": { "x": 1, "y": 1, "z": 1 }, "position": { "x": 0, "y": 0, "z": 80 } }, { "height": 60, "length": 20, "width": 100, "loadsPerAxis": { "x": 1, "y": 1, "z": 1 }, "position": { "x": 100, "y": 0, "z": 80 } }, { "height": 60, "length": 20, "width": 100, "loadsPerAxis": { "x": 1, "y": 1, "z": 1 }, "position": { "x": 0, "y": 0, "z": 100 } } ] } ] }, { "name": "stop 2", "id": 2, "loads": [ { "id": 10012, "allowToRotate": true, "stacking": null, "name": "test load 1", "loadType": 0, "priority": 0, "quantity": 2, "width": 100, "length": 80, "height": 120, "weight": 100, "diameter": 0, "origin": { "id": 1, "name": "stop 1" }, "destination": { "id": 3, "name": "stop 3" }, "placement": [ { "height": 120, "length": 80, "width": 100, "loadsPerAxis": { "x": 1, "y": 1, "z": 1 }, "position": { "x": 0, "y": 0, "z": 0 } }, { "height": 120, "length": 80, "width": 100, "loadsPerAxis": { "x": 1, "y": 1, "z": 1 }, "position": { "x": 100, "y": 0, "z": 0 } } ] } ] }, { "name": "stop 3", "id": 3, "loads": [] } ], "summary": { "freeLdm": 1300, "occupiedLdm": 0, "freeSurface": 26000000, "occupiedSurface": 0, "freeVolume": 520000000000, "occupiedVolume": 0 }, "axis": [ { "distanceFromSpaceFront": -200, "emptySpaceLoad": 800, "maxLoad": 10000, "addedLoad": 545.83 }, { "distanceFromSpaceFront": 1000, "emptySpaceLoad": 800, "maxLoad": 10000, "addedLoad": 154.17 } ] } ], "type": "vehicle" } ], "notFittedLoads": [], "options": { "allowOverweight": false, "unit": "cm", "keepLoadsTogether": false, "newAlgorithm": true, "multiStops": true, "arrangeOptimally": false, "userOrder": false, "additionOrder": false, "volumeOrder": false, "weightOrder": false, "keepGroupsInGivenSpaces": false, "isMagnetOn": false }, "_links": [ { "rel": "preview", "href": "http://localhost:4200/session?id=07d695ae-4ce2-47fb-98da-295c1ad87d6a" } ] }