Skip to content
Developer docsGet started

Quickstart

Create a key, send one request, read the plan.

Create an API key

In the developer console, open API keys and create a key. The secret is shown once.

Bash
export CARGODUO_API_KEY="cd_live_..."

Create a job

?wait=60 answers with the finished job when it ends within 60 s.

curl -X POST "https://runner.cargoduo.com/v1/pack?wait=60" \
  -H "Authorization: Bearer $CARGODUO_API_KEY" \
  -H "Idempotency-Key: order-1042-v1" \
  -H "Content-Type: application/json" \
  -d '{
    "reference": "order-1042",
    "vehicles": [
      {
        "id": "trailer",
        "type": "trailer",
        "name": "13.6 m trailer",
        "length": 1360,
        "width": 245,
        "height": 270,
        "max_weight": 24000
      }
    ],
    "items": [
      {
        "id": "pallet-eu",
        "label": "Euro pallet",
        "length": 120,
        "width": 80,
        "height": 140,
        "weight": 450,
        "quantity": 18,
        "stackable": false
      },
      {
        "id": "carton-a",
        "label": "Carton A",
        "length": 60,
        "width": 40,
        "height": 40,
        "weight": 12,
        "quantity": 40,
        "rotation": "upright"
      }
    ],
    "options": {
      "packing_mode": "auto"
    }
  }'

Finished in time: 200, status: "succeeded", the plan in result. Still running: 202, go to step 3.

Poll until it ends

curl "https://runner.cargoduo.com/v1/jobs/$JOB_ID?include=result" \
  -H "Authorization: Bearer $CARGODUO_API_KEY"

Read the plan

FieldHolds
result.vehicles[].placements[]Position, size, orientation and loading step of every item
result.unplaced[]Items that did not fit, with a reason
cost.creditsWhat the job was charged
pdf_urlA link that builds the loading plan PDF

POST /v1/estimate validates and prices the same body for free.