I want to get all inventory items from quickbooks with only full name and quantity on hand fields, in order to get a smaller xml. Do you know how to achieve this?
This is the xml query request:
<?xml version="1.0" encoding="utf-8"?>
<?qbxml version="10.0"?>
<QBXML>
<QBXMLMsgsRq onError="stopOnError">
<ItemInventoryQueryRq>
</ItemInventoryQueryRq>
</QBXMLMsgsRq>
</QBXML>
You can use this tag to pick specifically which fields you want to include:
<IncludeRetElement>
For example, this gets invoices, but only the TxnID, EditSequence, and RefNumber fields:
<?xml version="1.0" encoding="utf-8"?>
<?qbxml version="8.0"?>
<QBXML>
<QBXMLMsgsRq onError="stopOnError">
<InvoiceQueryRq requestID="abcd1234">
<TxnID>ABCD-1234</TxnID>
<IncludeRetElement>TxnID</IncludeRetElement>
<IncludeRetElement>EditSequence</IncludeRetElement>
<IncludeRetElement>RefNumber</IncludeRetElement>
</InvoiceQueryRq>
</QBXMLMsgsRq>
</QBXML>
Example from this wiki:
http://www.consolibyte.com/docs/index.php/QbXML_for_Querying_for_Invoices,_and_limiting_returned_info
http://www.consolibyte.com/docs/index.php/Example_qbXML_Requests
You may also want to reference Intuit's documentation which shows this, the QuickBooks OSR:
https://developer-static.intuit.com/qbsdk-current/common/newosr/index.html
Related
When I add an Invoice to Quickbooks with QBXML I use <InvoiceLineAdd> to add invoice lines. How do I get the invoice lines for an invoice when I am doing InvoiceQuery?
The IncludeLineItems tag is what you're looking for. For example:
<?xml version="1.0" encoding="utf-8"?>
<?qbxml version="13.0"?>
<QBXML>
<QBXMLMsgsRq onError="stopOnError">
<InvoiceQueryRq>
<RefNumber>ABC123</RefNumber>
<IncludeLineItems>true</IncludeLineItems>
<IncludeLinkedTxns>true</IncludeLinkedTxns>
</InvoiceQueryRq>
</QBXMLMsgsRq>
</QBXML>
I want to get sales order from Quickbook Desktop.
From Quickbook reference i am using Salesorderquery(2.1)
Below is the XML i am using
<?xml version="1.0" encoding="utf-8"?>
<?qbxml version="13.0"?>
<QBXML>
<QBXMLMsgsRq onError="stopOnError">
<SalesOrderQueryRq metaData="ENUMTYPE" iterator="ENUMTYPE" iteratorID="UUIDTYPE"/>
</QBXMLMsgsRq>
</QBXML>
but when i try to test the xml request via SDKTESTPLUS3 i am getting below error
QuickBooks found an error when parsing the provided XML text stream.
Can you please tell me what i am doing wrong in this request.
You have a few problems here:
metaData="ENUMTYPE" - This is an enum (https://en.wikipedia.org/wiki/Enumerated_type), and ENUMTYPE is not a valid value for the enum. Either remove this attribute, or specify a valid type.
iterator="ENUMTYPE" - This is also an enum, same deal.
iteratorID="UUIDTYPE" - This is supposed to be a UUID. If you aren't continuing an iterator, you should leave this attribute out. Otherwise, use the UUID for the iterator.
Also, some versions of QuickBooks use an XML parser that doesn't like self-closed tags. Try this instead:
<?xml version="1.0" encoding="utf-8"?>
<?qbxml version="13.0"?>
<QBXML>
<QBXMLMsgsRq onError="stopOnError">
<SalesOrderQueryRq></SaalesOrderQueryRq>
</QBXMLMsgsRq>
</QBXML>
I'm using Intuit QuickBooks Pro 2015.
With QBXMLRP2 and with the following XML file I can open the QuickBooks UI and prefill a new invoice with the desired customer, on this case: George Clooney.
<?xml version="1.0" ?>
<?qbxml version="4.0"?>
<QBXML>
<QBXMLMsgsRq onError="stopOnError">
<TxnDisplayAddRq requestID = "1">
<TxnDisplayAddType>Invoice</TxnDisplayAddType>
<EntityRef>
<FullName>George Clooney</FullName>
</EntityRef>
</TxnDisplayAddRq>
</QBXMLMsgsRq>
</QBXML>
Until here everything is OK.
My problem is that I need to add items to this invoice.
Then, I try something like:
<?xml version="1.0" ?>
<?qbxml version="4.0"?>
<QBXML>
<QBXMLMsgsRq onError="stopOnError">
<TxnDisplayAddRq requestID = "1">
<TxnDisplayAddType>Invoice</TxnDisplayAddType>
<EntityRef>
<FullName>George Clooney</FullName>
</EntityRef>
<InvoiceLineAdd>
<Desc>For the house</Desc>
<Quantity>1</Quantity>
<Rate>120.00</Rate>
</InvoiceLineAdd>
</TxnDisplayAddRq>
</QBXMLMsgsRq>
</QBXML>
but I get the following error:
Exception: QuickBooks found an error when parsing the provided XML text stream.
On the Programmer's Guide I don't find the way to do this:
https://developer-static.intuit.com/qbSDK-current/doc/PDF/QBSDK_ProGuide.pdf
Here are the available XML examples:
https://github.com/IntuitDeveloper/QBXML_SDK13_Samples/tree/master/xmlfiles/legacy
For my example I used specifically, the file: TxnDisplayAdd_Invoice.xml.
My question: How do I add items to this new invoice?
Thanks.
You should refer to the QuickBooks OSR for qbXML reference:
https://developer-static.intuit.com/qbsdk-current/common/newosr/index.html
The supported XML request nodes look like this:
<?xml version="1.0" encoding="utf-8"?>
<?qbxml version="13.0"?>
<QBXML>
<QBXMLMsgsRq onError="stopOnError">
<TxnDisplayAddRq>
<!-- TxnDisplayAddType may have one of the following values: Bill, BillPayment, BuildAssembly, Charge, Check, CreditCardCharge, CreditCardCredit, CreditMemo, Deposit, Estimate, InventoryAdjustment, Invoice, ItemReceipt, JournalEntry, PurchaseOrder, ReceivePayment, SalesOrder, SalesReceipt, SalesTaxPaymentCheck, VendorCredit -->
<TxnDisplayAddType >ENUMTYPE</TxnDisplayAddType> <!-- required -->
<EntityRef> <!-- optional -->
<ListID >IDTYPE</ListID> <!-- optional -->
<FullName >STRTYPE</FullName> <!-- optional -->
</EntityRef>
</TxnDisplayAddRq>
</QBXMLMsgsRq>
</QBXML>
In short - you can't do what you're trying to do. QuickBooks doesn't support it.
The only thing you can pre-fill is the entity (customer).
I'm doing a QBXML PriceLevelQuery request. I've tried multiple variations but no matter what I do the response is always to give me a full data dump of all PriceLevel records until the system times out. It wasn't until I left something in the XML that should have literally thrown an error and it gave me the response that I realized it was ignoring everything inside the PriceLevelQueryRq tags. I'll paste a couple of my attempts below. The first one is the one that should have thrown the error but did not.
<?xml version="1.0" encoding="utf-8"?>
<?qbxml version="7.0"?>
<QBXML>
<QBXMLMsgsRq onError="stopOnError">
<PriceLevelQueryRq requestID="7468" >
<ItemRef> <!-- optional -->
<ListID>800012AA-1384983897</ListID>
</ItemRef>
</PriceLevelQueryRq>
</QBXMLMsgsRq>
</QBXML>
<?xml version="1.0" encoding="utf-8"?>
<?qbxml version="7.0"?>
<QBXML>
<QBXMLMsgsRq onError="stopOnError">
<PriceLevelQueryRq requestID="7466" >
<FromModifiedDate >2014-07-20</FromModifiedDate>
<ToModifiedDate >2014-07-24</ToModifiedDate>
</PriceLevelQueryRq>
</QBXMLMsgsRq>
</QBXML>
<?xml version="1.0" encoding="utf-8"?>
<?qbxml version="7.0"?>
<QBXML>
<QBXMLMsgsRq onError="stopOnError">
<PriceLevelQueryRq requestID="7464" >
<NameFilter>
<MatchCriterion >Contains</MatchCriterion>
<Name >Allspice</Name>
</NameFilter>
</PriceLevelQueryRq>
</QBXMLMsgsRq>
</QBXML>
Again, all three of these return all possible results with no filtering. Can anyone see why?
I would like to get the ItemReceipt items that have LinkedTxn with the PurchaseOrder type.
Now I use the following query:
<?xml version="1.0" encoding="utf-8"?><?qbxml version="12.0"?>
<?qbxml version="12.0"?>
<QBXML>
<QBXMLMsgsRq onError="continueOnError">
<ItemReceiptQueryRq requestID="1">
<IncludeLineItems>true</IncludeLineItems>
<IncludeLinkedTxns>true</IncludeLinkedTxns>
<OwnerID>0</OwnerID>
</ItemReceiptQueryRq>
</QBXMLMsgsRq>
</QBXML>
The query returned all ItemReceipt items, and I filtred them on the client.
Could you tell me if there is a way to create a filter that returns only items that have LinkedTxn with the PurchaseOrder type?
The QuickBooks SDK does not support a way to create a filter that returns only items that have a LinkedTxn with a certain type.
You'll have to pull all of the transactions, and then filter them within your app.