I am having trouble simply creating a Bill using the .NET C# SDK.
I am getting an exception that indicates that I am not supplying a required parameter.
So I went to the IPP online documentation here:
https://developer.intuit.com/docs/0025_quickbooksapi/0050_data_services/030_entity_services_reference/bill
Using their example XML, which is as follows:
<Bill xmlns="http://schema.intuit.com/finance/v3" >
<Line>
<Id>1</Id>
<Amount>700.00</Amount>
<DetailType>AccountBasedExpenseLineDetail</DetailType>
<AccountBasedExpenseLineDetail>
<AccountRef>75</AccountRef>
</AccountBasedExpenseLineDetail>
</Line>
<VendorRef>81</VendorRef>
</Bill>
I have converted this (changing some values only) to the following c# code, please assume that my Data Service is valid (which it is):
var bill = new Bill
{
Line = new[]
{
new Line
{
Id = "1",
Amount = (decimal) 700.00,
DetailType = LineDetailTypeEnum.AccountBasedExpenseLineDetail,
AnyIntuitObject = new AccountBasedExpenseLineDetail
{
AccountRef = new ReferenceType
{
Value = "90"
}
}
}
},
VendorRef = new ReferenceType
{
Value = "7"
}
};
Bill resultBill = IppDataService.Add(bill) as Bill;
return resultBill;
However, this code throws an exception on the Data Service Add method. Top Level is "IdsExcption: Bad Request". Inner Exception is "ValidationException", and inner exception to that is "IdsError: Required param missing, need to supply the required value for the API".
Since I am using Intuit's example, I'm not sure what parameter(s) I might be missing -- although perhaps I am translating incorrectly from the XML to the SDK object.
Any thoughts here? And any further notion of where the documentation is that stated definitively for a given API call, what parameters are required for Add?
Much appreciated.