I am making an application that gets all invoices for one month, and then saves each of those invoices as a PDF, I have never developed with QuickBooks so I have very little knowledge about it. Would someone be able to give me any source code that does this or something similar for me to build off of? I have found a couple links that I think are pointing me in the right direction but I'm not 100% sure:
How can I get the invoices that has been paid on an specific date from QuickBooks to .NET app?
https://intuitdeveloper.lc.intuit.com/questions/1060982-quickbooks-online-api-invoice-pdf-download
I am using C# .NET and QBFC13Lib.
Edit:
I have taken this code for getting all invoices from the linked question.
bool sessionBegun = false;
bool connectionOpen = false;
QBSessionManager sessionManager = null;
try
{
//Create the session Manager object
sessionManager = new QBSessionManager();
//Create the message set request object to hold our request
IMsgSetRequest requestMsgSet = sessionManager.CreateMsgSetRequest("US", 13, 0);
requestMsgSet.Attributes.OnError = ENRqOnError.roeContinue;
//Connect to QuickBooks and begin a session
sessionManager.OpenConnection("", "GenerateInvoicePDFs");
connectionOpen = true;
sessionManager.BeginSession("", ENOpenMode.omDontCare);
sessionBegun = true;
IInvoiceQuery invoiceQueryRq = requestMsgSet.AppendInvoiceQueryRq();
invoiceQueryRq.IncludeLineItems.SetValue(true);
//Send the request and get the response from QuickBooks
IMsgSetResponse responseMsgSet = sessionManager.DoRequests(requestMsgSet);
IResponse response = responseMsgSet.ResponseList.GetAt(0);
IInvoiceRetList invoiceRetList = (IInvoiceRetList)response.Detail;
var invoices = new List<Invoice>();
if (invoiceRetList != null)
{
for (int i = 0; i < invoiceRetList.Count; i++)
{
IInvoiceRet invoiceRet = invoiceRetList.GetAt(i);
var invoice = new Invoice
{
QuickBooksID = invoiceRet.TxnID.GetValue(),
EditSequence = invoiceRet.EditSequence.GetValue()
};
}
}
}
catch
{
}
I am given an error that says that Invoice is not a type.