Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
chrisbbe opened this issue Apr 11, 2024 · 1 comment
Open

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

chrisbbe opened this issue Apr 11, 2024 · 1 comment

Comments

@chrisbbe
Copy link

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.

@andreeasondavisma
Copy link
Member

Hello @chrisbbe
Thank you for reporting this.
We manage to reproduce this issue and we created an internal jira ticket for this. We will keep you updated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants