Skip to content

Buggy POST /v2/inventory/stocktaking/productline/list #95

@chrisbbe

Description

@chrisbbe

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions