PT EN

Armazém: Kits

URL base: $BUSINESS_API

Listar kits

Registos

GET /inventory/kits

Pages the tenant's kits with limit (default 20, max 100) and the after cursor. Filter by work_order_type to find the default kit for a type of work order, and by active. Needs the inventory:read scope.

Parâmetros

work_order_typestring · consulta · opcional

Kits proposed for one work-order type

activeboolean · consulta · opcional

Only active or inactive kits

limitinteger · consulta · opcional

Maximum resources to return (default 20, maximum 100).

afterstring · consulta · opcional

Opaque cursor returned by the previous page.

Devolve

200 Kits

Mostrar atributos
dataarray of InventoryKit · obrigatório
Mostrar atributos filhos
idstring · obrigatório

kit_ identifier

tenant_idstring · obrigatório
codestring · obrigatório
namestring · obrigatório
descriptionstring · opcional
work_order_typestring · opcional

The work-order type this kit is the default for

activeboolean · obrigatório
linesarray of InventoryKitLine · obrigatório
Mostrar atributos filhos
item_idstring · obrigatório
quantitynumber · obrigatório

Quantity in the item's unit, with at most three decimals (12.5 metres).

requiredboolean · obrigatório

A field order cannot be dispatched until this line is reserved (batch 2)

created_atstring (date-time) · obrigatório
updated_atstring (date-time) · obrigatório
has_moreboolean · obrigatório
next_cursorstring · opcional

Erros 400 · 401 · 403

Permissões inventory:read · Funções: admin, analyst, field_reader, field_supervisor, finance, operations, owner, viewer

curl -X GET "$BUSINESS_API/inventory/kits" \
  -H "Authorization: Bearer sk_test_..."
Resposta 200
{
  "data": [
    {
      "id": "inv_2JVQuPrWedpeyptQQdnuAb9S4dV",
      "tenant_id": "ten_2ugFXIC316WXzGu1HGal90AxTA6",
      "code": "COD-2026-000142",
      "name": "Ana Matsinhe",
      "description": "Leitura confirmada no local.",
      "work_order_type": "work order type",
      "active": true,
      "lines": [
        {
          "item_id": "itm_2vLmKDHWenXi6Pxs8hv8WJHGW53",
          "quantity": 1,
          "required": true
        }
      ],
      "created_at": "2026-11-19T09:30:00Z",
      "updated_at": "2026-11-19T09:30:00Z"
    }
  ],
  "has_more": true,
  "next_cursor": "next cursor"
}

Criar um kit

Registos

POST /inventory/kits

Creates a named list of items and quantities that work orders draw on, returned with status 201. code (stored upper case, unique per tenant) and name are required, and lines must hold 1 to 100 distinct existing items with positive quantities, in whole units for serialised items. Setting work_order_type makes the kit the default for that type; 409 when another active kit already holds that type or the code exists. Needs the inventory:supervise scope; send an Idempotency-Key header to make retries safe.

Parâmetros

Idempotency-Keystring · cabeçalho · opcional

Makes an inventory write safe to retry, for field issues replayed from offline phones. 1 to 255 visible ASCII characters, scoped to the tenant and endpoint and kept for 30 days. A completed write is stored with its response in the same transaction and returned again with its original status and body and the header Idempotent-Replayed: true, recording nothing twice. The same key on a different request (body, path or caller) is refused with 409 idempotency_conflict. A refusal is never stored.

Corpo application/json

codestring · obrigatório
namestring · obrigatório
descriptionstring · opcional
work_order_typestring · opcional
linesarray of InventoryKitLine · obrigatório
Mostrar atributos filhos
item_idstring · obrigatório
quantitynumber · obrigatório

Quantity in the item's unit, with at most three decimals (12.5 metres).

requiredboolean · obrigatório

A field order cannot be dispatched until this line is reserved (batch 2)

Devolve

201 Kit created

Mostrar atributos
idstring · obrigatório

kit_ identifier

tenant_idstring · obrigatório
codestring · obrigatório
namestring · obrigatório
descriptionstring · opcional
work_order_typestring · opcional

The work-order type this kit is the default for

activeboolean · obrigatório
linesarray of InventoryKitLine · obrigatório
Mostrar atributos filhos
item_idstring · obrigatório
quantitynumber · obrigatório

Quantity in the item's unit, with at most three decimals (12.5 metres).

requiredboolean · obrigatório

A field order cannot be dispatched until this line is reserved (batch 2)

created_atstring (date-time) · obrigatório
updated_atstring (date-time) · obrigatório

Erros 400 · 401 · 403 · 404 · 409

Permissões inventory:supervise · Funções: admin, operations, owner

curl -X POST "$BUSINESS_API/inventory/kits" \
  -H "Authorization: Bearer sk_test_..." \
  -H "Content-Type: application/json" \
  -d '{
  "code": "COD-2026-000142",
  "name": "Ana Matsinhe",
  "description": "Leitura confirmada no local.",
  "work_order_type": "work order type",
  "lines": [
    {
      "item_id": "itm_2vLmKDHWenXi6Pxs8hv8WJHGW53",
      "quantity": 1,
      "required": true
    }
  ]
}'
Resposta 201
{
  "id": "inv_2JVQuPrWedpeyptQQdnuAb9S4dV",
  "tenant_id": "ten_2ugFXIC316WXzGu1HGal90AxTA6",
  "code": "COD-2026-000142",
  "name": "Ana Matsinhe",
  "description": "Leitura confirmada no local.",
  "work_order_type": "work order type",
  "active": true,
  "lines": [
    {
      "item_id": "itm_2vLmKDHWenXi6Pxs8hv8WJHGW53",
      "quantity": 1,
      "required": true
    }
  ],
  "created_at": "2026-11-19T09:30:00Z",
  "updated_at": "2026-11-19T09:30:00Z"
}

Obter um kit

Registos

GET /inventory/kits/{id}

Returns one kit of the caller's tenant with its lines and the work-order type it is the default for. Returns 404 when the kit does not exist in this tenant. Needs the inventory:read scope.

Parâmetros

idstring · caminho · obrigatório

Kit ID (kit_)

Devolve

200 Kit

Mostrar atributos
idstring · obrigatório

kit_ identifier

tenant_idstring · obrigatório
codestring · obrigatório
namestring · obrigatório
descriptionstring · opcional
work_order_typestring · opcional

The work-order type this kit is the default for

activeboolean · obrigatório
linesarray of InventoryKitLine · obrigatório
Mostrar atributos filhos
item_idstring · obrigatório
quantitynumber · obrigatório

Quantity in the item's unit, with at most three decimals (12.5 metres).

requiredboolean · obrigatório

A field order cannot be dispatched until this line is reserved (batch 2)

created_atstring (date-time) · obrigatório
updated_atstring (date-time) · obrigatório

Erros 401 · 403 · 404

Permissões inventory:read · Funções: admin, analyst, field_reader, field_supervisor, finance, operations, owner, viewer

curl -X GET "$BUSINESS_API/inventory/kits/{id}" \
  -H "Authorization: Bearer sk_test_..."
Resposta 200
{
  "id": "inv_2JVQuPrWedpeyptQQdnuAb9S4dV",
  "tenant_id": "ten_2ugFXIC316WXzGu1HGal90AxTA6",
  "code": "COD-2026-000142",
  "name": "Ana Matsinhe",
  "description": "Leitura confirmada no local.",
  "work_order_type": "work order type",
  "active": true,
  "lines": [
    {
      "item_id": "itm_2vLmKDHWenXi6Pxs8hv8WJHGW53",
      "quantity": 1,
      "required": true
    }
  ],
  "created_at": "2026-11-19T09:30:00Z",
  "updated_at": "2026-11-19T09:30:00Z"
}

Actualizar um kit

Registos

PATCH /inventory/kits/{id}

Changes only the fields you send: name, description, work_order_type, active, and lines (replaces all lines, with the same rules as on create). An active kit keeps the one-default-per-type rule, so naming a work-order type that another active kit already holds returns 409. Needs the inventory:supervise scope; send an Idempotency-Key header to make retries safe.

Parâmetros

idstring · caminho · obrigatório

Kit ID (kit_)

Idempotency-Keystring · cabeçalho · opcional

Makes an inventory write safe to retry, for field issues replayed from offline phones. 1 to 255 visible ASCII characters, scoped to the tenant and endpoint and kept for 30 days. A completed write is stored with its response in the same transaction and returned again with its original status and body and the header Idempotent-Replayed: true, recording nothing twice. The same key on a different request (body, path or caller) is refused with 409 idempotency_conflict. A refusal is never stored.

Corpo application/json

namestring · opcional
descriptionstring · opcional
work_order_typestring · opcional
activeboolean · opcional
linesarray of InventoryKitLine · opcional

Replaces the kit's lines.

Mostrar atributos filhos
item_idstring · obrigatório
quantitynumber · obrigatório

Quantity in the item's unit, with at most three decimals (12.5 metres).

requiredboolean · obrigatório

A field order cannot be dispatched until this line is reserved (batch 2)

Devolve

200 Kit updated

Mostrar atributos
idstring · obrigatório

kit_ identifier

tenant_idstring · obrigatório
codestring · obrigatório
namestring · obrigatório
descriptionstring · opcional
work_order_typestring · opcional

The work-order type this kit is the default for

activeboolean · obrigatório
linesarray of InventoryKitLine · obrigatório
Mostrar atributos filhos
item_idstring · obrigatório
quantitynumber · obrigatório

Quantity in the item's unit, with at most three decimals (12.5 metres).

requiredboolean · obrigatório

A field order cannot be dispatched until this line is reserved (batch 2)

created_atstring (date-time) · obrigatório
updated_atstring (date-time) · obrigatório

Erros 400 · 401 · 403 · 404 · 409

Permissões inventory:supervise · Funções: admin, operations, owner

curl -X PATCH "$BUSINESS_API/inventory/kits/{id}" \
  -H "Authorization: Bearer sk_test_..." \
  -H "Content-Type: application/json" \
  -d '{
  "name": "Ana Matsinhe",
  "description": "Leitura confirmada no local.",
  "work_order_type": "work order type",
  "active": true,
  "lines": [
    {
      "item_id": "itm_2vLmKDHWenXi6Pxs8hv8WJHGW53",
      "quantity": 1,
      "required": true
    }
  ]
}'
Resposta 200
{
  "id": "inv_2JVQuPrWedpeyptQQdnuAb9S4dV",
  "tenant_id": "ten_2ugFXIC316WXzGu1HGal90AxTA6",
  "code": "COD-2026-000142",
  "name": "Ana Matsinhe",
  "description": "Leitura confirmada no local.",
  "work_order_type": "work order type",
  "active": true,
  "lines": [
    {
      "item_id": "itm_2vLmKDHWenXi6Pxs8hv8WJHGW53",
      "quantity": 1,
      "required": true
    }
  ],
  "created_at": "2026-11-19T09:30:00Z",
  "updated_at": "2026-11-19T09:30:00Z"
}