3D bin packing API

A 3D bin packing API you don't have to babysit.

Production 3D bin packing over REST: 8 algorithms, physics constraints, and sub-millisecond solves. Pick the algorithm per request or state an objective and let the engine choose.

One endpoint, full control of the solver.

  • 8 algorithms via options.algorithm: first-fit, best-fit, guillotine, max-rects, cartonpilot-fit, cartonpilot-ultra, cartonpilot-max, cartonpilot-physics
  • Or set an objective instead - fewest-parcels, lowest-cost, fastest, lowest-billable-weight
  • REST + JSON with a full OpenAPI 3 spec and Swagger explorer at /swagger
  • Batch 50 orders sync or 500 async with job polling; Idempotency-Key for safe retries
  • Unit-agnostic dimensions, SKU item catalogs, and structured visualization data in ASCII/HTML formats (Starter plan and above)
POST /api/v1/shipping-optimize
curl -X POST https://cartonpilot.com/api/v1/shipping-optimize \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "boxes": [
      { "id": "M", "dimensions": { "length": 15, "width": 12, "height": 10 },
        "weightCapacity": 40, "cost": 0.94 }
    ],
    "items": [
      { "id": "VASE-01", "weight": 2.1, "quantity": 2, "fragilityLevel": 4,
        "dimensions": { "length": 6, "width": 6, "height": 9 } }
    ],
    "options": { "algorithm": "cartonpilot-physics", "dimDivisor": 139 }
  }'

8 bin packing algorithms, honestly described

Every algorithm is available on every plan. In our published, reproducible benchmark, cartonpilot-ultra shipped 44% fewer parcels than first-fit - about $11.31 saved per order at published 2026 FedEx/UPS Ground list rates.

first-fit

The classic baseline: each item goes into the first box with room. Fast and predictable - it's also the baseline our benchmark measures against.

best-fit

Places each item where it leaves the least wasted volume. Tighter packs than first-fit for a small amount of extra work.

guillotine

Splits free space with straight, axis-aligned cuts. Simple and effective when your items are uniform and rectangular.

max-rects

Tracks maximal free rectangles instead of guillotine cuts, so it finds placements guillotine misses on mixed item sizes.

cartonpilot-fit

Our tuned heuristic: better fill rates than the classical algorithms at comparable speed. A solid default for most catalogs.

cartonpilot-ultra

The flagship, and the algorithm behind our published benchmark: 44% fewer parcels and 37% lower carrier spend versus first-fit.

cartonpilot-max

Pushes fill rate hardest, trading extra compute for maximum density. Use it when box count matters more than solve time.

cartonpilot-physics

Everything in cartonpilot-ultra plus fragility levels 0-5, maxTopLoad, and center-of-gravity validation. Physics parameters require the Growth plan or above.

Constraints from real packing benches

A bin packing algorithm API is only useful if its plans survive contact with a warehouse. These constraints are first-class inputs, not post-processing.

Weight capacity

Set weightCapacity per box and the solver never overloads a carton, even when the volume would fit.

Box tare weight

Empty-box weight counts toward the totals, so billable weight reflects what the carrier actually scales.

Rotation control

Allow free rotation or lock orientations per item - this-side-up goods stay this-side-up.

Oversized item handling

Items no box can hold are reported explicitly instead of silently dropped or wedged into a bad plan.

Multi-box splits

Orders that can't fit one carton split cleanly across parcels, with placements for every box.

Objective-based selection

Skip picking an algorithm: ask for fewest-parcels, lowest-cost, fastest, or lowest-billable-weight and let the engine decide.

Free audit - no signup

Benchmark the engine on your own orders.

Paste an order (or a CSV) and the production solver shows parcels saved, box spend, and estimated FedEx/UPS Ground cost - right here, before you write a line of integration code.

Your order

ItemLWHlbQty
No signup. Dimensions in inches.

Audited against a standard 7-box corrugated line-up using a first-fit baseline vs. cartonpilot-ultra.

Add your items and run the audit to see how many parcels and how much box spend CartonPilot can cut.

3D bin packing API FAQ

What is 3D bin packing?

3D bin packing is the problem of fitting a set of 3D items into as few (or as cheap) containers as possible while respecting real-world constraints like weight capacity, rotation rules, and stacking limits. A 3D bin packing API exposes a solver for this problem over HTTP: you send item and box dimensions, it returns which boxes to use and exactly where each item goes.

Bin packing is NP-hard. How do you solve it fast?

We don't solve it exactly - nobody does at production scale. The engine runs tuned heuristics followed by post-optimization passes that consolidate parcels and improve placements. That keeps the median solve under 1 ms per order while getting close enough to optimal to matter: our published benchmark shows cartonpilot-ultra shipping 44% fewer parcels than a first-fit baseline.

Can I pick which algorithm runs?

Yes. Pass options.algorithm with any of the 8 algorithms (first-fit, best-fit, guillotine, max-rects, cartonpilot-fit, cartonpilot-ultra, cartonpilot-max, cartonpilot-physics). If you'd rather state the goal than the method, set an objective instead - fewest-parcels, lowest-cost, fastest, or lowest-billable-weight - and the engine chooses for you.

Does it handle rotation, fragility, and weight limits?

Yes. You can allow or lock item orientations, set per-box weight capacity and tare weight, and split orders across multiple boxes when needed. The cartonpilot-physics algorithm adds fragility levels 0-5, maxTopLoad, and center-of-gravity validation; those physics parameters require the Growth plan or above.

Is there a free tier?

Yes. The Free plan includes 1,000 items/month with no credit card, enough for full integration testing. And the free packing audit at /audit runs the production engine on your own order data with no signup at all.

Start on the free plan

1,000 items/month free - no credit card. Or compare plans.