My Products
Help
Anonymous
Not applicable

Updating subaccount on an invoice

by Anonymous

Hi! 

 

I would like to update an existing invoice. 

 

I am trying to update the cost bearer (subaccounts) for 1 line. See the picture attached.

 

I sent a response through swagger, and I got a response code 204 (Indicating that it went through).

However, I am still not able to see the changes in the UI. 

 

I am using the following response body, everything gets updated except for the subaccount:

 

 

  

 

{"invoiceLines": [
{
"operation": "Update",
"lineNumber": {
"value": 1
},
"transactionDescription": {
"value": "Nice? "
},
"quantity": {
"value": 1
},
"unitCostInCurrency": {
"value": 5
},
"subaccount":
{
"segmentId": 1,
"segmentValue": 064
}
,
"accountNumber": {
"value": 6720
},
"vatCodeId": {
"value": 13
},
"note": {
"value": "Nice"
},
}
]}

 

Can somebody tell where the problem lies? 

5 REPLIES 5

by Magnus Johnsen

Hi,

Please send the fields like this, as per the Swagger documentation:

"subaccount": [
{
"segmentId": 1,
"segmentValue": 064
} ]

Anonymous
Not applicable

by Anonymous

Hi,

 

I tried this directly and I got the same as with before:

 

{"invoiceLines": [
{
"operation": "Update",
"lineNumber": {
"value": 1
},
"subaccount": [
{
"segmentId": 1,
"segmentValue": 064
}
]}]}.

 

It still did not update the invoice. 
Response code 204, so it should've been updated. 

Accepted solution
Magnus Johnsen
VISMA

by Magnus Johnsen

Hi,

Could you please check these things:

Segment keys(ScreenId=CS202000&DimensionID=SUBACCOUNT):

MagnusJohnsen_0-1644298401826.png

Click the segment ID's to see if you are supplying a valid input:

MagnusJohnsen_1-1644298538239.png

Check if you are supplying the correct combination by checking the subAccounts screen(ScreenId=GL203000):

MagnusJohnsen_2-1644298644593.png

If these are corresponding to your environment, please try to send the segmentValue as a string:

{
"invoiceLines": [{
"operation": "Update",
"lineNumber": {
"value": 1
},
"subaccount": [{
"segmentId": 1,
"segmentValue": "064"
}]
}]
}

 

If it is still not working, please send us an email to developersupport@visma.com

Thank you. 

 

 

 

 

Anonymous
Not applicable

by Anonymous

Hi! 

I found out what what the problem was. It seems like the changes in the cost bearer that is being made must correspond to the number of segment-IDs. In my case I have six segment-IDs, and I therefore have to specify the remaining segment-ID's - despite the fact that I want to only change one. 

Accepted solution
Magnus Johnsen
VISMA

by Magnus Johnsen

Hi,

Yes, currently you are not able to change only one part of the segment, in these cases it is easiest to GET the invoice, check the line, get the full subAccount and then replace the one part you need to replace. 

 

If being able to update partial subAccounts is a functionality you need, please create a post in the "Idea's" part of the forum, explaining as detailed as possible your business need.

This allows other users to vote for your suggestion, which in turn can influence the development teams assessment process. 

Thank you.