My Products
Help
Dante Cavallin
CONTRIBUTOR *

Issue when addning subaccount on Customer invoice

by Dante Cavallin

I am getting the following error when trying to create a customer invoice:

"message": "VismaId: 8f846627-49e6-4e58-81d4-13ead04b2fd3. Error creating document. Error: Kostnadsställe, Läkare, Projekt of SubID do not exist."

Endpoint : /controller/api/v2/customerinvoice

 

This is the json I am sending in :

{
"externalReference":
{
"value":"F21-0002"
},
"invoiceLines":[
{
"operation":"Insert",
"inventoryNumber":{"value":"12345"},
"description":{"value":"Hudvård"},
"quantity":{"value":1.0},
"unitPriceInCurrency":{"value":530.0},
"subaccount":[
{"segmentId":1,"segmentValue":"21"},
{"segmentId":2,"segmentValue":"000"},
{"segmentId":3,"segmentValue":"00"}]
}],
"referenceNumber":{"value":"0000001"},
"customerNumber":{"value":"10001"},
"documentDate":{"value":"2022-11-11T00:00:00.0000000"},
"invoiceText":{"value":"6789, 2022-11-11"},
"note":{"value":""}
}

 

I have verified and the value 21 exist for segmentid 1.

 

4 REPLIES 4

by Magnus Johnsen

Hi,

Please make sure that all the values are available under respective subaccount segment key(ScreenId=CS202000&DimensionID=SUBACCOUNT):

2022-11-17 11_59_34-Segment keys - Brave.png

As well as the whole combination under subaccounts screen(ScreenId=GL203000):

2022-11-17 11_56_20-Subaccounts - Brave.png

Dante Cavallin
CONTRIBUTOR *

Hi, I have checked these things and it looks ok, I have also tried to create a customer invoice via the GUI and there it works fine.

 

Are you using the same user the same user in the UI as you are when you are using the API?

Dante Cavallin
CONTRIBUTOR *

Yes it is the same user.