Documentation

Last update: June 16, 2024

packToMixedBins

Efficiently pack items using multiple bin sizes.

PackToMixedBins provides detailed information per item in each bin, such as how to rotate the item and where to place it. In contrast to packToBin, packToMixedBins accepts multiple bin sizes as input and uses these different bins to find a packing solution that aims to reduce the total packing volume or the total required bins.


Connectivity

URL https://www.packing-optimizer.com/api/packToMixedBins
Method POST

Headers

Authorization Basic-Auth
API credentials as found on your Account Settings page.
Content-Type application/json

Query string options

Optional
includeBins 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/packToMixedBins?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/packToMixedBins?includeItems=false
responsePrecision Sets the decimal precision of the response body.
Default: 3
Example: api/packToMixedBins?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/packToMixedBins?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[].nrOfAvailableBins numeric Optional The number of times this bin can be used.
Default: unlimited
Example: 3
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
bins[].cost numeric Optional The cost of using this bin.
Default: 0
Example: 1000

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:
0 No rotation
1 Allowed to rotate around the z-axis by 90°
2 Allowed to rotate around the x-axis by 90°
3 Allowed to rotate around the x-axis by 90° and then around the z-axis by 90°
4 Allowed to rotate around the y-axis by 90°
5 Allowed to rotate around the z-axis by 90° and then around the x-axis by 90°
items[].stackingStyle string Optional Enforce a particular stacking style for this item.
Default:  allowAll
Example: bottomNoItemsOnTop
Options:
allowAll No particular stacking style is being taken into account while placing this item.
bottomNoItemsOnTop The item will be placed at the bottom of the bin and cannot be placed on top of another item. It is not allowed to place any other item (partly) on top of this item. This item will always be the first to be evaluated when packing, meaning that this setting takes precedence over the order determined by bin.sortMethod.
stackByKey The item will either be placed on the ground, or on top of an item with the same stackingKey. This item will always be the first to be evaluated when packing (only bottomNoItemsOnTop items take precedence), meaning that this setting takes precedence over the order determined by bin.sortMethod.
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

Config

Optional

Additional parameters that influence packing behaviour.

Field Type Description
config.minimizationStrategy string Determines which value should be minimized during packing.
If bins, the number of required bins will be minimized.
If cost, the total cost of the bins used will be minimized.
If volume, the total bin volume will be minimized.
Default: volume
Options: volume, bins, or cost
   
{
    "bins": [{
            "type": "pallet-high",
            "width": 1.2,
            "depth": 0.8,
            "height": 1.65,
            "maxWeight": 1500
        },
        {
            "type": "pallet-low",
            "width": 1.2,
            "depth": 0.8,
            "height": 0.8,
            "maxWeight": 1500
        }
    ],
    "items": [{
            "id": "item-1",
            "width": 1.2,
            "depth": 0.8,
            "height": 0.6,
            "weight": 10
        },
        {
            "id": "item-2",
            "width": 1.2,
            "depth": 0.8,
            "height": 0.6,
            "weight": 10
        },
        {
            "id": "item-3",
            "width": 1.2,
            "depth": 0.8,
            "height": 0.6,
            "weight": 10
        },
        {
            "id": "item-4",
            "width": 0.2,
            "depth": 0.5,
            "height": 0.8,
            "weight": 1
        },
        {
            "id": "item-5",
            "width": 0.26,
            "depth": 0.46,
            "height": 0.81,
            "weight": 10
        }
    ],
    "config": {
        "minimizationStrategy": "volume"
    }
}

Response body

The packing response body follows a certain hierarchy, this hierarchy can be categorized in 3 sections.

  1. Header information - These details reason across all the bins that have been packed.
  2. Bin information - These details are about a particular bin that has been packed.
  3. 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.
totalCost numeric The total cost of the packed bins, only relevant if cost is used.
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.

Field Type Description
packedBins[] array Contains the bins that have been packed.
packedBins[].id numeric Incrementing counter starting from 1. Generated by Packing Optimizer.
packedBins[].type string The type of bin as provided by the caller in the request body.
packedBins[].width numeric The maximum width of the bin as provided by the caller in the request body.
packedBins[].depth numeric The maximum depth of the bin as provided by the caller in the request body.
packedBins[].height numeric The maximum height of the bin as provided by the caller in the request body.
packedBins[].maxVolume numeric The maximum volume of the bin.
packedBins[].actualVolume numeric Total volume of the items packed in the bin.
packedBins[].actualVolumeUtil numeric actualVolume expressed in percentage points relative to the maxVolume attribute.
packedBins[].maxWeight numeric The maximum weight of the bin as provided by the caller in the request body.
packedBins[].actualWeight numeric Total weight of the items packed in the bin.
packedBins[].actualWeightUtil numeric actualWeight expressed in percentage points relative to the maxWeight attribute.
packedBins[].value numeric Total value of the items packed in the bin.
packedBins[].maxValue numeric The maximum value of the bin as provided by the caller in the request body.
packedBins[].cost numeric The cost of this bin as provided by the caller in the request body.
packedBins[].costPerPackedVolumeUnit numeric The cost it takes to pack one volume unit.
This is equal to cost divided by actualVolume.
packedBins[].furthestPointWidth numeric The furthest point alongside the x axis that any item is reaching.
packedBins[].furthestPointDepth numeric The furthest point alongside the y axis that any item is reaching.
packedBins[].furthestPointHeight numeric The furthest point alongside the z axis that any item is reaching.
packedBins[].nrOfItems numeric The total number of items packed inside the bin.

FittedItems

Contains information about each item that has been packed in the bin.

Field Type Description
packedBins[].fittedItems[] array Contains the items inside the bin.
packedBins[].fittedItems[].id string Item identifier as provided by the caller in the request body.
packedBins[].fittedItems[].width numeric Width of the item.
packedBins[].fittedItems[].depth numeric Depth of the item.
packedBins[].fittedItems[].height numeric Height of the item.
packedBins[].fittedItems[].weight numeric Weight of the item.
packedBins[].fittedItems[].volume numeric Volume of the item.
packedBins[].fittedItems[].value numeric Value of the item.
packedBins[].fittedItems[].stackingStyle string The stacking style used during packing.
packedBins[].fittedItems[].consolidationKey string Item consolidation key used during packing.
packedBins[].fittedItems[].allowedRotations string Rotations that were allowed during packing.
packedBins[].fittedItems[].xCoordinate numeric X coordinate of the item inside the bin.
packedBins[].fittedItems[].yCoordinate numeric Y coordinate of the item inside the bin.
packedBins[].fittedItems[].zCoordinate numeric Z coordinate of the item inside the bin.
packedBins[].fittedItems[].rotationType numeric Type of rotation that has been used to pack this item.
packedBins[].fittedItems[].rotationTypeDescription string Rotation description.
   
{
    "packedBins": [
        {
            "actualVolume": 1.248876,
            "actualVolumeUtil": 78.84318,
            "actualWeight": 30.0,
            "actualWeightUtil": 2.0,
            "depth": 0.8,
            "fittedItems": [
                {
                    "allowedRotations": "012345",
                    "depth": 0.8,
                    "height": 0.6,
                    "id": "DTM034",
                    "rotationType": 0,
                    "rotationTypeDescription": "No rotation",
                    "stackingStyle": "allowAll",
                    "volume": 0.576,
                    "weight": 10.0,
                    "width": 1.2,
                    "xCoordinate": 0.0,
                    "yCoordinate": 0.0,
                    "zCoordinate": 0.0
                },
                {
                    "allowedRotations": "012345",
                    "depth": 0.8,
                    "height": 0.6,
                    "id": "DTM035",
                    "rotationType": 0,
                    "rotationTypeDescription": "No rotation",
                    "stackingStyle": "allowAll",
                    "volume": 0.576,
                    "weight": 10.0,
                    "width": 1.2,
                    "xCoordinate": 0.0,
                    "yCoordinate": 0.0,
                    "zCoordinate": 0.6
                },
                {
                    "allowedRotations": "012345",
                    "depth": 0.81
                    "height": 0.46,
                    "id": "DTM034",
                    "rotationType": 3,
                    "rotationTypeDescription": "Rotate around the x-axis by 90° and then around the z-axis by 90°",
                    "stackingStyle": "allowAll",
                    "volume": 0.096876,
                    "weight": 10.0,
                    "width": 0.26,
                    "xCoordinate": 0.0,
                    "yCoordinate": 0.0,
                    "zCoordinate": 1.2
                }
            ],
            "furthestPointDepth": 0.8
            "furthestPointHeight": 1.46,
            "furthestPointWidth": 1.2,
            "height": 1.65,
            "id": 1,
            "maxVolume": 1.584,
            "maxWeight": 1500.0,
            "nrOfItems": 3,
            "type": "pallet-high",
            "width": 1.2
        },
        {
            "actualVolume": 0.656,
            "actualVolumeUtil": 85.41667,
            "actualWeight": 20.0,
            "actualWeightUtil": 1.333333,
            "depth": 0.8,
            "fittedItems": [
                {
                    "allowedRotations": "012345",
                    "depth": 0.8,
                    "height": 0.6,
                    "id": "DTM035",
                    "rotationType": 0,
                    "rotationTypeDescription": "No rotation",
                    "stackingStyle": "allowAll",
                    "volume": 0.576,
                    "weight": 10.0,
                    "width": 1.2,
                    "xCoordinate": 0.0,
                    "yCoordinate": 0.0,
                    "zCoordinate": 0.0
                },
                {
                    "allowedRotations": "012345",
                    "depth": 0.8,
                    "height": 0.5,
                    "id": "DTM034",
                    "rotationType": 2,
                    "rotationTypeDescription": "Rotate around the x-axis by 90°",
                    "stackingStyle": "allowAll",
                    "volume": 0.08,
                    "weight": 10.0,
                    "width": 0.2,
                    "xCoordinate": 0.0,
                    "yCoordinate": 0.0,
                    "zCoordinate": 0.6
                }
            ],
            "furthestPointDepth": 0.8,
            "furthestPointHeight": 0.8,
            "furthestPointWidth": 1.2,
            "height": 0.8,
            "id": 2,
            "maxVolume": 0.768,
            "maxWeight": 1500.0,
            "nrOfItems": 2,
            "type": "pallet-low",
            "width": 1.2
        }
    ],
    "requiredNrOfBins": 2,
    "totalVolumeUtil": 82.12992,
    "totalWeightUtil": 1.666667
}