RSJ 3D Packer 3D bin packing, palletising and load optimisation

← All posts

2026-11-01

Integrate a Packing Solver Into Your Order Management System

Integrate a Packing Solver Into Your Order Management System
RSJ 3D Packer packing optimization item packer

Integrate a Packing Solver Into Your Order Management System

Every order that ships in a container or on a pallet triggers the same loop in most order management systems: an order lands, someone exports the line items, looks up carton dimensions, types them into a spreadsheet or a packing tool, reads the container count off the screen, and copies it back into the OMS by hand. Then a line item changes before dispatch and the whole exercise starts again.

The goal of integrating a packing solver into your order management system is not to make that loop faster. It is to delete it. The OMS stays the system of record for orders, customers and stock; the solver becomes one callable step that takes an order’s line items plus the containers you actually have on hand and returns a packing plan — packed items with container index and x/y/z position, fill percentage per container, the number of containers used, and any unpacked items with their counts.

RSJ 3D Packer is a solver built for exactly that step: a JSON REST API, a 240 second time budget per request, and a web viewer you can embed in your own back office. This article is about the plumbing — the account setup, the request you build from an order, where the result lands, and how the integration stays maintainable. If you want the underlying math, see How Container Fill Percentage Is Calculated (and What Good Looks Like); if you want the constraint details, see How to Stop Items Being Rotated During Packing and Dangerous Goods Segregation in Container Packing: What a Plan Must Respect. Here we keep to automation.

The Manual Step You Are About to Delete

Look at what one order costs today. Someone re-types dimensions that already exist in your master data, guesses how many containers the order needs, and repeats the entire exercise whenever the order changes. Multiply that by every order that needs more than a single carton, add the disagreements about which carton size is correct, and the cost is no longer the typing — it is the delay between “order confirmed” and “container count known”.

The automation goal, stated precisely:

  • The OMS remains the system of record for the order.
  • A packing solver becomes a step in the order pipeline, called once per confirmed order.
  • The plan comes back as structured data — positions, fill, container count, unpacked items — not as a screenshot a human retypes.
  • The plan is stored against the order and viewable by anyone who needs to see it.

That is the whole contract. Everything below is implementation detail around it.

One-Time Setup: Accounts, Auth and a Test Order

Start in the packing application. Every plan can be tested free for 30 days, and the free test exposes the Pro feature set — so you can build against riskTypes, allowedRiskPoints, weight limits and rotation flags before you decide which plan you need.

The session model

Authentication is a two-step dance. First you exchange an email address and its HMAC for a session:

curl -s "https://3dpacker.rsj.de/user/$EMAIL?hmac=$HMAC" | jq -r .session

The response contains the user record and a session value. From then on, every call carries it:

curl -s -X POST https://3dpacker.rsj.de/solve \
  -H "Authorization: Bearer session-1bc90169-1c83-443e-8ed7-b0328aaf78a5" \
  -H "Content-Type: application/json" \
  -d @order-4711.json

Two things matter operationally:

  • The session lasts about one day. Fetch a fresh one instead of storing it — treat it as a token with a short life, not a credential you persist.
  • The hmac is the HMAC-SHA256 hash of the email address and can only be computed on the server while the user is logged in. A stand-alone client copies it once and keeps it as a secret. This is the one genuinely fiddly part of the setup, and it is worth solving properly on day one — environment variable or secret store, never in the repository.

The browser application authenticates with cookies instead, which is what the API sandbox relies on.

Shape a request before you write code

Two resources do the heavy lifting here:

Paste a real order’s dimensions into the sandbox, press solve, and look at the plan before you write a single line of integration code. It is faster than discovering a field-name mistake in staging.

Map the data model once

Write this mapping down and keep it in the repository, because it is the only place the two models touch:

OMS field Solver field Required
Line id or SKU item id no
Quantity item count no (defaults to 1)
Carton width / height / depth item width, height, depth yes
Gross weight item weight no
Stacking class item itemClass no
Must stay upright item vertical: false no
Hazard type / points item riskTypes, riskPoints no
Container dimensions container width, height, depth yes
Available units container count no
Maximum load container weight no
Risk budget container allowedRiskPoints no

Width, height and depth map to x, y and z. itemClass and the risk types are integers; weight, riskPoints and allowedRiskPoints are numbers.

The Automated Pipeline: Order In, Packing Plan Out

The trigger is an order event — confirmed, released, or whatever status in your OMS means “this is going to be packed”. Your handler builds a POST /solve body from the order lines and the container types you have available, calls the solver, and stores the answer.

def build_request(order, container_types):
    items = [
        {
            "id": line.sku,
            "width": line.carton.width,
            "height": line.carton.height,
            "depth": line.carton.depth,
            "count": line.quantity,
            "weight": line.carton.gross_weight,
            "itemClass": line.carton.stack_class,
            # vertical: false means "must not be rotated out of its upright position"
            "vertical": not line.carton.must_stay_upright,
            "orderLineId": line.id,  # ignored by the solver, travels along
        }
        for line in order.lines
    ]
    containers = [
        {
            "width": c.width,
            "height": c.height,
            "depth": c.depth,
            "count": c.available_units,
            "weight": c.max_load,
        }
        for c in container_types
    ]
    return {"items": items, "containers": containers}

A compact request body looks like this — note the optional risks array, which declares pairs of risk types that must not be loaded together:

{
  "containers": [
    { "width": 48, "height": 47, "depth": 46, "count": 1, "weight": 2000, "allowedRiskPoints": 1000 }
  ],
  "items": [
    { "width": 11, "height": 6, "depth": 6, "count": 51 },
    { "width": 7, "height": 8, "depth": 9, "count": 53, "vertical": false, "itemClass": 1, "weight": 12 },
    { "width": 8, "height": 9, "depth": 10, "count": 57, "riskTypes": [1, 2], "riskPoints": 10 }
  ],
  "risks": [{ "type1": 1, "type2": 2 }]
}

items and containers are required, risks is optional, and count defaults to one when omitted. Unknown keys in the request objects are ignored — which is why orderLineId above is safe to send as client metadata. Treat that as a convenience, not a contract: a future field could collide with a key you invented.

Reading the response

The response hands you four things worth storing:

  • packedItems — each placed item with its container index c and its x, y, z position.
  • containers — per container type, how many were used and the filled percentage.
  • unpackedItems — what did not fit, with dimensions and count.
  • items — per item type, the remaining count after packing.

The response also carries a viewer URL and an API sandbox URL, which is how the plan gets in front of a human without you building a 3D renderer. Embed the viewer in an IFRAME inside your back office:

<!-- src: the viewer URL returned by POST /solve; the sample below is the demo plan -->
<iframe
  src="https://3dpacker.rsj.de/viewer/sample"
  width="100%"
  height="640"
  style="border:0"
  title="Packing plan"></iframe>

Anyone who needs the model itself can download the solution as a GLB 3D model. Store the plan JSON against the order in your own database, so the order record keeps its plan even if the solver is unreachable later.

The 240 second budget is a design constraint

The solver works with a 240 second time budget per request, on every plan. That is generous for one order and far too long for a checkout thread. Solve asynchronously: the order event enqueues a job, the worker calls /solve with a client timeout slightly above the budget, and the plan is written back when it returns. One solve call per order, at confirmation time, is the pattern that fits the budget most naturally.

The plan gate

Feature availability is honest and worth checking before you build against a field:

  • Free test — everything, for 30 days, with the Pro feature set.
  • Basic — different item sizes.
  • Standard — adds different container sizes, weight limits, and preventing vertical rotation.
  • Pro — adds dangerous goods: risk types, risk points and allowedRiskPoints.

If the pipeline you are building needs vertical: false, weight ceilings or a mixed container fleet, you are building against Standard. If it needs risks, you are building against Pro.

Monitoring and Failure Handling

unpackedItems is your primary signal. A non-zero remaining count means the order does not fit the containers you offered. That is not an error condition in the API — it is a business condition, and the OMS should surface it to a planner rather than ship a partial plan quietly.

plan = solve(build_request(order, container_types))

unpacked = [u for u in plan["unpackedItems"] if u["count"] > 0]
if unpacked:
    order.flag_for_planner(unpacked=unpacked)
else:
    order.store_plan(plan)

Alongside it, watch two metrics per order: the filled percentage per container and the total number of containers used. Together they tell you whether the container mix you pass in is sensible. If fill is consistently low across many orders, the problem is usually the container set, not the solver.

Keep the request and response pair per order, keyed by order id, so a disputed plan can be reproduced exactly. Keep the session out of that record — it is fetched fresh for each call anyway and has no diagnostic value.

Then there are the two operational failures to handle explicitly:

  • Expired session. The token lives about a day. Fetch a new one and retry the call once; do not cache the token across a long-running worker.
  • A plan you did not expect. If the container count is absurd or a chunk of the order is unpacked, adjust the container set or the item constraints and solve again — you are still inside the time budget for that order. The solver produces heuristically optimised plans, so a planner still decides when an unusual order needs a different container.

Best Practices for a Solver Integration That Stays Maintained

Model dimensions once. Keep carton width, height, depth and weight in a master data table and reference it from the OMS. A corrected carton size then fixes every future order, instead of one spreadsheet cell that gets overwritten.

Use itemClass deliberately. An item is only ever placed on items of a lower or equal class. That is how you encode “fragile on top” without writing any placement logic of your own — assign classes once in master data, and the solver respects them.

Reserve vertical: false for the items that need it. It is "vertical": false on the item, nothing more. Applying it broadly shrinks the solution space for no reason.

Keep the integration thin. Build the request, call /solve, store the result, show the viewer. Resist reimplementing packing logic in the OMS to “fix” a plan — that is a second solver with no support contract.

Version the request builder against the spec. Pin the OpenAPI document, and when the spec changes, re-run your canonical order through the sandbox before deploying. The sandbox is the fastest place to notice that a field you rely on moved.

FAQ

Can I call the packing solver once per order, or do I need to batch orders?

Either works, but the solver has a 240 second time budget per request, so the practical pattern is one solve call per order at the moment the order is confirmed. If you batch, keep each batch small enough that the solve still returns inside that budget, and store the result against each order.

What should my order management system do with items that could not be packed?

The response lists them in unpackedItems with their dimensions and remaining count. Treat a non-zero remaining count as a signal that the offered container set is too small or the constraints are too tight, and route the order to a planner instead of shipping a partial plan.

Do we have to use the cloud version, or can the solver run inside our own network?

RSJ 3D Packer is available as a cloud subscription, as an on-premises server for Windows 10/11 64 Bit or Ubuntu Linux 64 Bit (16 GB RAM, 4 GB hard disk), and as a stand-alone program. The HTTP API is the same JSON REST interface, so the integration code does not change. The cloud version is also integrated into Google Sheets through its own add-on — see Google Sheets Container Packing Add-On: A Quick Start if that is the surface your team prefers.

Can the solver respect a fixed packing order or a required unpacking order?

The standard solver handles the static problem, where items may be packed in any order. The algorithm can be adapted for dynamic problems such as a fixed packing order or a required unpacking order — raise that requirement with RSJ rather than assuming it is a request field.

Conclusion: From Order to Plan Without a Spreadsheet

The integration is smaller than it feels from the outside: one setup with an account, a session fetch and a copied hmac; one request builder that maps order lines and container types onto the solver’s fields; one POST /solve per confirmed order; one stored plan with a viewer link and a GLB for anyone who needs the model. Add a check on unpackedItems and you have covered the cases that actually occur.

Because the free 30-day test exposes the Pro feature set, you can build and prove the entire pipeline — dangerous goods fields included — before making a subscription decision.

When you are ready, the next two clicks are the plans and checkout page and the API reference. If you are still weighing the cost against a spreadsheet workflow, Container Loading Software That Fits a Small Team’s Budget covers that comparison; if your orders are mostly mixed cartons, read How to Calculate Container Loading for Mixed Carton Sizes next.

Related posts

EU label: AI-generated content