Compose kit units
Composes kit units from its components: one stock exit (SR) per component warehouse and one stock entry of the kit with the movement type set in STOCK_TipoMovEntradaComporKit (ERC by default). The kit is valued at the sum of quantity x average cost of its components. All movements are created in one transaction.
In: header
Path Parameters
Kit units to compose. Must be greater than 0.
0 < valueWarehouse that receives the composed kits.
Kit lot. Required when the kit uses lots; the lot must exist.
Kit serial numbers. Required when the kit uses serial numbers, exactly quantity values not in stock yet.
One entry per kit component, covering every component of the kit.
Component article code.
Warehouse the component leaves from.
Component lot with stock in that warehouse. Required when the component uses lots.
Component serial numbers in that warehouse. Required for serial components, quantity x quantity per kit.
Response Body
curl -X POST "https://og-tenant1.test:8003/api/v2/stocks/articles/string/kits/compose" \
-H "Content-Type: application/json" \
-d '{
"quantity": 2,
"warehouse_id": 1,
"components": [
{
"article_id": "ART001",
"warehouse_id": 1
}
],
"components.*.article_id": "ART001",
"components.*.warehouse_id": 1
}'{
"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"
}
}