While implementing stock-taking using the API we encountered a bug in the API.
Field count and location.id has no effect when issuing POST /v2/inventory/stocktaking/productline/list
POST /v2/inventory/stocktaking/productline/list
[
{
"stocktaking": {
"id": 1040
},
"product": {
"id": 21494313
},
"location": {
"id": 13
},
"count": 5
}
]
response payload:
{
"fullResultSize": 0,
"from": 0,
"count": 1,
"versionDigest": null,
"values": [
{
"id": 1412118,
"version": 0,
"url": "api.tripletex.io/v2/inventory/stocktaking/productline/1412118",
"stocktaking": {
"id": 1040,
"url": "api.tripletex.io/v2/inventory/stocktaking/1040"
},
"product": {
"id": 21494313,
"url": "api.tripletex.io/v2/product/21494313"
},
"count": 0,
"unitCostCurrency": 0,
"costCurrency": 0.00,
"comment": "",
"counted": false,
"counter": null,
"dateCounted": null,
"expectedStock": 0,
"location": null
}
]
}
as count is 0 and location is null in the response.
One could work around this in a less performant way by issuing a single POST for each line to add:
POST /v2/inventory/stocktaking/productline
{
"stocktaking": {
"id": 1040
},
"product": {
"id": 21494313
},
"location": {
"id": 13
},
"count": 5
}
response payload:
{
"value": {
"url": "api.tripletex.io/v2/inventory/stocktaking/productline/0"
}
}
in this request, the field count is working, but location.id does not. Since response payload nor headers do not contain the ID of the line added, one could not go further by issuing PUT /v2/inventory/stocktaking/productline/{ID}/:changeLocation?warehouseLocationId=39 to update the location on the line.
While implementing stock-taking using the API we encountered a bug in the API.
Field
countandlocation.idhas no effect when issuingPOST /v2/inventory/stocktaking/productline/listas count is 0 and location is null in the response.
One could work around this in a less performant way by issuing a single POST for each line to add:
in this request, the field
countis working, butlocation.iddoes not. Since response payload nor headers do not contain the ID of the line added, one could not go further by issuingPUT /v2/inventory/stocktaking/productline/{ID}/:changeLocation?warehouseLocationId=39to update the location on the line.