Intelligent Packing API
The Intelligent Packing API provides AI-enhanced 3D bin packing with advanced optimization algorithms, multi-objective optimization, and smart constraint handling.
Overview
The Intelligent Packing API extends the standard Packing API with:
- Hybrid AI + OR-Tools optimization engine
- Multi-dimensional constraint solving
- Loading sequence optimization
- Fragile item handling
- Center of gravity calculation
- Stability analysis
Endpoints
Calculate Intelligent Packing
Advanced AI-powered packing calculation with intelligent optimization.
Endpoint:
POST /intelligent-packing/calculateRequest Body:
json
{
"items": [
{
"sku": "FRAGILE-001",
"name": "Glass Product",
"length": 30.0,
"width": 25.0,
"height": 20.0,
"weight": 8.0,
"quantity": 10,
"can_rotate": true,
"stackable": true,
"max_stack_weight": 20.0,
"fragile": true,
"priority": "high",
"load_sequence": "first",
"group_id": "electronics"
},
{
"sku": "HEAVY-001",
"name": "Heavy Item",
"length": 50.0,
"width": 40.0,
"height": 30.0,
"weight": 45.0,
"quantity": 5,
"can_rotate": false,
"stackable": true,
"max_stack_weight": 100.0,
"fragile": false,
"priority": "normal",
"load_sequence": "any"
}
],
"pallets": [
{
"id": "EUR-PALLET",
"length": 120.0,
"width": 80.0,
"height": 200.0,
"max_weight": 1500.0
}
],
"options": {
"optimization_mode": "balanced",
"enable_stability_analysis": true,
"calculate_cog": true,
"respect_load_sequence": true,
"group_items": true,
"max_iterations": 1000,
"time_limit_ms": 5000
}
}Advanced Item Parameters:
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
fragile | boolean | No | false | Mark item as fragile (no heavy items on top) |
priority | string | No | "normal" | Packing priority: "low", "normal", "high" |
load_sequence | string | No | "any" | Loading order preference |
group_id | string | No | null | Group identifier for co-location |
Advanced Options:
| Parameter | Type | Default | Description |
|---|---|---|---|
optimization_mode | string | "balanced" | Optimization strategy |
enable_stability_analysis | boolean | true | Calculate packing stability score |
calculate_cog | boolean | true | Calculate Center of Gravity |
respect_load_sequence | boolean | true | Honor loading/unloading sequence |
group_items | boolean | false | Keep same group items together |
max_iterations | integer | 1000 | Maximum algorithm iterations |
time_limit_ms | integer | 5000 | Calculation time limit |
Optimization Modes:
| Mode | Description | Best For |
|---|---|---|
space | Maximize space utilization | High-volume shipping |
weight | Optimize weight distribution | Heavy cargo |
balanced | Balance space + weight + stability | General purpose |
speed | Fast calculation (near-optimal) | Real-time systems |
stability | Maximum stack stability | Fragile/valuable goods |
Response:
json
{
"success": true,
"data": {
"total_items": 15,
"packed_items": 15,
"unpacked_items": 0,
"total_pallets_used": 1,
"total_volume_utilization": 0.823,
"total_weight_utilization": 0.203,
"optimization_score": 0.947,
"pallets": [
{
"pallet_id": "EUR-PALLET",
"pallet_index": 1,
"items_packed": 15,
"items": [
{
"sku": "HEAVY-001",
"placement": {
"x": 0.0,
"y": 0.0,
"z": 0.0,
"length": 50.0,
"width": 40.0,
"height": 30.0,
"rotation": 0,
"layer": 1
},
"position_in_load_sequence": 1
},
{
"sku": "FRAGILE-001",
"placement": {
"x": 0.0,
"y": 0.0,
"z": 30.0,
"length": 30.0,
"width": 25.0,
"height": 20.0,
"rotation": 1,
"layer": 2
},
"position_in_load_sequence": 6
}
],
"volume_utilization": 0.823,
"weight_utilization": 0.203,
"total_weight": 305.0,
"stability_score": 0.912,
"center_of_gravity": {
"x": 58.5,
"y": 37.2,
"z": 42.8,
"balanced": true
},
"layers": 5
}
],
"analysis": {
"recommendations": [
{
"type": "optimization",
"message": "Consider using smaller pallets for remaining space",
"impact": "low"
}
],
"warnings": [
{
"type": "weight_distribution",
"message": "Weight concentrated in center-left area",
"severity": "medium"
}
]
}
},
"meta": {
"request_id": "req_intel_pack_xyz789",
"processing_time_ms": 2341
}
}Get Packing Recommendations
Get AI-powered recommendations for optimal packing strategy.
Endpoint:
POST /intelligent-packing/recommendRequest Body:
json
{
"items_summary": {
"total_items": 150,
"total_volume": 45000.0,
"total_weight": 2250.0,
"fragile_count": 25,
"heavy_count": 10
},
"shipping_profile": "express",
"available_pallets": ["EUR-PALLET", "STD-PALLET"]
}Response:
json
{
"success": true,
"data": {
"recommended_pallets": [
{
"pallet_id": "EUR-PALLET",
"quantity": 2,
"estimated_utilization": 0.85
}
],
"estimated_total_pallets": 2,
"strategy_recommendation": "Use heavy-items-first strategy",
"estimated_calculation_time": "2.5s",
"complexity_assessment": "medium"
},
"meta": {
"request_id": "req_recommend_abc123",
"processing_time_ms": 245
}
}Integration Guide
When to Use Intelligent Packing
Use this API when:
- Dealing with fragile/valuable items
- Need weight distribution optimization
- Require loading sequence management
- Have complex grouping requirements
- Need stability analysis for long-haul shipping
Performance Considerations
| Complexity | Items | Typical Processing Time | Rate Limit |
|---|---|---|---|
| Simple | < 50 | < 500ms | 30/min |
| Medium | 50-200 | 1-3 seconds | 15/min |
| Complex | 200-500 | 3-10 seconds | 5/min |
| Enterprise | > 500 | Contact us | Custom |
Example Workflow
python
from alaikis import AlaikisClient
client = AlaikisClient(api_key="YOUR_API_TOKEN")
# Get packing strategy recommendation first
recommendation = client.intelligent_packing.recommend(
items_summary={
"total_items": 75,
"total_volume": 125000.0,
"total_weight": 850.0,
"fragile_count": 15,
"heavy_count": 8
},
shipping_profile="fragile",
available_pallets=["EUR-PALLET", "STD-PALLET"]
)
print(f"Recommended Strategy: {recommendation.data.strategy_recommendation}")
print(f"Estimated Pallets: {recommendation.data.estimated_total_pallets}")
# Then run actual calculation
packing_result = client.intelligent_packing.calculate(
items=order_items,
pallets=[euro_pallet],
options={
"optimization_mode": "stability",
"enable_stability_analysis": True,
"calculate_cog": True,
"group_items": True
}
)
result = packing_result.data
print(f"\nPacking Results:")
print(f" Optimization Score: {result.optimization_score:.1%}")
print(f" Pallets Used: {result.total_pallets_used}")
for pallet in result.pallets:
print(f"\nPallet {pallet.pallet_index}:")
print(f" Stability Score: {pallet.stability_score:.1%}")
print(f" Center of Gravity Balanced: {pallet.center_of_gravity.balanced}")
print(f" Layers: {pallet.layers}")Enterprise Features
For Enterprise plan customers:
- Custom optimization algorithms
- Integration with WMS/ERP systems
- Batch processing API
- Historical packing analytics
- Custom constraint definitions
- Dedicated optimization models
Contact enterprise@alaikis.com for enterprise solutions.