Pranjal
Pranjal

Reputation: 101

QuickBook desktop budget api through Webconnector

I was trying to get the budget from the QuickBooks desktop with the help webconnector. But I am getting "QuickBooks found an error when parsing the provided XML text stream" in the Quickbook log file. Even though "qbValidator.exe" is showing as a valid XML request when i tried to validate with the qbValidator tool with quickbook sdk. Below is my XML request. It will be helpful if someone can help me find out where I have gone wrong. The budget is already present in the QuickBooks and it shows report from the UI. Thank you in advance

<?xml version="1.0" encoding="UTF-8"?>

<?qbxml version="13.0"?>

<QBXML>

  <QBXMLMsgsRq onError="stopOnError">

   <BudgetSummaryReportQueryRq requestID="1">

     <BudgetSummaryReportType>BalanceSheetBudgetOverview</BudgetSummaryReportType>

     <FiscalYear>2021</FiscalYear>

     <BudgetCriterion >Accounts</BudgetCriterion> 

     <SummarizeBudgetColumnsBy>Date</SummarizeBudgetColumnsBy>

     <SummarizeBudgetRowsBy>Account</SummarizeBudgetRowsBy>

   </BudgetSummaryReportQueryRq>

  </QBXMLMsgsRq>

</QBXML>

Upvotes: 1

Views: 107

Answers (1)

Pranjal
Pranjal

Reputation: 101

sdktestplus3-tool provided by intuit comes handy when validating the request. We can set up with following links
https://developer.intuit.com/app/developer/qbdesktop/docs/get-started/first-steps-with-the-sdktestplus3-tool

Once we have the QBXML file, we can either enter the filename and path in the Request File line or select Browse and find the xml you want to use.

You do not need to make any other changes to the flags, unless you are needing to test a specific setup. Now you will just follow the same steps as your program normally does. In the Status window you will see any errors or messages.

  1. Open Connection
  2. Begin Session - If you have used SDKTestPlus3 before, the normal authorization dialog will appear.
  3. Send Request

Once you have sent a request, you can View Output by selecting that button or in the same directory as the request file, you will see a QBResponse.xml file that has the response in it.

N.B. Make sure you always End Session and Close Connection before exiting. Otherwise, you will not be able to close QuickBooks because it thinks there is a program still trying to access it.

with the above steps, the QBXML is modified to below for getting the response

<?xml version="1.0" encoding="UTF-8"?>
   <?qbxml version="12.0"?>
      <QBXML>
         <QBXMLMsgsRq onError="continueOnError">
             <BudgetSummaryReportQueryRq requestID="%s">
                <BudgetSummaryReportType>ProfitAndLossBudgetOverview</BudgetSummaryReportType>
          <FiscalYear>2021</FiscalYear>
                 <BudgetCriterion>Accounts</BudgetCriterion>                               
                 <SummarizeBudgetColumnsBy>Date</SummarizeBudgetColumnsBy> 
                 <SummarizeBudgetRowsBy>Account</SummarizeBudgetRowsBy>
           </BudgetSummaryReportQueryRq>
       </QBXMLMsgsRq>
   </QBXML>

Upvotes: 1

Related Questions