I am getting the error "Value cannot be null. Parameter name: key" at the line xapi.Items.Create(item1) , while creating an inventory item using Github Xero c# lib. What could be wrong?
Here is the c# code:
string xeroAPIUrl = "https://api.xero.com";
PrivateAuthenticator pAuth = new PrivateAuthenticator(@"..\publickey.cer");
Consumer consumer = new Consumer("............", ".................");
XeroCoreApi xapi = new XeroCoreApi(xeroAPIUrl, pAuth, consumer, null, new DefaultMapper(), new DefaultMapper());
Item item1 = new Item();
item1.Id = Guid.NewGuid();
item1.Code = "BTC";
item1.Name = "BITCOIN";
item1.Description = "Bitcoin Entry";
item1.PurchaseDescription = "Bitcoin Purchase";
item1.PurchaseDetails = new PurchaseDetails() { UnitPrice = 100.00m,
AccountCode = "200" };
item1.SalesDetails = new SalesDetails() { UnitPrice = 110.00m, AccountCode = "300" };
item1 = xapi.Items.Create(item1);
Regards,
Murali