My Products
Help
Gabriella Hennings
CHAMPION *

Updating shipment allocations with kit assembly

by Gabriella Hennings

When adding a shipment to a salesorder via the API, the shipment allocations are already set with what seemes to be a suggestions by the system. Is it possible to turn this off?

 

How do you add new allocation lines of components? I just can't get it to work. Could you provide a example of how the json object should look?

 

When I'm trying to update a shipment with data below, i get the following error: "message=VismaId: d469ffd1-6e70-483f-ab72-c426ecb31b64. Object reference not set to an instance of an object."

 

{
   "shipmentType":{
      "value":"Issue"
   },
   "shipmentDetailLines":[
      {
         "operation":"Update",
         "lineNumber":{
            "value":1
         },
         "allocations":[
            {
               "operation":"Delete",
               "lineNbr":{
                  "value":2
               },
               "lotSerialNumber":{
                  "value":"2014.31"
               },
               "quantity":{
                  "value":2.000000
               }
            },
            {
               "operation":"Delete",
               "lineNbr":{
                  "value":3
               },
               "lotSerialNumber":{
                  "value":"2014.32"
               },
               "quantity":{
                  "value":2.000000
               }
            },
            {
               "operation":"Delete",
               "lineNbr":{
                  "value":4
               },
               "lotSerialNumber":{
                  "value":"2014.33"
               },
               "quantity":{
                  "value":2.000000
               }
            },
            {
               "operation":"Insert",
               "lotSerialNumber":{
                  "value":"2014.31"
               },
               "quantity":{
                  "value":1.0
               }
            },
            {
               "operation":"Insert",
               "lotSerialNumber":{
                  "value":"2014.93"
               },
               "quantity":{
                  "value":1.0
               }
            },
            {
               "operation":"Insert",
               "lotSerialNumber":{
                  "value":"2014.32"
               },
               "quantity":{
                  "value":1.0
               }
            },
            {
               "operation":"Insert",
               "lotSerialNumber":{
                  "value":"2014.94"
               },
               "quantity":{
                  "value":1.0
               }
            },
            {
               "operation":"Insert",
               "lotSerialNumber":{
                  "value":"2014.98"
               },
               "quantity":{
                  "value":1.0
               }
            },
            {
               "operation":"Insert",
               "lotSerialNumber":{
                  "value":"2014.97"
               },
               "quantity":{
                  "value":1.0
               }
            }
         ]
      }
   ]
}

 

 

Best regards
Gabriella Hennings
Cloud Connection AB
12 REPLIES 12
Gabriella Hennings
CHAMPION *

by Gabriella Hennings

Hi

Any comments or info concerning how this is meant to work?

best regards

Best regards
Gabriella Hennings
Cloud Connection AB

by Yıldırım (Updated ā€Ž27-04-2023 10:59 by Yıldırım VISMA )

Hello, 

what is the actual status of the Shipment Lines & Allocations ? You should first check this out to see how the system automatically adjusted that based on the company. 

 

e.g.

1) Stock Item with LOT & Serial Tracking
1_Stock items.jpg
2) Created Sales Order
SO_2.jpg
3) Shipment w Allocations

3-Shipments.jpg

You can only insert a new allocation if there is an unassigned quantity.

Note: To be able to insert Lot & Serial, you need to have the segment setup. Either auto-increment or manually inserted.
Lot_serial classes.jpg

After making sure that above-mentioned settings are valid in the company,
I'd recommend,
1) only sending the Delete requests to clear out allocations,
2) then sending the Insert request. 

 

Gabriella Hennings
CHAMPION *

Hello,

 

This has to do when using kit assembly product. How do I insert new allocations to a shipmentline? There is no field to specify what productnumber i want to insert. Right now it does not work howerver i try. 

 

Could you give show me a example on a request to insert new allocationlines for a kit assembly product?

 

 

Best regards
Gabriella Hennings
Cloud Connection AB

by Yıldırım (Updated ā€Ž28-04-2023 15:54 by Yıldırım VISMA )

There is no difference on the item type for Inserting / Updating allocations. You should have the correct LOT-Serial tracking configuration on the Item & company. 

 

KIT item should already be in the Sales Order > Shipment Line, and when you have the Lot-Serial setup configured, the system will automatically assign it. (No need to specifiy ItemID since you're updating the first shipment line and its allocation)

KIT_Allocation_Shipments.png

 

However, if you delete the allocation then would like to insert it again via the API, 

Example: 
PUT: https://integration.visma.net/API/controller/api/v1/shipment/000114

{
    "shipmentDetailLines": [
        {
            "operation": "Update",
            "lineNumber": {
                "value": 1
            },
            "allocations": [
                {
                    "operation": "Insert",
                    "lineNbr": {
                        "value": 1
                    },
                    "location": {
                        "value": "1"
                    },
                    "lotSerialNumber": {
                        "value": "000002"
                    },
                    "quantity": {
                        "value": 20
                    }
                }
            ]
        }
    ]
}

PUT Shipment Allocation SerialNumber - Visma.Net API.jpg

 

Output:

alloca_insert_Shipments.jpg

Gabriella Hennings
CHAMPION *

I have a non stock item including one stockitem component that has lot/serial tracking.

 

GabriellaHennings_1-1683009819205.png

 

 

I generate the shipment below, and then i remove the allocation line because i want to set it myself.

 

GabriellaHennings_0-1683009791040.png

 

https://integration.visma.net/API/controller/api/v1/shipment/000367
"shipmentDetailLines": [        {            "operation": "Update",            "lineNumber": {                "value": 1            },            "allocations": [                {                    "operation": "Insert",                    "lineNbr": {                        "value": 1                    },                    "location": {                        "value": "1"                    },                    "lotSerialNumber": {                        "value": "000002"                    },                    "quantity": {                        "value": 1                    }                }            ]        }    ]

 Server responds 204

GabriellaHennings_2-1683010019237.png

 

But nothing is inserted in the allocation

GabriellaHennings_3-1683010098309.png

 

Best regards
Gabriella Hennings
Cloud Connection AB

Hello, this can be related to the company settings. In our tests, we're able to modify the allocation based on the configuration. To be able to assist you further, we need to see & test the data on your company so that, please provide companyID & Restore DB approval via developersupport@visma.com 

Gabriella Hennings
CHAMPION *

by Gabriella Hennings (Updated ā€Ž08-05-2023 16:20 by Gabriella Hennings )

Hello,

 

What company settings is that?

So you are able to insert new allocation lines to non-stock kit item, where the components need lot numbers? How do you specify the inventory id? From what i can see there are no property for it in the API, so how does the system know which inventory item I'm referring to?

 

Do you see any faults in the json above? 

 

Best regards
Gabriella Hennings
Cloud Connection AB

@Gabriella Hennings wrote:

1)What company settings is that?

 

2)So you are able to insert new allocation lines to non-stock kit item, where the components need lot numbers?

3)How do you specify the inventory id? From what i can see there are no property for it in the API, so how does the system know which inventory item I'm referring to?

 

4) Do you see any faults in the json above? 


1) LOT & Serials Setting of the "STOCK" items included in the KIT.

(Non-Stock item doesn't have LOT-Serial tracking, and they can be added to a KIT just as a "LABOUR" to reflect some cost etc.)  

3-KITSET14-Stock items.jpg
5-Kit specifications.jpg6-nonstock-Kit specifications.jpg

 

* KIT Specifications (ScreenId=IN209500) and KIT Assembly(ScreenId=IN3070PL) 

1-KIT_NonStock.jpg

2-Kit assembly.jpg

 

2) Manage non-stock items - overview
"In the system, non-stock items are handled differently from stock items kept in warehouses. For stock items, the Inventory workspace maintains all cost, quantity, sales, and cost-of-goods-sold information. Since non-stock items do not require tracking of quantities, the Inventory workspace maintains only standard costs and base price information for them." 

 

So you can not have LOT&Serial tracking in allocation for the Non-Stock as it can also be seen in the UI. 

KIT_nonstocks.jpg

Shipment > Allocation 
KITNONSTOCK.jpg

 

3) You're specifying the "LineNumber"  in Shipment PUT Request so that system takes the Inventory from the specified line as how you first select line then opening allocation tab in the UI. 

"shipmentDetailLines": [
        {
            "operation": "Update",
            "lineNumber": {
                "value": 1
            },
               "allocations": [
                {
                 ...
                 ...

 

4) JSON is ok as previously we've shared an example. Please note that, this is for stock items.
{
    "shipmentDetailLines": [
        {
            "operation": "Update",
            "lineNumber": {
                "value": 1
            },
            "allocations": [
                {
                    "operation": "Update",
                    "lineNbr": {
                        "value": 1
                    },
                    "location": {
                        "value": "1"
                    },
                    "lotSerialNumber": {
                        "value": "000002"
                    },
                    "quantity": {
                        "value": 20
                    }
                }
            ]
        }
    ]
}ā€‹
Gabriella Hennings
CHAMPION *

by Gabriella Hennings (Updated ā€Ž15-05-2023 15:59 by Gabriella Hennings )

Here is how the non-stock kit item looks. All of the components are stock items with lot-tracking:

GabriellaHennings_0-1684158434880.png

 

 

And here it is on a shipment:

GabriellaHennings_1-1684158531951.png

 

And the allocations, with already pregenerated lots. As you can see, they have different product number too.

I can update existing rows here in the allocation, but I can't insert new once through the API. 

All of the allocations reference the same shipment row, so therefor i don't understand how it would know the product number of the lot/seriel i would be inserting as a new row.

GabriellaHennings_4-1684159136923.png

 

 

What am i missing?

Best regards
Gabriella Hennings
Cloud Connection AB

by Magnus Johnsen

What type of ldot/serial class is applied to the item? You can get this by checking the lot/serial class of the inventoryitem via the API or the UI and then either get the serialclass via the api/v1/lotserialclass/{id} endpoint or via the UI.

 

Gabriella Hennings
CHAMPION *

Still no news concerning this matter?

It is very urgent for us, and it's not working. We have a customer which can not create/release these kind of orders trough their wms system since it's not working with the API.

can you please provide with a solution how this should work and how it should be done?

Best regards
Gabriella Hennings
Cloud Connection AB
Gabriella Hennings
CHAMPION *

GabriellaHennings_1-1681735348636.png

 

I just realized that inserting new allocations will never work? There are no property to set which product number the serielnumber is of?

 

Best regards
Gabriella Hennings
Cloud Connection AB