qbfc/qbxml ReceivePaymentAdd assign Payment to Invoice - sdk

When I try to associate a Payment with an Invoice, I get the following error:
ReceivePaymentAdd
ORApplyPayment:
OR object has multiple values
End of ORApplyPayment
End of ReceivePaymentAdd
What does that error mean? How do I get this to work?
Note that I am pushing the Invoice into QuickBooks in a separate session, so I cannot use Macros. If I use IsAutoApply true without the AppliedToTxnAdd block, the payment pushes just fine.
Here is the generated xml:
<?xml version="1.0" encoding="utf-8"?>
<?qbxml version="10.0"?>
<QBXML>
<QBXMLMsgsRq onError = "continueOnError">
<ReceivePaymentAddRq requestID = "0">
<ReceivePaymentAdd>
<CustomerRef>
<ListID>8000003F-1415364262</ListID>
</CustomerRef>
<ARAccountRef>
<FullName>Accounts Receivable</FullName>
</ARAccountRef>
<TxnDate>2014-02-14</TxnDate>
<RefNumber>1003 - P1</RefNumber>
<TotalAmount>850.00</TotalAmount>
<PaymentMethodRef>
<FullName>20 - Check</FullName>
</PaymentMethodRef>
<Memo/>
<IsAutoApply>0</IsAutoApply>
<AppliedToTxnAdd>
<TxnID>C7-1415364350</TxnID>
<PaymentAmount>850.00</PaymentAmount>
</AppliedToTxnAdd>
</ReceivePaymentAdd>
</ReceivePaymentAddRq>
</QBXMLMsgsRq>
</QBXML>

This:
ORApplyPayment:
OR object has multiple values
End of ORApplyPayment
Means that the specification (see the QuickBooks OSR) specifies that you can use EITHER AppliedToTxnAdd OR you can use IsAutoApply, but you may not use both of them. You can use one, OR the other.
You're using both, so you're getting an error message. Either remove <IsAutoApply> or remove your <AppliedToTxnAdd> tag.
Here's an example for you:
http://consolibyte.com/wiki/doku.php/quickbooks_qbxml_receivepaymentadd
http://consolibyte.com/wiki/doku.php/quickbooks

Related

QBXML SalesOrderAdd issue

I am trying to create SalesOrder through QBWebConnector (backend - Rails + qbwc), following Onscreen Reference for Intuit Software Development Kits, and it says that SalesOrderAdd requires only CustomerRef attribute, but QBXML validator says:
Line: 10
LinePos: 9
Src Text: </SalesOrderAdd>
Reason: Element content is incomplete according to the DTD/Schema.
Expecting: ClassRef, TemplateRef, TxnDate, RefNumber, BillAddress, ShipAddress, PONumber, TermsRef, DueDate, SalesRepRef, FOB, ShipDate.
QBXML Request is:
<?xml version="1.0" encoding="ISO-8859-1"?>
<?qbxml version="7.0"?>
<QBXML>
<QBXMLMsgsRq onError="stopOnError">
<SalesOrderAddRq>
<SalesOrderAdd>
<CustomerRef>
<FullName>Test customer</FullName>
</CustomerRef>
</SalesOrderAdd>
</SalesOrderAddRq>
</QBXMLMsgsRq>
</QBXML>
Why is that? Can I change this behavior somehow (omit all tags except pointed as required in Onscreen Reference)?
The OSR is... less than perfect. But it does indicate there are additional required fields.
You need to add at least one line item or group line.

quickbooks api to add a payment against an invoice with RubyRails app

I am trying to mark an invoice mark as paid and as per my understanding I have to add a payment against the invoice. I am using qbwc gem and it is using qbxml v.13.
I have found out few examples of creating the payment object here https://community-intuit.force.com/developer/s/article/QBO-REST-Apply-payments-to-invoice but the qbxml tag for creating payment is not clear to me.
Here are few xml tags that I have found in OSR ReceivePaymentAddRq, ItemPaymentAddRq etc
But I am still not sure how to create the payment object and which xml tags should be used and help is appreciated, thanks in advance.
A minimal qbXML example looks like this:
<?xml version="1.0" encoding="utf-8"?>
<?qbxml version="10.0"?>
<QBXML>
<QBXMLMsgsRq onError="stopOnError">
<ReceivePaymentAddRq>
<ReceivePaymentAdd>
<CustomerRef>
<ListID>F230000-1196864585</ListID>
<!--<FullName>Keith Palmer</FullName>--> <!-- You can specify either ListID or FullName -->
</CustomerRef>
<TxnDate>2007-12-14</TxnDate>
<RefNumber>00612361</RefNumber>
<TotalAmount>195.00</TotalAmount>
<!-- Specify the Invoice TxnID here, or see below for auto-apply... -->
<AppliedToTxnAdd>
<TxnID>12006-1196864828</TxnID>
<PaymentAmount>195.00</PaymentAmount>
</AppliedToTxnAdd>
<!-- If you don't want to apply payments manually to a particular transaction, use <IsAutoApply>true</IsAutoApply> -->
<!-- instead of the <AppliedToTxn> node. QuickBooks will make it's best guess how to apply the payment. -->
</ReceivePaymentAdd>
</ReceivePaymentAddRq>
</QBXMLMsgsRq>
</QBXML>

how to add payment method to quickbooks through qbxml?

I'm using consolibyte php with web connector.I'm trying to create payment method add request using following xml.But i'm getting following error.but in quickbooks with that name no term existed.can you help any one?
3100: The name "cashondelivery" of the list element is already in use.
$xml='<?xml version="1.0" encoding="utf-8"?>
<?qbxml version="8.0"?>
<QBXML>
<QBXMLMsgsRq onError="stopOnError">
<PaymentMethodAddRq>
<PaymentMethodAdd>
<Name>cashondelivery</Name>
<IsActive>true</IsActive>
<PaymentMethodType>AmericanExpress</PaymentMethodType>
</PaymentMethodAdd>
</PaymentMethodAddRq>
</QBXMLMsgsRq>
</QBXML>';
return $xml;
That means that cashondelivery is already in QB.
Look for deleted entries as well. You might need to check the other lists and see if it is there.

Iteration samples in Quick books using web connector

I have seen documention on iterration on QBSDK_ProGuid.pdf file(page 117).i am confusion how to issue the same query again and setting iterator value now set to Continue, and the IteratorID field set to the IteratorID value returned from the first query iteration.
<?xml version="1.0" ?>
<?qbxml version="5.0" ?>
<QBXML>
<QBXMLMsgsRq onError="stopOnError">
<CustomerQueryRq requestID="5001" iterator="Continue"
iteratorID="{D7355385-A17B-4f5d-B34D-F34C79C3E6FC}">
<MaxReturned>10</MaxReturned>
<IncludeRetElement>ListID</IncludeRetElement>
</
CustomerQueryRq>
</QBXMLMsgsRq>
</QBXML>
I am following WCWebService sample which is provided by intuit... and getting customer data ..
can any one please provide a sample which is using iteration Concept.
Thanks !
Below is an example of using iterators to query for a customers, fetching five (5) customers at a time. This query fetches customers with the following criteria:
Modified after January 29th, 1984
OwnerID is 0 (this just makes sure we get back DataExt values (custom fields) defined in the GUI)
Your initial request will look as below. Notice that we declare the iterator=“Start” attribute to start our iterator:
<?xml version="1.0" encoding="utf-8"?>
<?qbxml version="5.0"?>
<QBXML>
<QBXMLMsgsRq onError="continueOnError">
<CustomerQueryRq requestID="1" iterator="Start">
<MaxReturned>5</MaxReturned>
<FromModifiedDate>1984-01-29T22:03:19</FromModifiedDate>
<OwnerID>0</OwnerID>
</CustomerQueryRq>
</QBXMLMsgsRq>
</QBXML>
QuickBooks will send you back a response containing the first five (5) customers that looks like below. Notice that QuickBooks has sent us back an iteratorID="..." attribute and an iteratorRemainingCount="..." attribute, indicating the ID used to identify the iterator, and the number of items left in the iterator.
<?xml version="1.0" ?>
<QBXML>
<QBXMLMsgsRs>
<CustomerQueryRs
requestID="1"
statusCode="0"
statusSeverity="Info"
statusMessage="Status OK"
iteratorRemainingCount="18"
iteratorID="{eb05f701-e727-472f-8ade-6753c4f67a46}">
<CustomerRet>
<ListID>110000-1232697602</ListID>
<TimeCreated>2009-01-23T03:00:02-05:00</TimeCreated>
<TimeModified>2009-01-23T03:00:02-05:00</TimeModified>
<EditSequence>1232697602</EditSequence>
<Name>10th Customer</Name>
<FullName>10th Customer</FullName>
<IsActive>true</IsActive>
<Sublevel>0</Sublevel>
<Balance>0.00</Balance>
<TotalBalance>0.00</TotalBalance>
<SalesTaxCodeRef>
<ListID>10000-1232327562</ListID>
<FullName>Tax</FullName>
</SalesTaxCodeRef>
<ItemSalesTaxRef>
<ListID>10000-1232327661</ListID>
<FullName>Out of State</FullName>
</ItemSalesTaxRef>
<JobStatus>None</JobStatus>
</CustomerRet>
... 4 more customer records will go here ...
</CustomerQueryRs>
</QBXMLMsgsRs>
</QBXML>
You'll then check the iteratorRemainingCount attribute and, if it's greater than 0, send your next request using the iteratorID attribute. Remember, every subsequent request request using this iterator must use the same search criteria and that search criteria must be sent with every request.
So, in this case, every request for the next part of the iterator will resend the <MaxReturned>, <FromModifiedDate>, and <OwnerID> elements. Notice that we send the returned iteratorID="..." attribute from the previous response, and declare the iterator="Continue" attribute indicating we want to continue fetching from an existing iterator:
<?xml version="1.0" encoding="utf-8"?>
<?qbxml version="5.0"?>
<QBXML>
<QBXMLMsgsRq onError="continueOnError">
<CustomerQueryRq
requestID="2"
iterator="Continue"
iteratorID="{eb05f701-e727-472f-8ade-6753c4f67a46}">
<MaxReturned>5</MaxReturned>
<FromModifiedDate>1984-01-29T22:03:19</FromModifiedDate>
<OwnerID>0</OwnerID>
</CustomerQueryRq>
</QBXMLMsgsRq>
</QBXML>
This process will repeat until there are no more items left in the iterator. On each response, you'll check the iteratorRemainingCount attribute, and if it's greater than 0, you'll issue another request to get the next part of the iterator.
Eventually, you'll notice that the iteratorRemainingCount attribute will dwindle to zero (0) at which point you'll stop issuing requests, because the iterator has no more records to return. If you do issue another request, you'll get back an error as the iterator has, at this point, expired.
<?xml version=“1.0” ?>
<QBXML>
<QBXMLMsgsRs>
<CustomerQueryRs
requestID="5"
statusCode="0"
statusSeverity="Info"
statusMessage="Status OK"
iteratorRemainingCount="0"
iteratorID="{eb05f701-e727-472f-8ade-6753c4f67a46}">
<CustomerRet>
<ListID>1B0000-1232697643</ListID>
<TimeCreated>2009-01-23T03:00:43-05:00</TimeCreated>
<TimeModified>2009-01-23T03:00:43-05:00</TimeModified>
<EditSequence>1232697643</EditSequence>
<Name>Pat Daniels</Name>
<FullName>Pat Daniels</FullName>
<IsActive>true</IsActive>
<Sublevel>0</Sublevel>
<Balance>0.00</Balance>
<TotalBalance>0.00</TotalBalance>
<SalesTaxCodeRef>
<ListID>10000-1232327562</ListID>
<FullName>Tax</FullName>
</SalesTaxCodeRef>
<ItemSalesTaxRef>
<ListID>10000-1232327661</ListID>
<FullName>Out of State</FullName>
</ItemSalesTaxRef>
<JobStatus>None</JobStatus>
</CustomerRet>
... 4 more customer records will go here ...
</CustomerQueryRs>
</QBXMLMsgsRs>
</QBXML>

QuickBooks. Filtering items by LinkedTxn

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.

Resources