My Products
Help
alexandreveeck
CONTRIBUTOR **

Error when inserting customer invoice: UoM 'KM' cannot be found in the system

by alexandreveeck

Hi 

 

I'm having an error when trying to insert a customer invoice on Visma API. 

The whole json is really long so I will share the part that matters the most for me, the invoice line that is causing the issue: 

 

{
"operation":"Insert",
"inventoryNumber":{
"value":"1"
},
"description":{
"value":"Servicebil"
},
"quantity":{
"value":62.0
},
"unitPriceInCurrency":{
"value":8.5
},
"accountNumber":{
"value":"3011"
},
"uom":{
"value":"KM"
},
"subaccount":[
{
"segmentId":1,
"segmentValue":"20"
},
{
"segmentId":2,
"segmentValue":"10598"
},
{
"segmentId":3,
"segmentValue":"2"
}
]
}{
"operation":"Insert",
"inventoryNumber":{
"value":"1"
},
"description":{
"value":"Servicebil"
},
"quantity":{
"value":62.0
},
"unitPriceInCurrency":{
"value":8.5
},
"accountNumber":{
"value":"3011"
},
"uom":{
"value":"KM"
},
"subaccount":[
{
"segmentId":1,
"segmentValue":"20"
},
{
"segmentId":2,
"segmentValue":"10598"
},
{
"segmentId":3,
"segmentValue":"2"
}
]
}

 

The error response from the API: 

{"message":"Error: Inserting 'Customer transactions' record raised at least one error. Please review the errors.\r\nError: UoM 'KM' cannot be found in the system.\r\n"}


So I made a request to the unitofmeasure endpoint to check if exists, and it does. 

The same behavior is happening with the UoM ST and I. 

alexandreveeck_0-1682094031421.png

 

Any idea what could be happening?

 

3 REPLIES 3
Accepted solution
Yıldırım
VISMA

by Yıldırım

Hello, you should specifically check the inventoryNumber:1 to make sure KM is defined as one of the units of a measure. 

alexandreveeck
CONTRIBUTOR **

That was causing the issue. Thank you!

Yıldırım
VISMA

Thank you for the confirmation !