Documentation
Last update: June 16, 2024selectBin
Select the best fitting bin.
The selectBin endpoint requires bin size and item information as input and returns the smallest possible bin in which the items can be packed. A bin is considered to be a match when all provided items can fit in a single bin.
Connectivity
URL | https://www.packing-optimizer.com/api/selectBin |
Method | POST |
Headers
Authorization | Basic-Auth API credentials as found on your Account Settings page. |
Content-Type | application/json |
Query string options
OptionalincludeItems |
If false, the individual item information per bin will not be included in the
response. Default: true Options: true or false Example: api/selectBin?includeItems=false |
responsePrecision |
Sets the decimal precision of the response body. Default: 3 Example: api/selectBin?responsePrecision=5 |
itemDimensionsAfter |
If rotated, the item dimensions in the response message will be adjusted according
to the rotation type. Default: original Options: original or rotated Example: api/selectBin?itemDimensionsAfter=rotated |
Request body
Bins
Information about the bin that will be used for packing.
Field | Type | Description |
---|---|---|
bins[].type | string | Type of bin that is used for packing. Example: pallet |
bins[].width | numeric | Width of the bin. Example: 1.2 |
bins[].depth | numeric | Depth of the bin. Example: 0.80 |
bins[].height | numeric | Height of the bin. Example: 1.65 |
bins[].maxWeight | numeric | Max weight that a single bin can carry.
Example: 1500 |
bins[].itemLimit | numeric |
Optional
Maximum number of items that a bin is allowed to fit. Default: unlimited Example: 5 |
bins[].maxValue | numeric |
Optional
Maximum value that a bin is allowed to contain. Default: unlimited Example: 1000 |
bins[].sortMethod | string |
Optional
Allows you to control the order in which the items are evaluated for packing. If weight, the heaviest items are evaluated first. If volume, the biggest items are evaluated first. If optimized, a custom order is used to increase bin utilization. Default: optimized Options: weight, volume, or optimized |
bins[].gravityStrength | numeric |
Optional Allows you to enforce that a
certain bottom surface area percentage of an item must be
resting on top of another surface in order to be a valid position. For example, a
gravityStrength of 75 would mean that atleast three quarters of an item must be resting on top of
another surface. Recommended value is 0 until encountered otherwise. Default: 0 Options: between 0 and 100 |
bins[].packingDirection | string |
Optional
Sets the packing direction of the bin. For example, boxes on a pallet are
usually placed bottom first, stacking upwards when needed. A container with a closed top, however,
would be stacked back to front. Default: bottomUp Options: bottomUp or backToFront |
Items
Information about the items that have to be packed.
Field | Type | Description | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
items[].id | string | id to identify individual items. Example: ITEM001 |
||||||||||||
items[].width | numeric | Width of the item. Example: 0.20 |
||||||||||||
items[].depth | numeric | Depth of the item. Example: 0.10 |
||||||||||||
items[].height | numeric | Height of the item. Example: 0.65 |
||||||||||||
items[].weight | numeric | Weight of the item. Example: 10 |
||||||||||||
items[].value | numeric |
Optional
The value of the item. Default: 0 Example: 10 |
||||||||||||
items[].gravityStrength | numeric |
Optional Same as bin.gravityStrength,
item level gravityStrength takes precedence
over bin
level
gravityStrength. Default: 0 Options: between 0 and 100 |
||||||||||||
items[].allowedRotations | string |
Optional Indicates the way that an item
is allowed to rotate while packing. Default: 012345 Example: 015 Options:
|
||||||||||||
items[].stackingStyle | string |
Optional
Enforce a particular stacking style for this item. Default: allowAll Example: bottomNoItemsOnTop Options:
|
||||||||||||
items[].stackingKey | string |
Optional
Requires a items[].stackingStyle of stackByKey. Only items with the same stacking key are allowed to be stacked on top of each other. Default: None Example: productTypeA |
{
"bins": [{
"type": "box-large",
"width": 0.40,
"depth": 0.40,
"height": 0.40,
"maxWeight": 15
},
{
"type": "box-medium",
"width": 0.30,
"depth": 0.30,
"height": 0.30,
"maxWeight": 10
},
{
"type": "box-small",
"width": 0.10,
"depth": 0.07,
"height": 0.07,
"maxWeight": 7.5
}
],
"items": [{
"id": "i1",
"width": 0.05,
"depth": 0.05,
"height": 0.05,
"weight": 1
},
{
"id": "i2",
"width": 0.05,
"depth": 0.05,
"height": 0.05,
"weight": 1
},
{
"id": "i3",
"width": 0.30,
"depth": 0.30,
"height": 0.15,
"weight": 1
},
{
"id": "i4",
"width": 0.15,
"depth": 0.15,
"height": 0.15,
"weight": 1
}
]
}
Response body
The packing response body follows a certain hierarchy, this hierarchy can be categorized in 3 sections.
- Header information - These details reason across all the bins that have been packed.
- Bin information - These details are about a particular bin that has been packed.
- Item information - These are details about a particular item. Items are nested inside bins.
Header
Contains header information about the complete packing request.
Field | Type | Description |
---|---|---|
requiredNrOfBins | numeric | The total number of bins it requires to pack all items. |
totalVolumeUtil | numeric | The total volume utilization in percentage points. |
totalWeightUtil | numeric | The total weight utilization in percentage points. |
unfittedItems[] | array | Array of items that did not fit. Items in this array have the same attributes as items in packedBins[].fittedItems[]. |
PackedBins
Contains information about each bin that has been packed.
Information: The packedBins[] array of a selectBin request will only contain one value,
which is the chosen bin. However, if none of the bins were found to fit, the response body will exist of
only an empty packedBins array.
FittedItems
Contains information about each item that has been packed in the bin.
{
"requiredNrOfBins": 1,
"totalVolumeUtil": 51.02,
"totalWeightUtil": 26.667,
"packedBins": [
{
"id": 1,
"type": "box-small"
"width": 0.1,
"depth": 0.07,
"height": 0.07,
"maxVolume": 0.00049,
"actualVolume": 0.00025,
"actualVolumeUtil": 51.02,
"maxWeight": 7.5,
"actualWeight": 2,
"actualWeightUtil": 26.667,
"furthestPointWidth": 0.10,
"furthestPointDepth": 0.05,
"furthestPointHeight": 0.05,
"nrOfItems": 2,
"fittedItems": [
{
"allowedRotations": "012345",
"depth": 0.05,
"height": 0.05,
"id": "i2",
"rotationType": 0,
"rotationTypeDescription": "No rotation",
"stackingStyle": "allowAll",
"volume": 0.000125,
"weight": 1,
"width": 0.05,
"xCoordinate": 0,
"yCoordinate": 0,
"zCoordinate": 0
},
{
"allowedRotations": "012345",
"depth": 0.05,
"height": 0.05,
"id": "i1",
"rotationType": 0,
"rotationTypeDescription": "No rotation",
"stackingStyle": "allowAll",
"volume": 0.000125,
"weight": 1,
"width": 0.05,
"xCoordinate": 0.05,
"yCoordinate": 0,
"zCoordinate": 0
}
],
}
]
}