My Products
Help
gordana_jlmwms
CHAMPION *

Split row (update/insert) on a prebooked invoices

by gordana_jlmwms

Is it possible to do it via API and if yes, is there any documentation on this how to do it so that it is correct?

Have tried running PUT with a test json

 

{"invoiceLines":[

{"operation":"update",

"lineNumber":{"value":1},

"splitLine":{"value":true},

"splitHierarchy":{"value":"1"}},

{"operation":"insert",

"transactionDescription":{"value":"Prelbokad via verifikat 100320 - Levfaktura nr G15 - Lev. 50"},

"costInCurrency":{"value":20.0},

"accountNumber":{"value":"4033"},

"subaccount":[

{"segmentId":1,"segmentValue":"0"},

{"segmentId":2,"segmentValue":"00000"},

{"segmentId":3,"segmentValue":"000"},

{"segmentId":4,"segmentValue":"00"},

{"segmentId":5,"segmentValue":"000"}],"note":{"value":""}}

]}

 

response

{"message":"Invoice 200239 cannot be updated because it is already Pre-booked."}

 

 

5 REPLIES 5
Accepted solution
Sandra Anté
VISMA

by Sandra Anté

Hi,

We had some input from the development team regarding the structure of the request. The request must be sent with an "insert" operation and should not contain two operations. Please try the following.

{
    "invoiceLines": [
        {
            "operation": "Insert",
            "lineNumber": {
                "value": 1
            },
            "splitLine": {
                "value": true
            },
            "splitHierarchy": {
                "value": "1"
            },
            "transactionDescription": {
                "value": "Prelbokad via verifikat 100320 - Levfaktura nr G15 - Lev. 50"
            },
            "costInCurrency": {
                "value": 20.0
            },
            "accountNumber": {
                "value": "4031"
            },
            "subaccount": [
                {
                    "segmentId": 1,
                    "segmentValue": "0"
                },
                {
                    "segmentId": 2,
                    "segmentValue": "00000"
                },
                {
                    "segmentId": 3,
                    "segmentValue": "000"
                },
                {
                    "segmentId": 4,
                    "segmentValue": "00"
                },
                {
                    "segmentId": 5,
                    "segmentValue": "000"
                }
            ],
            "note": {
                "value": ""
            }
        }
    ]
}

Kind regards
Sandra Anté
gordana_jlmwms
CHAMPION *

by gordana_jlmwms

{"invoiceLines":[{"operation":"update","lineNumber":{"value":1},"splitLine":{"value":true},"splitHierarchy":{"value":"1"}}]}

 

PUT 

 

https://integration.visma.net/API/controller/api/v1/supplierInvoice/200242

 

or

 

https://integration.visma.net/API/controller/api/v1/supplierInvoice/Invoice/200242

 

 

 

 

get invoice not found i response.  (PREBOOK invoice)

 

visma

gordana_jlmwms_0-1711461861801.png

 

 

How to  SPLIT ROW  so that it is correct ?? 

Sandra Anté
VISMA

by Sandra Anté (Updated ‎27-03-2024 08:08 by Sandra Anté VISMA )

Hi,

Yes, there seems to be an issue with using the split line via the API. The development team has been informed about this.

Disregard that the post is marked as solved!

Kind regards
Sandra Anté

Sandra Anté
VISMA

by Sandra Anté

Hi,

The error you are receiving is due to trying to insert a new line to a prebooked invoice. That is not possible via the API. However we have informed the issue to the developer team. We'll get back to you as soon as we have more information.

Kind regards
Sandra Anté

gordana_jlmwms
CHAMPION *

So, you're saying that it's not possible to split row on a prebooked invoice via API?