My Products
Help
Timo_O
CONTRIBUTOR ***

API Post Salesorder , more informative response, when inventoryId is unknown or

by Timo_O
Status: New

Hi,

 

sending a request 'POST /API/controller/api/v1/salesorder' with inventoryId, which is not found from VismaNet,  gives a response 'HTTP/1.1 400 Bad Request / {"message":"Inventory error: The unit conversion is missing."}.

 

Is it possible to get the inventoryId(s) which are incorrect in the response?

Sometimes there are several orderlines, and its hard do solve which inventoryId is incoorect.

 

Wbr, Timo

4 Comments
by Magnus Johnsen
Status changed to: Status: New

Hi,

No you will not be able to see what line causes this.

The error is referring to a line/inventoryItem missing "UOM" field, please specify this according to the inventory settings, 

Please have a look at these(ScreenId=IN202500):

2020-09-03 14_13_32-Stock items.png

Timo_O
CONTRIBUTOR ***
by Timo_O

Hi,

 

thanks, for quick answer.

In my experience, you get this response "Inventory error: The unit conversion is missing."  also when the inventoryId is not found from VismaNet at all.

Our customer receives salesorders from their customers, with several rows = several inventoryIds. Every now and there has been incorrect inventoryId(s)  and its quite frustrating to find out first which inventoryID:s are used in request, and there after to browse/check out Visma which inventoryId is missing or incorrect. It would be much more informable to give the incorrect inventoryIds in the response. For example 'Inventory error: Please check the status of inventories: xxxxxx,yyyyy,zzzzz....'

-Timo-

Timo_O
CONTRIBUTOR ***
by Timo_O

Hi,

 

our customer still has problems with this. The interface error message has changed format, but the message still does not mention the product key that is causing the problem. They had recently order with 800 lines, one product-id was erronous. Checking which one is pain.  The error message is changed and is more informative but could you please add the erronous inventoryId in the error message?

 

Error message now:

{"message":"Error: Inserting 'Sales order line' record raised at least one error. Please review the errors.\r\nThe specified inventory ID or alternate ID cannot be found in the system.\r\nError: 'Warehouse' cannot be empty.\r\nError: 'Undership threshold %' cannot be empty.\r\nError: 'Overship threshold (%)' cannot be empty.\r\n"

by Magnus Johnsen

HI,

We recently had a different case also regarding an Inventory related error in the salesOrder endpoint.

The conclussion in that case was that we will not be fixing this in the current endpoint, but will focus on this and many other issues with the salesOrder endpoint during this year.

This year we have a major project where the plan is to rewrite all of the salesOrder logic.