I am trying to add a sales receipt using the .NET SDK for QuickBooks REST API v2.0 When I reach the stage of adding a line item there are missing attributes and I cannot add required attributes.
here is a portion of my current code:
DataServices dataServices = new DataServices(context);
SalesReceipt salesreceipt = new SalesReceipt();
salesreceipt.Id.Value = "23423423";
salesreceipt.Header.DocNumber = "23423423";
salesreceipt.Header.Note = "test message";
salesreceipt.Header.CustomerId.Value = "Mohsin Gillani";
salesreceipt.Header.DepositToAccountName = "PayPal";
salesreceipt.Line[0].Id.Value = "SKUEXAMPLE6";
salesreceipt.Line[0].Desc = "Google Nexus screen protector";
salesreceipt.Line[0].Amount = 2.35M;
the moment I type salesreceipt.Line[0].ItemId
, there is no intellisense suggested elements that come up when in fact there is according to the documentation for v2 an ItemId. There is no Qty either so It's impossible for me to work with.
Try something like this:
//Set Line Item
Intuit.Ipp.Data.Qbo.SalesReceiptLine qboSalesReceiptLine = new Intuit.Ipp.Data.Qbo.SalesReceiptLine();
qboSalesReceiptLine.Amount = 123;
qboSalesReceiptLine.AmountSpecified = true;
qboSalesReceiptLine.Items = new object[] { new IdType() { idDomain = idDomainEnum.QBO, Value = "63" }, 123m, 2m };
qboSalesReceiptLine.ItemsElementName = new ItemsChoiceType2[]
{
ItemsChoiceType2.ItemId, ItemsChoiceType2.UnitPrice,
ItemsChoiceType2.Qty
};
qboSalesReceipt.Line = new SalesReceiptLine[] { qboSalesReceiptLine };