My Products
Help
joelbacklund
CONTRIBUTOR **

VismaId: 53ea8cc5-5873-4db0-9f4a-ce7f16e564ac. Error reversing invoiceObject reference not set to an

by joelbacklund

I get a 500 error with the following error message when i try to reverse a debit invoice that has the status of "open":
VismaId: 53ea8cc5-5873-4db0-9f4a-ce7f16e564ac. Error reversing invoiceObject reference not set to an instance of an object.

The creditNote is however still created even though I got the 500 error. How should I interpret this? Would be great if you could specify exactly what is wrong when users get these kind of errors instead of generalizing each error.

 

When i try to reverse the same kind of debit invoice with the same kind of data from the UI, I do not get any errors, so something seems to be wrong when reversing invoices through the API.

7 REPLIES 7
Yıldırım
VISMA

by Yıldırım

Hi, is it only happened with that specific transaction ? Have you tried reversing a different invoice ?
Please share your request URL / API Client ID / CompanyID & Name / Request Time Stamp. 

joelbacklund
CONTRIBUTOR **

by joelbacklund

Request URL: https://integration.visma.net/API/controller/api/v1/customerinvoice/400113/action/reverse
API Client ID: isv_test_insights
CompanyID: 979f323f-4fa3-11ed-98d8-06a0b4eada6b
CompanyName: DEMO Polhem International AB
Request Time Stamp: Thu, 11 Jan 2024 10:52:47 GMT

Response body:

{
    "message": "VismaId: 0fb3eb0d-7056-4ccf-bd51-f2a6eea80343. Error reversing invoiceObject reference not set to an instance of an object."
}


Status: 500 Internal Server Error

 



Yıldırım
VISMA

by Yıldırım

is it only happened with that specific transaction ? Have you tried reversing a different invoice ? 

 

joelbacklund
CONTRIBUTOR **

by joelbacklund

I keep getting that error when i reverse different open debit invoices. I have tried reversing several different debit invoices with the status of open.  My assumption is that there might be some error on you side in the end of the credit functionality, since the credit invoice is still being created, but I recieve an error. So it seems like it goes through the majority of your credit function but then fails on some variable in the end. However I do not know what your code base looks like, so this is just pure speculation 🙂

What I would like, since the credit invoice is created, is to have a 200 response instead of a 500 error response, because then I can send a correct success message to my users in our system 🙂

Yıldırım
VISMA

by Yıldırım

Thanks for sharing information, Joel, could you share an example of how one of your open debit invoices look like ? Would be great if you could send us a print screen showing Header / Lines of the invoice from the UI <developersupport@visma.com> then we'll continue investigating the case. 

joelbacklund
CONTRIBUTOR **

by joelbacklund

Sent 🙂

Yıldırım
VISMA

by Yıldırım

Hello,

there is an update from the developer team,

 

"Tested reverse invoice using  /controller/api/v1/customerinvoice/{invoiceNumber}/action/reverse on the customer database in Internal with several Open invoices and there is no error. It is not reproducable.

We've tested from UI and it works as expected.
We've also checked the logs and I see this error a lot for this customer."

 

Is there something you are doing before reversing? Can you share more details on the steps you do?