Mapping Bills, BillPayments and VendorCredits - quickbooks

I'm trying to map Bills, BillPayments and VendorCredits into one table using QBXML. Something like Bill Payment Stub (see below).
I tried to do it based on TxnDate, but some of the bills are apparently mapped based on amount or some other field.
I tried all types of queries. Separate queries BillQueryRq, BillPaymentCheckQueryRq, VendorCreditQueryRq (see below), but there is no relation between data from this queries. Combided queries, such as TransactionQueryRq (see below).
What is the relation between these 3 tables (Bills, BillPayments, VengorCredits)? Is there a foreign key/constraint that I can use to map them together? Maybe there is another query that can solve this problem? (I tried all queries from here to no avail https://developer.intuit.com/app/developer/qbdesktop/docs/api-reference/qbdesktop/accountadd)

Ok. After 5 days of search I couldn't find an answer. No linking element. But... I found the query that links bills to credits and payments. All you've got to do is to include <IncludeLinkedTxns>true</IncludeLinkedTxns> into the bill query. For some reason, this parameter is set to false by default.
The whole query looks like this.
<?xml version="1.0" encoding="utf-8"?>
<?qbxml version="13.0"?>
<QBXML>
<QBXMLMsgsRq onError="stopOnError">
<BillQueryRq requestID="xyz">
<MaxReturned >10000</MaxReturned>
<TxnDateRangeFilter>
<FromTxnDate >2022-02-01</FromTxnDate>
</TxnDateRangeFilter>
<IncludeLinkedTxns>true</IncludeLinkedTxns>
</BillQueryRq>
</QBXMLMsgsRq>
</QBXML>

Related

Do we need to delete all the existing data in Quickbooks Desktop in order to implement webconnector?

I am using PHP and trying to integrate webconnector to synchronize my item details with Quickbooks destop.
What I don't understand is that how to map an Item that is already in Quickbooks to the same Item that I am trying to update from my Website. I don't have the Reference number of any of the Items that are already present in the Quickbooks.
One solution that I can think of it to delete all the existing record and then add them again so you will get there reference number in return. But this is not feasible.
QuickBooks for Windows has a dual primary key system, where you can refer to objects by either FullName, or by ListID.
So, something like this is perfectly valid when creating an invoice, and requires no ListID values to be present:
<InvoiceLineAdd>
...
<ItemRef>
<FullName>Your Item Name Here</FullName>
</ItemRef>
...
</InvoiceLineAdd>
You can also do an ItemQuery at any time to get the ListIDs for anything you don't already have. e.g. do this to get all of your item ListID and FullName values from your existing items:
<?xml version="1.0" encoding="utf-8"?>
<?qbxml version="7.0"?>
<QBXML>
<QBXMLMsgsRq onError="stopOnError">
<ItemQueryRq requestID="SXRlbVF1ZXJ5fDEyMA==" >
</ItemQueryRq>
</QBXMLMsgsRq>
</QBXML>
Soooo...
I don't have the Reference number of any of the Items that are already present in the Quickbooks.
You don't need them... but if you really do want to use them, do a query to get them.
One solution that I can think of it to delete all the existing record and then add them again so you will get there reference number in return.
Good golly no! Query for them! Or don't even use the ListID, and use the FullName instead.

How to Query Sales Order by Order Number?

I've gotten frustrated with the .NET DevKit and am now considering switching my app over to XML. But I'm still having trouble figuring out how to perform very basic queries.
How can I retrieve a QBD Sales Order by the order number? This is the "Sales Order Number" in the QBD UI, "RefNumber" in the SDK, and "DocNumber" in IPP.
Just in case somebody needs me to explain the use case for looking up a record by the human-readable unique ID: I'm integrating with a system where we don't have the luxury of storing a QB transaction ID after importing a sales order. So if that system wants to query QB later to check the status of a sales order, it needs to do so by that system's unique order #.
I already have links to all the documentation; thanks. I just need to know how to perform this query. Similarly, I need to do it for Invoices and POs.
I need the same thing for Items, the use case being that if we're importing items from another system, we need to query the QB item list by name to see if we already have that item in QB.
For ITEMS, you can use ItemConsolidated and a NameContains filter. For example, the XML would look something like:
POST https://services.intuit.com/sb/itemconsolidated/v2/<realmID>
...
<?xml version="1.0" encoding="UTF-8"?>
<ItemConsolidatedQuery xmlns="http://www.intuit.com/sb/cdm/v2"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.intuit.com/sb/cdm/v2 RestDataFilter.xsd ">
<NameContains>Your item name goes here</NameContains>
</ItemConsolidatedQuery>
It won't be perfect, because Intuit only supports "NameContains" (the item name contains the string you specify) rather than "NameEquals", but you can then loop through what you get back and filter it client-side from there.
For SALES ORDERS, unfortunately, Intuit Data Services doesn't support querying by DocNumber at this time.
Instead, a work-around for your situation might be to query for all sales orders, and then cache the Id and DocNumber value of each in your application. When you need to look something up, look up the Id in the cache, and then query by Id value. It's not pretty... but it's really the only way you can do what you're describing.

Can i query a quickbooks customer by name and email

I write a code to integrate a shopping cart with quickbooks, using quickbooks web connector. The problem is when i try to find out if there is a customer in quickbooks filtered by name and email. I tried with this:
<?xml version="1.0" encoding="utf-8"?>
<?qbxml version="9.0"?>
<QBXML>
<QBXMLMsgsRq onError="continueOnError">
<CustomerQueryRq>
<FullName>Mladen Petrov</FullName>
<Email>bksi#abf.cd</Email>
</CustomerQueryRq>
</QBXMLMsgsRq>
</QBXML>
But it returned me an error. Is there a way to find quickbooks customer by Name and email, or i have to get all the QB customers and somehow store them to my db with their QB ids?
Quickbooks isn't terribly robust on finding customers. The only filter that exists, really, is name. There are some where you can find users by various things on their invoices but little on their actual data you would expect (address, email, etc). So what you do is search on name and loop through the full result list to find the record you want. Not efficient but it works. There is a way to paginate the results so you don't kill your machine chewing through dozens of results.
There's an older writeup of how to paginate your results here
http://www.consolibyte.com/wiki/doku.php/quickbooks_qbxml_customerquery_with_iterators
Be sure to consult the OSR on what fields are supported. Email is not a defined field for that type of request.
https://static.developer.intuit.com/qbSDK-current/common/newosr/index.html
Fullname yes, email address no.
You will need to pull the full or filtered list and parse through it looking for the email address.
Thanks guys. I found another usable solution:
In the field FullName i put FullName (Email). That way i have unique user by full name and email. Other fields (First, Last Name and Contact are filled properly).
But just be sure that fullName + email are below 41 chars (this is the field limit).
Looks like you can search by email address now: "Select * From Customer Where PrimaryEmailAddr = 'email#example.com'"
This is based on API v3
Is it easy to use Name filter or NameRange Filter to query the customer with their unique customer name
"<NameFilter> <!-- optional -->
<!-- MatchCriterion may have one of the following values: StartsWith, Contains, EndsWith -->
<MatchCriterion >ENUMTYPE</MatchCriterion> <!-- required -->
<Name >STRTYPE</Name> <!-- required -->
</NameFilter>
<!-- OR -->
<NameRangeFilter> <!-- optional -->
<FromName >STRTYPE</FromName> <!-- optional -->
<ToName >STRTYPE</ToName> <!-- optional -->
</NameRangeFilter>"
Example:
"
StartsWith
MladenPetrov
Mladen Petrov
"
In the reponse check with the email id is it correct or not
..

Populating a Control in a Team Foundation Server 2010 Work Item Form

I've been tasked with creating a small application to query a customer database, and map its bug entries into TFS. All is well with nearly everything so far. My customer db queries work, and I can easily create a new WorkItem and place it into TFS. But I'm stuck trying to populate an HtmlFieldControl with the contents of a WorkItem Template we use for bugs. I've found the XML for this template stored on our NAS, which I assume was created through TFS PowerTools. The file has a .wt extension. Once I'm done with this, the contents of the Value element should appear in the HtmlFieldControl.
<Template xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<FieldValues>
<FieldValue>
<ReferenceName>Microsoft.VSTS.TCM.ReproSteps</ReferenceName>
<Value>...</Value>
</FieldValue>
</FieldValues>
<WorkItemType>Bug</WorkItemType>
<TeamServerUri>...</TeamServerUri>
<TeamProjectName>...</TeamProjectName>
<Description />
</Template>
I can't find any documentation on this particular element anywhere, so I have no clue how it could fit into the existing bug WorkItemType.
The template is stored as such on TFS:
It should appear in the Work Item Form itself like this:
If there is no way to accomplish this, how could I take a peak at the XML of this populated form to see what I'm supposed to do?
When creating a new WorkItem and populating fields, I found that there was a custom field in place called "Repro Steps," so I fed in the template as such:
workItem.Fields["Repro Steps"].Value = templateText;
Works like a charm.

ReceivePaymentAddRq in QBXML - Object TxnID specified in request cannot be found

I'm working in QBXML and trying to apply a payment to specific invoice in a ReceivePaymentAddRq. I'm getting the, apparently quite common, "Object TxnID specified in the request cannot be found". Most other forums threads on this topic are resolved once the ARAccountRef field is added to the request, that didn't seem to make a difference for me.
I've queried the invoice for TxnID 68B4-1290718970 and verified the following:
My request's ARAccountRef ListID matches what is in the QueryRet
My request's CustomerRef ListID matches what is in the QueryRet
My XML request is below. What am I missing?
Thanks
<QBXML>
<QBXMLMsgsRq onError = "continueOnError">
<ReceivePaymentAddRq requestID = "0">
<ReceivePaymentAdd>
<CustomerRef>
<ListID>80000111-1286514304</ListID>
</CustomerRef>
<ARAccountRef>
<ListID>80000091-1273734429</ListID>
</ARAccountRef>
<TxnDate>2010-11-10</TxnDate>
<RefNumber>2999 </RefNumber>
<TotalAmount>15.95</TotalAmount>
<PaymentMethodRef>
<ListID>80000002-1273560098</ListID>
</PaymentMethodRef>
<Memo>_32T0DE94J</Memo>
<DepositToAccountRef>
<ListID>80000090-1273734138</ListID>
</DepositToAccountRef>
<AppliedToTxnAdd>
<TxnID>68B4-1290718970</TxnID>
<PaymentAmount>15.95</PaymentAmount>
</AppliedToTxnAdd>
</ReceivePaymentAdd>
</ReceivePaymentAddRq>
</QBXMLMsgsRq>
</QBXML>
For anyone else's reference, the question was already answered over here:
https://idnforums.intuit.com/messageview.aspx?catid=7&threadid=14923&enterthread=y
Updated answer now that Intuit have taken down their own forums:
There are a couple of common reasons for the error you're seeing:
The object you're referring to (68B4-1290718970) might not exist. Are you 100% positive this transaction exists?
The object you're referring to might not be something you can apply a payment to. You apply payments to Invoices. Is the object you're referring to an invoice?
The object you're referring to might not have the same currency that the payment has. Are you using multi-currency with QuickBooks, and do the currencies match?
The object you're referring to may not have a matching A/R account with the payment. This is especially common if you have multiple A/R accounts in QuickBooks, and you're not explicitly specifying which A/R account to use when creating the invoice or payment. Do the A/R accounts for the invoice and the payment match?
The object that you're referring to might not have an open balance (e.g. it might already be paid). Does the object that you're referring to have a balance of at least 15.95? (the amount you tried to apply)

Resources