Xero - beautiful accounting software

Xero Developer Help Center

Xero Developer Community

Community > Wrapper libraries >

Create invoice in Xero failing using Dot net wrapper libraries

Started by Info Power -   in Wrapper libraries

Hi All,

I have got a weird situation while trying to create invoice in XERO using Dot Net wrapper libraries and XERO Invoice API.

If I connected My App to my XERO Demo company and trying to create an Invoice in XERO it works perfectly fine.

But when I connected My App to one of our client production company and trying create a Invoice it error using the same data and same code.

Getting error
Bad request 400
Error number 14
Object reference not set to an instance of the object.

Demo Company name : Vinea Xero App
Client Company Name : BayGold limited

Not sure what exactly the error is as nothing is in the inner exception.

Can someone please help me by looking at the logs at your end.
Let me know if need more info on this issue.

Cheers,
Mangi
Best Reply as chosen by Info Power (Original Poster)
Hey Mangi,

The source of the problem was the serialization of default sales/purchases tracking categories attached to the contact the invoice was being created for. I'm guessing the contact that you were using for your demo company did not have any defaults set and so there was nothing to serialize, whereas the contact in your client company did have it set and so was serializing to incorrectly named properties.

Glad to hear you're back on track!

Cheers,
Matt
 

Matthew Mortimer (Xero Staff)