Unable to update QuickBooks Offline Payment - quickbooks

I am sending this request to the QBSDK for updating a payment but getting an exception
"QuickBooks found an error when parsing the provided XML text stream."
.
<?xml version="1.0" ?>
<?qbxml version="6.0"?>
<QBXML>
<QBXMLMsgsRq onError="stopOnError">
<ReceivePaymentModRq requestID="1">
<ReceivePaymentMod>
<TxnID>130-1503933149</TxnID>
<EditSequence>1503933149</EditSequence>
<CustomerRef>
<ListID>80000012-1503933114</ListID>
</CustomerRef>
<TxnDate>2017-08-28</TxnDate>
<PaymentMethodRef>
<FullName>Cash</FullName>
</PaymentMethodRef>
<AppliedToTxnMod>
<TxnID>12D-1503933135</TxnID>
<PaymentAmount>200.00</PaymentAmount>
</AppliedToTxnMod>
<TotalAmount>200.00</TotalAmount>
</ReceivePaymentMod>
</ReceivePaymentModRq>
</QBXMLMsgsRq>
</QBXML>
Can anyone suggest what is wrong with this xml request ?

The position of the TotalAmount tag in my xml request was the issue .
I solved it by putting it just below the PaymentMethodRef tag like this :
<?xml version="1.0" ?>
<?qbxml version="6.0"?>
<QBXML>
<QBXMLMsgsRq onError="stopOnError">
<ReceivePaymentModRq requestID="1">
<ReceivePaymentMod>
<TxnID>130-1503933149</TxnID>
<EditSequence>1503933149</EditSequence>
<CustomerRef>
<ListID>80000012-1503933114</ListID>
</CustomerRef>
<TxnDate>2017-08-28</TxnDate>
<PaymentMethodRef>
<FullName>Cash</FullName>
</PaymentMethodRef>
<TotalAmount>200.00</TotalAmount>
<AppliedToTxnMod>
<TxnID>12D-1503933135</TxnID>
<PaymentAmount>200.00</PaymentAmount>
</AppliedToTxnMod>
</ReceivePaymentMod>
</ReceivePaymentModRq>
</QBXMLMsgsRq>
</QBXML>

Related

How do you supply multiple TxnIDs to a QBXML request?

From my understand there's only 1 request where you can pass a TxnIDList and that's TimeTrackingQuery. The XML i'm trying to pass is:
<?xml version="1.0" encoding="utf-8"?>
<?qbxml version="13.0"?>
<QBXML>
<QBXMLMsgsRq onError="stopOnError">
<TimeTrackingQueryRq requestID="1" iterator="Start">
<TxnID >9-1673543531</TxnId>
<TxnID >A-1673543531</TxnID>
<TxnID >7-1673543531</TxnID>
<TxnID >8-1673543531</TxnID>
<TxnID >B-1673543531</TxnID>
</TimeTrackingQueryRq>
</QBXMLMsgsRq>
</QBXML>
But this gives me an error of: There is a missing element: "MaxReturned".
Using the SDK validator, this query is marked as valid, however and looking at the documentation it says I can either supply a repeating element of TxnID or a MaxReturned value with nested elements.
If i also pass it a MaxReturned element along with the TxnIDs it will complain that the xml.
<?xml version="1.0" encoding="utf-8"?>
<?qbxml version="13.0"?>
<QBXML>
<QBXMLMsgsRq onError="stopOnError">
<TimeTrackingQueryRq requestID="1" iterator="Start">
<TxnID >9-1673543531</TxnID>
<TxnID >A-1673543531</TxnID>
<TxnID >7-1673543531</TxnID>
<TxnID >8-1673543531</TxnID>
<TxnID >B-1673543531</TxnID>
<MaxReturned>1000</MaxReturned>
</TimeTrackingQueryRq>
</QBXMLMsgsRq>
</QBXML>
Lastly, if I close off the TimeTrackingQueryRq tag and re-open it and just include MaxReturned in the second tag, it will say it's valid XML but will return the same errors as the first request. Example of this:
<?xml version="1.0" encoding="utf-8"?>
<?qbxml version="13.0"?>
<QBXML>
<QBXMLMsgsRq onError="stopOnError">
<TimeTrackingQueryRq requestID="1" iterator="Start">
<TxnID >9-1673543531</TxnID>
<TxnID >A-1673543531</TxnID>
<TxnID >7-1673543531</TxnID>
<TxnID >8-1673543531</TxnID>
<TxnID >B-1673543531</TxnID>
</TimeTrackingQueryRq>
<TimeTrackingQueryRq requestID="1">
<MaxReturned>1000</MaxReturned>
</TimeTrackingQueryRq>
</QBXMLMsgsRq>
</QBXML>
So either I don't know how to pass a TxnIDList or I don't know how to properly read the documentation and provided schema. Any help or examples of how to properly construct this request is appreciated.

How to get InvoiceLine from InvoiceQuery in QBXML

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>

Quickbooks QBXML - how to exclude fields

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

QBXML PriceLevelQuery Request to WebConnector

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?

Quickbooks Sales Receipt add error

There was an error when saving a SalesReceipt. QuickBooks error
message: Transaction amount must be positive.
When I submit this xml to my quickbooks webconnector it throws me the above error. What is the transaction amount and where in the xml does it go?
<?xml version="1.0" encoding="utf-16"?>
<?qbxml version="12.0"?>
<QBXML>
<QBXMLMsgsRq onError="stopOnError">
<SalesReceiptAddRq requestID="1">
<SalesReceiptAdd>
<CustomerRef>
<FullName>Daily Sales Summary</FullName>
</CustomerRef>
<TemplateRef>
<FullName>Custom Sales Receipt</FullName>
</TemplateRef>
<SalesReceiptLineAdd>
<ItemRef>
<FullName>Food</FullName>
</ItemRef>
<Desc>Total Food Sales</Desc>
<Amount>50.00</Amount>
</SalesReceiptLineAdd>
</SalesReceiptAdd>
</SalesReceiptAddRq>
</QBXMLMsgsRq>
</QBXML>
Need item for SalesReceiptLineAdd
Something like that:
<SalesReceiptAddRq requestID="2"><SalesReceiptAdd><CustomerRef><FullName>Dang Dinh*</FullName></CustomerRef><TxnDate>2013-11-15</TxnDate><CheckNumber/><PaymentMethodRef><FullName>Check</FullName></PaymentMethodRef><Memo>Test</Memo><IsToBePrinted>False</IsToBePrinted<SalesReceiptLineAdd><ItemRef><FullName>Sales</FullName></ItemRef><Desc>Test</Desc><Quantity>1</Quantity><Rate>1</Rate></SalesReceiptLineAdd></SalesReceiptAdd></SalesReceiptAddRq>

Resources