OfficeGest
Stocks/Articles/{article}/Kits/Decompose

Decompose kit units

Decomposes kit units into its components: one stock exit (SR) of the kit and one stock entry per component warehouse with the movement type set in STOCK_TipoMovEntradaDecomporKit (ER by default). All movements are created in one transaction.

POST
/stocks/articles/{article}/kits/decompose
AuthorizationBearer <token>

In: header

Path Parameters

articlestring
quantitynumber

Kit units to decompose. Must be greater than 0 and not above the kit stock in the warehouse.

Range0 < value
warehouse_idinteger

Warehouse the kits leave from.

lot?string

Kit lot with stock in that warehouse. Required when the kit uses lots.

serial_numbers?array<unknown>

Kit serial numbers in stock in that warehouse. Required for kits with serial numbers, quantity values.

componentsarray<object>

One entry per kit component, covering every component of the kit.

components.*.article_idstring

Component article code.

components.*.warehouse_idinteger

Warehouse that receives the component.

components.*.lot?string

Existing component lot. Required when the component uses lots.

components.*.serial_numbers?array<unknown>

Component serial numbers not in stock yet. Required for serial components, quantity x component quantity.

Response Body

curl -X POST "https://og-tenant1.test:8003/api/v2/stocks/articles/string/kits/decompose" \
  -H "Content-Type: application/json" \
  -d '{
    "quantity": 1,
    "warehouse_id": 1,
    "components": [
      {
        "article_id": "ART001",
        "warehouse_id": 1
      }
    ],
    "components.*.article_id": "ART001",
    "components.*.warehouse_id": 1
  }'
Empty
{
  "data": {
    "code": "VALIDATION_FAILED",
    "message": "The given data was invalid.",
    "errors": {
      "email": [
        "The email field is required."
      ]
    }
  },
  "meta": {
    "trace_id": "9f86d081884c7d659a2feaa0c55ad01568f3a1c2b4d5e"
  }
}
{
  "data": {
    "code": "VALIDATION_FAILED",
    "message": "The given data was invalid.",
    "errors": {
      "email": [
        "The email field is required."
      ]
    }
  },
  "meta": {
    "trace_id": "9f86d081884c7d659a2feaa0c55ad01568f3a1c2b4d5e"
  }
}
{
  "data": {
    "code": "VALIDATION_FAILED",
    "message": "The given data was invalid.",
    "errors": {
      "email": [
        "The email field is required."
      ]
    }
  },
  "meta": {
    "trace_id": "9f86d081884c7d659a2feaa0c55ad01568f3a1c2b4d5e"
  }
}
{
  "data": {
    "code": "VALIDATION_FAILED",
    "message": "The given data was invalid.",
    "errors": {
      "email": [
        "The email field is required."
      ]
    }
  },
  "meta": {
    "trace_id": "9f86d081884c7d659a2feaa0c55ad01568f3a1c2b4d5e"
  }
}