本文へスキップ
CargoDuo logoCargoDuo
料金

このドキュメントは現在、英語版のみです。

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[].

認証

Bearer API キー(必要なスコープ)pack:write詳細を見る

ボディパラメーター

application/json
名前型必須説明
referencestring
string
いいえ

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

≤ 128 chars
vehiclesVehicle[]必須
Vehicle[]
はい

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

itemsItem[]必須
Item[]
はい

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

groupsGroup[]
Group[]
いいえ

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
いいえ

Packing options. Every field is optional.

リクエストの例

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"
    }
  }'

レスポンスの例

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
  }
}

レスポンス

  • 200OKValidation result and price range.
    名前型必須説明
    validboolean
    boolean
    いいえ

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

    errorsErrorDetail[]
    ErrorDetail[]
    いいえ

    Validation errors (empty when valid).

    warningsWarning[]
    Warning[]
    いいえ

    Non-blocking remarks.

    itemsinteger
    integer
    いいえ

    Total item units.

    max_vehiclesinteger
    integer
    いいえ

    Most vehicles the job may load.

    estimated_costCostRange
    CostRange
    いいえ

    Price range in credits.

    estimated_secondsnumber · s
    number · s
    いいえ

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

    balanceEstimateBalance
    EstimateBalance
    いいえ

    Your available credits.

  • 400Bad requestinvalid_json
    • invalid_jsonThe body is not valid JSON or a field has the wrong type.
    名前型必須説明
    errorErrorBody必須
    ErrorBody
    はい
    すべてのエラーコード
  • 401Unauthorizedunauthorizedkey_revokedkey_expired
    • unauthorizedMissing, malformed or unknown API key.
    • key_revokedThe key was revoked.
    • key_expiredThe key passed its expiry date.
    名前型必須説明
    errorErrorBody必須
    ErrorBody
    はい
    すべてのエラーコード
  • 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.
    名前型必須説明
    errorErrorBody必須
    ErrorBody
    はい
    すべてのエラーコード
  • 413Payload too largepayload_too_large
    • payload_too_largeThe request body exceeds 10 MB.
    名前型必須説明
    errorErrorBody必須
    ErrorBody
    はい
    すべてのエラーコード
  • 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.
    名前型必須説明
    errorErrorBody必須
    ErrorBody
    はい
    すべてのエラーコード
  • 500Internal server errorinternal_error
    • internal_errorSomething failed on our side.
    名前型必須説明
    errorErrorBody必須
    ErrorBody
    はい
    すべてのエラーコード
  • 503Service unavailableapi_disabled
    • api_disabledThe API is temporarily disabled (maintenance) or switched off for the organization.
    名前型必須説明
    errorErrorBody必須
    ErrorBody
    はい
    すべてのエラーコード