xmlhttprequest - Quickbooks PHP - qbXML mapping TransactionRet(Invoice) with ItemServiceRet -


i'm developing rountine store invoice local database based on quickbooks invoices.

using qbxml request:

$xml ='<?xml version="1.0" encoding="utf-8"?>         <?qbxml version="8.0"?>         <qbxml>           <qbxmlmsgsrq onerror="stoponerror">             <invoicequeryrq requestid="'.$requestid.'">             </invoicequeryrq>           </qbxmlmsgsrq>         </qbxml>'; return $xml; 

and results want, example data:

<invoiceret> <txnid>11-1428375941</txnid> <timecreated>2015-04-06t23:05:41-05:00</timecreated> <timemodified>2015-04-06t23:05:41-05:00</timemodified> <editsequence>1428375941</editsequence> <txnnumber>5</txnnumber> <customerref>     <listid>8000005a-1424374192</listid>     <fullname>fake</fullname> </customerref> <araccountref>     <listid>80000010-1424374182</listid>     <fullname>accounts receivable</fullname> </araccountref> <templateref>     <listid>8000000b-1424373504</listid>     <fullname>time &amp; expense invoice</fullname> </templateref> <txndate>2015-04-06</txndate> <refnumber>3</refnumber> <billaddress>     <addr1>fake </addr1>     <addr2>fake address</addr2>     <city>fake city</city>     <state>on</state>     <postalcode>123 abc</postalcode> </billaddress> <billaddressblock>     <addr1>fake address</addr1>     <addr2>fake address</addr2>     <addr3>fake address</addr3> </billaddressblock> <ispending>false</ispending> <isfinancecharge>false</isfinancecharge> <termsref>     <listid>80000006-1424373984</listid>     <fullname>net 30</fullname> </termsref> <duedate>2015-05-06</duedate> <shipdate>2015-04-06</shipdate> <subtotal>1299.00</subtotal> <salestaxpercentage>13.00</salestaxpercentage> <salestaxtotal>168.87</salestaxtotal> <appliedamount>0.00</appliedamount> <balanceremaining>1467.87</balanceremaining> <ispaid>false</ispaid> <istobeprinted>true</istobeprinted> <istobeemailed>false</istobeemailed> <istaxincluded>false</istaxincluded> <customersalestaxcoderef>     <listid>80000006-1424373984</listid>     <fullname>h</fullname> </customersalestaxcoderef> 

i want see which items in invoice. ran xml items. example of got:

    <itemserviceret>     <listid>80000021-1424374186</listid>     <timecreated>2015-02-19t14:29:46-05:00</timecreated>     <timemodified>2015-02-19t14:29:46-05:00</timemodified>     <editsequence>1424374186</editsequence>     <name>prep. of electrical drawing</name>     <fullname>prep. of electrical drawing</fullname>     <isactive>true</isactive>     <sublevel>0</sublevel>     <istaxincluded>false</istaxincluded>     <salestaxcoderef>         <listid>80000006-1424373984</listid>         <fullname>h</fullname>     </salestaxcoderef>     <salesorpurchase>         <desc>for preparation of electrical drawings</desc>         <price>0.00</price>         <accountref>             <listid>80000034-1424374183</listid>             <fullname>engineering revenue</fullname>         </accountref>     </salesorpurchase> </itemserviceret> 

i've tried long can't find variable can use link items proper invoice.

which xml node on item has id/information on invoice item belongs to?

is there better qbxml this? i've tried sales journalentry documented on site:

http://developer-static.intuit.com/qbsdk-current/common/newosr/index.html

if refer quickbooks osr:

you'll see option:

<includelineitems>true</includelineitems>

with description:

this filter allows omit line items query response smaller result. default value false, line items omitted default. set includelineitems true include line items in response if dont mind getting larger result.

so, if want line items, change request to:

$xml ='<?xml version="1.0" encoding="utf-8"?>         <?qbxml version="8.0"?>         <qbxml>           <qbxmlmsgsrq onerror="stoponerror">             <invoicequeryrq requestid="'.$requestid.'">               <includelineitems>true</includelineitems>             </invoicequeryrq>           </qbxmlmsgsrq>         </qbxml>'; return $xml; 

Popular posts from this blog