Skip to content
Developer docsAPI referencePack

Estimate a packing job

Runs the same validation as POST /v1/pack and returns the price range, without creating a job or reserving credits.

POSThttps://runner.cargoduo.com/v1/estimate

Free. An invalid request answers 200 with valid: false and every problem in errors[].

Authentication

Bearer API key with scopepack:writeLearn more

Body parameters

application/json
NameTypeRequiredDescription
referencestring
string
No

Your own reference (order number, shipment id…). Echoed back on the job.

≤ 128 chars
vehiclesVehicle[]required
Vehicle[]
Yes

Vehicle definitions. Each one may have quantity > 1. At least one.

itemsItem[]required
Item[]
Yes

Item definitions. Each one may have quantity > 1. At least one.

groupsGroup[]
Group[]
No

Optional groups (customers, stops, orders). Required for every group an item names when options.group_routing is not "none"; otherwise groups are created from the item group names in order of appearance.

optionsOptions
Options
No

Packing options. Every field is optional.

Example request

curl -X POST "https://runner.cargoduo.com/v1/estimate" \
  -H "Authorization: Bearer $CARGODUO_API_KEY" \
  -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"
    }
  }'

Example response

200 OK · Estimate
{
  "valid": true,
  "errors": [],
  "warnings": [],
  "items": 58,
  "max_vehicles": 3,
  "estimated_cost": {
    "min_credits": 0.26,
    "max_credits": 1.11
  },
  "estimated_seconds": 90,
  "balance": {
    "available_credits": 147.75
  }
}

Responses

  • 200OKValidation result and price range.
    NameTypeRequiredDescription
    validboolean
    boolean
    No

    The request would be accepted by POST /v1/pack.

    errorsErrorDetail[]
    ErrorDetail[]
    No

    Validation errors (empty when valid).

    warningsWarning[]
    Warning[]
    No

    Non-blocking remarks.

    itemsinteger
    integer
    No

    Total item units.

    max_vehiclesinteger
    integer
    No

    Most vehicles the job may load.

    estimated_costCostRange
    CostRange
    No

    Price range in credits.

    estimated_secondsnumber · s
    number · s
    No

    Compute budget the job would get (an upper bound; most jobs finish sooner).

    balanceEstimateBalance
    EstimateBalance
    No

    Your available credits.

  • 400Bad requestinvalid_json
    • invalid_jsonThe body is not valid JSON or a field has the wrong type.
    NameTypeRequiredDescription
    errorErrorBodyrequired
    ErrorBody
    Yes
    All error codes
  • 401Unauthorizedunauthorizedkey_revokedkey_expired
    • unauthorizedMissing, malformed or unknown API key.
    • key_revokedThe key was revoked.
    • key_expiredThe key passed its expiry date.
    NameTypeRequiredDescription
    errorErrorBodyrequired
    ErrorBody
    Yes
    All error codes
  • 403Forbiddenip_not_allowedsubscription_inactiveaccount_inactivescope_missing
    • ip_not_allowedThe calling IP is not on the key's allowlist.
    • subscription_inactiveThe organization has no active subscription that includes the API.
    • account_inactiveThe organization is suspended, or has no owner whose account is active.
    • scope_missingThe key lacks a scope this endpoint needs.
    NameTypeRequiredDescription
    errorErrorBodyrequired
    ErrorBody
    Yes
    All error codes
  • 413Payload too largepayload_too_large
    • payload_too_largeThe request body exceeds 10 MB.
    NameTypeRequiredDescription
    errorErrorBodyrequired
    ErrorBody
    Yes
    All error codes
  • 429Too many requestsrate_limited
    • rate_limitedToo many requests in the current minute, hour or day (per key or per organization), or more than 60 failed authentications per minute from your IP address.
    NameTypeRequiredDescription
    errorErrorBodyrequired
    ErrorBody
    Yes
    All error codes
  • 500Internal server errorinternal_error
    • internal_errorSomething failed on our side.
    NameTypeRequiredDescription
    errorErrorBodyrequired
    ErrorBody
    Yes
    All error codes
  • 503Service unavailableapi_disabled
    • api_disabledThe API is temporarily disabled (maintenance) or switched off for the organization.
    NameTypeRequiredDescription
    errorErrorBodyrequired
    ErrorBody
    Yes
    All error codes