I'm using the QBO .Net SDK v3.0 and I'm trying to get the last bit of data I need from purchases.
I can get all the data I need from the purchase, and most of what I need from the purchase line item. The thing is, I can't get the expense details (chart of account info). Here' s the XML response from the api explorer for a line item under a purchase. It shows what I need, essentially "Office Expense".
<Line>
<Id>1</Id>
<Amount>74.97</Amount>
<DetailType>AccountBasedExpenseLineDetail</DetailType>
<AccountBasedExpenseLineDetail>
<AccountRef name="Office Expense">52</AccountRef>
<BillableStatus>NotBillable</BillableStatus>
<TaxCodeRef>NON</TaxCodeRef>
</AccountBasedExpenseLineDetail>
</Line>
I can get the data not contained by the AccountBasedExpenseLineDetail section with something like the following code (edited for brevity):
// getting list of purchases....
string pQuery = string.Format("Select * FROM Purchase", startDate);
IEnumerable<Purchase> purchases = purchaseQueryService.ExecuteIdsQuery(pQuery).ToList();
// then loop through each line item of each purchase using an iterator
for (int lineItem = 0; lineItem < numLines; lineItem++)
// then get some data...
lineAmount = purchaseInfo.Line[lineItem].Amount.ToString();
Any ideas?