My Products
Help
thingsio
CONTRIBUTOR ***

Updating a shipment with PUT and linenumber issues

by thingsio

We are trying to update shipment lines for a shipment with:

 

https://integration.visma.net/API/controller/api/v1/shipment/SH240854

 

{
    "shipmentType": {
        "value": "Issue"
    },
    "shipmentDetailLines": [
        {
            "operation": "Update",
            "lineNumber": {
                "value": 1
            },
            "shippedQty": {
                "value": 42
            }
        },
        {
            "operation": "Update",
            "lineNumber": {
                "value": 2
            },
            "shippedQty": {
                "value": 8
            }
        },
        {
            "operation": "Update",
            "lineNumber": {
                "value": 3
            },
            "shippedQty": {
                "value": 51
            }
        }
    ]
}
 
This will generate the error: 
"Shipment Line: '2' not found."
 
I'm 100% sure the shipment has three lines. It actually works but only for lineNumber 1.
 
How to solve this?
3 REPLIES 3

by Oskar Jansson

Hi! Could you double-check that the shipment not only contains three lines but also that these lines are assigned to lineNumber 1, lineNumber 2, and lineNumber 3? If the three orders are placed, for example, on lineNumber 1, lineNumber 3, and lineNumber 4, you will receive the error “ 'message': 'Shipment Line: '2' not found.' ” when trying to update lineNumber 2.

thingsio
CONTRIBUTOR ***

by thingsio

Hmm, using linenumber is not really handy. We don't want to keep track of which item is on which linenumber. Why does this method not support an inventory id? No basially I need to load the shipment after sending, read it and link inventory ID's with linenumber. Bascially when we create an order we are not aware of linenumbers.

by Oskar Jansson

Line numbers are needed to keep an unique identifier for a line. InventoryId does not work as a unique identifier. In some shipments it will be the same InventoryId for several lines. A get-request to catch the lineNumber before the put-request is then what you can do. 

 

If you think lineNumbers is not effective for you and think inventoryId can be useful, you can make a post under the Ideas section of this forum.