Documentation
Last update: June 16, 2024packToBin
Pack your items into a specific type of bin.
The PackToBin endpoint packs your items into the bin provided, creating as many bins as needed to fulfill the complete packing request. The packing result provides detailed information per item in each bin, such as how to rotate the item and where to place it.
Connectivity
URL | https://www.packing-optimizer.com/api/packToBin |
Method | POST |
Headers
Authorization | Basic-Auth API credentials as found on your Account Settings page. |
Content-Type | application/json |
Query string options
OptionalincludeBins |
If false, the individual bins will not be included in the response and only
header information will be transmitted. Default: true Options: true or false Example: api/packToBin?includeBins=false |
includeItems |
If false, the individual item information per bin will not be included in the
response. Default: true Options: true or false Example: api/packToBin?includeItems=false |
responsePrecision |
Sets the decimal precision of the response body. Default: 3 Example: api/packToBin?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/packToBin?itemDimensionsAfter=rotated |
Request body
Bin
Information about the bin that will be used for packing.
Field | Type | Description |
---|---|---|
bin.type | string | Type of bin that is used for packing. Example: pallet |
bin.width | numeric | Width of the bin. Example: 1.2 |
bin.depth | numeric | Depth of the bin. Example: 0.80 |
bin.height | numeric | Height of the bin. Example: 1.65 |
bin.maxWeight | numeric | Max weight that a single bin can carry.
Example: 1500 |
bin.nrOfAvailableBins | numeric |
Optional
The number of times this bin can be used. Default: unlimited Example: 3 |
bin.itemLimit | numeric |
Optional
Maximum number of items that a bin is allowed to fit. Default: unlimited Example: 5 |
bin.maxValue | numeric |
Optional
Maximum value that a bin is allowed to contain. Default: unlimited Example: 1000 |
bin.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 |
bin.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 |
bin.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[].consolidationKey | string | Optional
Items with the same consolidation key will be separated from the other items and
grouped in their own bin. Items with different consolidation key values will never be
grouped in the same bin. Items with no key will group together by default. Default: None Example: customerX |
||||||||||||
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 |
{
"bin": {
"type": "Pallet",
"width": 1.2,
"depth": 0.8,
"height": 1.65,
"maxWeight": 1500
},
"items": [{
"id": "DTM001",
"width": 0.1,
"height": 1.62,
"depth": 0.2,
"weight": 1000,
"consolidationKey": "X123",
"allowedRotations": "01"
},
{
"id": "DTM002",
"width": 0.29,
"height": 0.32,
"depth": 0.49,
"weight": 500
},
{
"id": "DTM003",
"width": 0.29,
"height": 0.32,
"depth": 0.49,
"weight": 10,
"consolidationKey": "X123",
"allowedRotations": "01"
},
{
"id": "DTM004",
"width": 0.29,
"height": 0.32,
"depth": 0.49,
"weight": 10
},
{
"id": "DTM006",
"width": 0.29,
"height": 0.32,
"depth": 0.49,
"weight": 10,
"allowedRotations": "012345"
},
{
"id": "DTM007",
"width": 0.29,
"height": 0.32,
"depth": 0.49,
"weight": 10
},
{
"id": "DTM008",
"width": 0.19,
"height": 0.22,
"depth": 0.29,
"weight": 10,
"consolidationKey": "X123",
"allowedRotations": "01"
}
]
}
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.
FittedItems
Contains information about each item that has been packed in the bin.
{
"requiredNrOfBins": 2,
"totalVolumeUtil": 45.9,
"totalWeightUtil": 81.7,
"packedBins": [
{
"id": 1,
"type": "Pallet",
"width": 1.2,
"depth": 0.8,
"height": 1.65,
"maxVolume": 1.584,
"actualVolume": 0.42101,
"actualVolumeUtil": 26.6,
"maxWeight": 1500.0,
"actualWeight": 1200.0,
"actualWeightUtil": 80.0,
"furthestPointWidth": 0.79,
"furthestPointDepth": 0.59,
"furthestPointHeight": 1.14,
"nrOfItems": 2,
"fittedItems": [
{
"id": "DTM002",
"width": 0.79,
"depth": 0.49,
"height": 0.62,
"weight": 500.0,
"volume": 0.2,
"xCoordinate": 0,
"yCoordinate": 0,
"zCoordinate": 0,
"allowedRotations": "012345",
"rotationType": 0,
"rotationTypeDescription": "No rotation",
"stackingStyle": "allowAll"
},
{
"id": "DTM004",
"width": 0.59,
"depth": 0.59,
"height": 0.52,
"weight": 700.0,
"volume": 0.18101,
"xCoordinate": 0,
"yCoordinate": 0,
"zCoordinate": 0.62,
"allowedRotations": "012345",
"rotationType": 0,
"rotationTypeDescription": "No rotation",
"stackingStyle": "allowAll"
}
]
},
{
"id": 2,
"type": "Pallet",
"width": 1.2,
"depth": 0.8,
"height": 1.65,
"maxVolume": 1.584,
"actualVolume": 1.03237,
"actualVolumeUtil": 65.2,
"maxWeight": 1500.0,
"actualWeight": 1250.0,
"actualWeightUtil": 83.3,
"furthestPointWidth": 0.99,
"furthestPointDepth": 0.79,
"furthestPointHeight": 1.32,
"nrOfItems": 1,
"fittedItems": [
{
"id": "DTM003",
"width": 0.99,
"depth": 0.79,
"height": 1.32,
"weight": 1250.0,
"volume": 1.03237,
"consolidationKey": "X123",
"xCoordinate": 0,
"yCoordinate": 0,
"zCoordinate": 0,
"allowedRotations": "01",
"rotationType": 0,
"rotationTypeDescription": "No rotation.",
"stackingStyle": "allowAll"
}
]
}
]
}