The Case Study Innovations Logo
Contact Us
Packem Logo

Faster.Leaner.Smarter.

💡
Modify the input payload and click Run to send it to our live API. View the raw JSON result or see the generated visual packing layout.
The first run may be a bit slow — we're just warming up.
Quick guidance

This is a live connection to our Packem API. You can modify Request Input to test different configurations.

The Raw Request Output shows the structured JSON solution, while the Visual Request Output renders the packing layout.

1. Items and Bins

  • Items: Each item must have id, length, width, and height (double).
    • Optional: weight (double), label (string).
  • Bins: Each bin must have id. For most objectives, bins should also include length, width, and height (double).
    • Optional: fixed_cost (double), tare_weight (double), quantity (integer).
"items": [
  {"id": "I-001", "length": 5.0, "width": 4.0, "height": 3.0, "weight": 1.2, "label": "Food"},
  {"id": "I-002", "length": 2.0, "width": 4.0, "height": 4.0}
],
"bins": [
  {"id": "B-001", "length": 10.0, "width": 10.0, "height": 10.0, "fixed_cost": 2.0, "tare_weight": 0.2, "quantity": 2}
]

2. Objectives

The objective (string) field controls what the packing algorithm tries to optimize. Supported options:

  • minimise_bins: Use the smallest number of bins possible.
  • minimise_unused_space: Minimize empty space inside used bins.
  • maximise_items: Fit as many items as possible into limited bins.
  • minimise_bin_costs: Optimize packing to minimize total bin fixed cost (fixed_cost).
  • minimise_total_cost: Optimize packing to minimize total shipping cost using cost_model.
  • minimise_bounding_box: Find the smallest bounding box that can contain all items (bins can be omitted).
  • minimise_missing_height: Given fixed base (length/width), find the minimum required height (bin height can be omitted).
"objective": "maximise_items"

3. Constraints

The constraints (object) field defines the rules and restrictions the packing algorithm must follow.

3.1 Rotation

Field: rotation (boolean, optional) determines if items are allowed to rotate.
If omitted, rotation is allowed by default.

"rotation": false

3.2 Fragility

Field: fragility (array of item IDs) specifies which items are fragile. Fragile items should not have other items stacked on top of them.

"fragility": ["I-001", "I-003"]

3.3 Weight Distribution

Field: weight_distribution (object) controls how weight is distributed within bins.
Weights are read from each item’s weight field (if omitted, weight defaults to 0). Subfields include:

  • max_per_layer (double): limits total weight per horizontal layer.
  • footprint (double): limits vertical load per footprint/cell.
  • center_of_gravity (boolean): enforces stable center-of-gravity support.
  • min_support_ratio (double in [0,1]): requires a minimum supported base area fraction.
"weight_distribution": {
  "max_per_layer": 20.0,
  "footprint": 5.0,
  "center_of_gravity": true,
  "min_support_ratio": 0.7
}

3.4 Forbidden Adjacency

Field: forbidden_adjacency (array of item label pairs) defines which categories of items cannot be packed together in the same bin.
Categories are taken from each item’s label (if omitted, the label defaults to "default").

"forbidden_adjacency": [["Alcohol", "Explosives"], ["Raw meat", "Fresh produce"]]

3.5 Priority Items

Field: priority (array of item IDs) indicates items that should be packed first or given higher priority.

"priority": ["I-001"]

4. Cost Model (for minimise_total_cost only)

Instead of extra, the current API uses a cost_model object when objective = "minimise_total_cost".

  • ship_base (double): base shipping cost per used bin.
  • ship_rate_per_kg (double): cost per kg (uses item weights + bin tare weight if provided).
  • dim_divisor (double): dimensional weight divisor (0 disables dimensional weight).
  • dunnage_cost_per_volume (double): penalty per unit unused volume.
"cost_model": {
  "ship_base": 0.6,
  "ship_rate_per_kg": 1.1,
  "dim_divisor": 400.0,
  "dunnage_cost_per_volume": 0.02
}
Request Input
Request Output
// Raw output will appear here.
Visual Output
💡 Tap here to share feedback!

We use cookies to improve analytics, personalize content, and support ads. Choose your preferences below.

Analytics tracking
Personalized content
Targeted ads