Saltar para o conteúdo
CargoDuo logoCargoDuo
Preços
Entrar

Por enquanto, esta documentação está disponível só em inglês.

Documentação para desenvolvedoresAPI referenceTemplates

Create a template

Saves an item as a template (it shows in the app too).

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

Same fields and checks as a /v1/pack item. Free: no credits are charged.

Autenticação

Chave de API Bearer com a permissãoresources:writeSaber mais

Parâmetros do corpo

application/json
NomeTipoObrigatórioDescrição
labelstringobrigatório
string
Sim

Display label.

≤ 255 chars
shapestring
string
Não

Item shape. cylinder and drum use radius + height instead of length + width; pallet and drum always stay upright.

boxcylinderpalletbagdrumPredefinição "box"
lengthnumber · cm
number · cm
Não

Length. Required unless shape is cylinder or drum.

widthnumber · cm
number · cm
Não

Width. Required unless shape is cylinder or drum.

heightnumber · cmobrigatório
number · cm
Sim

Height (the vertical side when the item stands as defined).

radiusnumber · cm
number · cm
Não

Radius. Required when shape is cylinder or drum.

weightnumber · kgobrigatório
number · kg
Sim

Weight of ONE unit.

stackableboolean
boolean
Não

Other items may be placed on top of this one.

Predefinição true
max_stack_weightnumber · kg
number · kg
Não

Maximum weight that may rest on one unit. 0 = unlimited.

Predefinição 0
rotationstring
string
Não

all = any of the six orientations; upright = may only turn around the vertical axis (this side up); fixed = never rotated.

alluprightfixedPredefinição "all"
hazardousboolean
boolean
Não

Dangerous goods: kept low and separated from other hazardous items.

Predefinição false
priorityinteger
integer
Não

Load priority. Higher = loaded first and kept when space runs out. 0 = none.

Predefinição 0
colorstring
string
Não

Display colour as #rrggbb (viewer and PDF only).

nesting_heightnumber · cm
number · cm
Não

Telescoping overlap when identical units stack (nested crates, buckets).

Predefinição 0

Exemplo de pedido

curl -X POST "https://runner.cargoduo.com/v1/templates" \
  -H "Authorization: Bearer $CARGODUO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "label": "Euro pallet",
    "length": 120,
    "width": 80,
    "height": 140,
    "weight": 450,
    "stackable": false,
    "color": "#3b82f6"
  }'

Exemplo de resposta

201 · Template
{
  "id": "tpl_42",
  "object": "template",
  "label": "Euro pallet",
  "shape": "box",
  "length": 120,
  "width": 80,
  "height": 140,
  "radius": 0,
  "weight": 450,
  "stackable": false,
  "max_stack_weight": 0,
  "rotation": "all",
  "hazardous": false,
  "priority": 0,
  "color": "#3b82f6",
  "nesting_height": 0,
  "created_by": {
    "id": "usr_7",
    "name": "Elif Kaya"
  },
  "updated_by": {
    "id": "usr_7",
    "name": "Elif Kaya"
  },
  "created_at": "2026-09-28T14:05:52Z",
  "updated_at": "2026-09-28T14:05:52Z"
}

Respostas

  • 201The new template.
    NomeTipoObrigatórioDescrição
    idstring
    string
    Não

    Template id (tpl_…).

    objectstring
    string
    Não
    template
    labelstring
    string
    Não

    Display label.

    shapestring
    string
    Não

    Item shape. cylinder and drum use radius + height instead of length + width; pallet and drum always stay upright.

    boxcylinderpalletbagdrum
    lengthnumber · cm
    number · cm
    Não

    Length. Required unless shape is cylinder or drum.

    widthnumber · cm
    number · cm
    Não

    Width. Required unless shape is cylinder or drum.

    heightnumber · cm
    number · cm
    Não

    Height (the vertical side when the item stands as defined).

    radiusnumber · cm
    number · cm
    Não

    Radius. Required when shape is cylinder or drum.

    weightnumber · kg
    number · kg
    Não

    Weight of ONE unit.

    stackableboolean
    boolean
    Não

    Other items may be placed on top of this one.

    max_stack_weightnumber · kg
    number · kg
    Não

    Maximum weight that may rest on one unit. 0 = unlimited.

    rotationstring
    string
    Não

    all = any of the six orientations; upright = may only turn around the vertical axis (this side up); fixed = never rotated.

    alluprightfixed
    hazardousboolean
    boolean
    Não

    Dangerous goods: kept low and separated from other hazardous items.

    priorityinteger
    integer
    Não

    Load priority. Higher = loaded first and kept when space runs out. 0 = none.

    colorstring
    string
    Não

    Display colour as #rrggbb (viewer and PDF only).

    nesting_heightnumber · cm
    number · cm
    Não

    Telescoping overlap when identical units stack (nested crates, buckets).

    created_byUserRef | null
    UserRef | null
    Não

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

    updated_byUserRef | null
    UserRef | null
    Não

    The member who last changed it.

    created_atstring
    string
    Não

    RFC 3339.

    updated_atstring
    string
    Não

    RFC 3339.

  • 400Bad requestinvalid_json
    • invalid_jsonThe body is not valid JSON or a field has the wrong type.
    NomeTipoObrigatórioDescrição
    errorErrorBodyobrigatório
    ErrorBody
    Sim
    Todos os códigos de erro
  • 401Unauthorizedunauthorizedkey_revokedkey_expired
    • unauthorizedMissing, malformed or unknown API key.
    • key_revokedThe key was revoked.
    • key_expiredThe key passed its expiry date.
    NomeTipoObrigatórioDescrição
    errorErrorBodyobrigatório
    ErrorBody
    Sim
    Todos os códigos de erro
  • 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.
    NomeTipoObrigatórioDescrição
    errorErrorBodyobrigatório
    ErrorBody
    Sim
    Todos os códigos de erro
  • 413Payload too largepayload_too_large
    • payload_too_largeThe request body exceeds 10 MB.
    NomeTipoObrigatórioDescrição
    errorErrorBodyobrigatório
    ErrorBody
    Sim
    Todos os códigos de erro
  • 422Unprocessable entityvalidation_failed
    • validation_failedThe request is well-formed JSON but describes an invalid job. details[] lists every problem.
    NomeTipoObrigatórioDescrição
    errorErrorBodyobrigatório
    ErrorBody
    Sim
    Todos os códigos de erro
  • 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.
    NomeTipoObrigatórioDescrição
    errorErrorBodyobrigatório
    ErrorBody
    Sim
    Todos os códigos de erro
  • 500Internal server errorinternal_error
    • internal_errorSomething failed on our side.
    NomeTipoObrigatórioDescrição
    errorErrorBodyobrigatório
    ErrorBody
    Sim
    Todos os códigos de erro
  • 503Service unavailableapi_disabled
    • api_disabledThe API is temporarily disabled (maintenance) or switched off for the organization.
    NomeTipoObrigatórioDescrição
    errorErrorBodyobrigatório
    ErrorBody
    Sim
    Todos os códigos de erro