تخطَّ إلى المحتوى

هذه الوثائق متاحة حاليًا باللغة الإنجليزية فقط.

وثائق المطورينAPI referenceProjects

Update a project

Renames a project, changes its options, or replaces its vehicles or its items (with groups).

PATCHhttps://runner.cargoduo.com/v1/projects/{id}

Replacing vehicles or items clears the stored plan; open app sessions reload. Free: no credits are charged.

المصادقة

مفتاح API من نوع Bearer بالصلاحيةresources:writeاعرف المزيد

معاملات المسار

الاسمالنوعمطلوبالوصف
idstringمطلوب
string
نعم

Project id (prj_…).

معاملات المحتوى

application/json
الاسمالنوعمطلوبالوصف
namestring
string
لا
≤ 255 chars
vehiclesProjectVehicle[]
ProjectVehicle[]
لا

Vehicle slots.

itemsItem[]
Item[]
لا

Cargo items (at most 500 definitions).

groupsGroup[]
Group[]
لا

Groups, with their loading order.

optionsProjectOptions
ProjectOptions
لا

The pack options a project stores.

مثال على الطلب

curl -X PATCH "https://runner.cargoduo.com/v1/projects/prj_3051" \
  -H "Authorization: Bearer $CARGODUO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "vehicles": [
      {
        "vehicle_id": "veh_118",
        "quantity": 2
      }
    ]
  }'

مثال على الاستجابة

200 OK · Project
{
  "id": "prj_3051",
  "object": "project",
  "name": "Order 1042",
  "status": "draft",
  "item_count": 58,
  "vehicle_count": 2,
  "app_url": "https://app.cargoduo.com/projects/3051",
  "created_by": {
    "id": "usr_7",
    "name": "Elif Kaya"
  },
  "updated_by": {
    "id": "usr_7",
    "name": "Elif Kaya"
  },
  "created_at": "2026-10-19T09:10:03Z",
  "updated_at": "2026-10-19T09:22:03Z",
  "options": {
    "packing_mode": "auto",
    "group_routing": "none",
    "allow_overweight": false
  },
  "vehicles": [
    {
      "id": "pv_5121",
      "vehicle_id": "veh_118",
      "name": "Mega trailer 13.6 m",
      "type": "trailer",
      "quantity": 2,
      "length": 1360,
      "width": 248,
      "height": 300,
      "max_weight": 24000
    }
  ],
  "items": [
    {
      "id": "item_88410",
      "label": "Euro pallet",
      "shape": "box",
      "length": 120,
      "width": 80,
      "height": 140,
      "weight": 450,
      "quantity": 18,
      "stackable": false,
      "rotation": "all",
      "color": "#3b82f6"
    },
    {
      "id": "item_88411",
      "label": "Carton A",
      "shape": "box",
      "length": 60,
      "width": 40,
      "height": 40,
      "weight": 12,
      "quantity": 40,
      "stackable": true,
      "rotation": "upright",
      "color": "#f59e0b"
    }
  ],
  "groups": [],
  "plan": null
}

الاستجابات

  • 200OKThe project after the change.
    الاسمالنوعمطلوبالوصف
    idstring
    string
    لا

    Project id (prj_…).

    objectstring
    string
    لا
    project
    namestring
    string
    لا
    statusstring
    string
    لا

    draft = never packed or inputs replaced; calculated = has a current plan; stale = a setting changed since the plan was made.

    draftcalculatedstaleerror
    item_countinteger
    integer
    لا

    Item units (sum of quantities).

    vehicle_countinteger
    integer
    لا

    Vehicles (sum of quantities).

    app_urlstring
    string
    لا

    Opens the project in the app's 3D editor.

    created_byUserRef | null
    UserRef | null
    لا

    The member who created it (for API calls: the member who created the key). null when unknown.

    updated_byUserRef | null
    UserRef | null
    لا

    The member who last changed it.

    created_atstring
    string
    لا

    RFC 3339.

    updated_atstring
    string
    لا

    RFC 3339.

    optionsProjectOptions
    ProjectOptions
    لا

    The pack options a project stores.

    vehiclesProjectVehicle[]
    ProjectVehicle[]
    لا
    itemsItem[]
    Item[]
    لا

    Cargo in the /v1/pack Item shape; ids are item_….

    groupsGroup[]
    Group[]
    لا
    planProjectPlan | null
    ProjectPlan | null
    لا

    The current plan; null when the project has none.

  • 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
    نعم
    كل رموز الأخطاء
  • 403Forbiddenplan_limit_reachedip_not_allowedsubscription_inactiveaccount_inactivescope_missing
    • plan_limit_reachedThe organization's plan allows no more projects or cargo items.
    • 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
    نعم
    كل رموز الأخطاء
  • 404Not foundproject_not_found
    • project_not_foundNo project with this id in your organization.
    الاسمالنوعمطلوبالوصف
    errorErrorBodyمطلوب
    ErrorBody
    نعم
    كل رموز الأخطاء
  • 413Payload too largepayload_too_large
    • payload_too_largeThe request body exceeds 10 MB.
    الاسمالنوعمطلوبالوصف
    errorErrorBodyمطلوب
    ErrorBody
    نعم
    كل رموز الأخطاء
  • 422Unprocessable entityvalidation_failed
    • validation_failedThe request is well-formed JSON but describes an invalid job. details[] lists every problem.
    الاسمالنوعمطلوبالوصف
    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
    نعم
    كل رموز الأخطاء