3

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?

bksi
  • 1,606
  • 1
  • 23
  • 45

5 Answers5

6

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

Jeanne Dark
  • 1,151
  • 5
  • 20
  • 30
Machavity
  • 30,841
  • 27
  • 92
  • 100
3

Fullname yes, email address no.

You will need to pull the full or filtered list and parse through it looking for the email address.

William Lorfing
  • 2,656
  • 10
  • 7
2

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).

bksi
  • 1,606
  • 1
  • 23
  • 45
0

Looks like you can search by email address now: "Select * From Customer Where PrimaryEmailAddr = 'email@example.com'"

This is based on API v3

Josh
  • 8,329
  • 4
  • 36
  • 33
  • 3
    Note tag qbxml. I use only desktop edition with quickbooks web connector and php web server. – bksi Jun 08 '14 at 16:51
0

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 ..

  • Yes, i could try directly with the full name, but this will affect the performance. – bksi Mar 07 '16 at 10:52
  • The FullName is the name prefixed by the names of each ancestor, for example Jones:Kitchen:Cabinets. FullName values are not case-sensitive.so,If i want to sync with the old records in quickbooks desktop,how i know about the fullname of old records . i know only the customer name so is this query is correct? – Annapoorani S Mar 08 '16 at 05:21
  • The idea of this is not to sync with the old records, but to check, if the record exists before taking actions (edit/add). Taking this action the server doesn't know what is in QB. – bksi Mar 08 '16 at 11:12
  • Yes, In my web application i have some customers i dont know whether this customer is exist in quickbooks desktop or not , so before i add the customer to desktop i put this select query and find it. – Annapoorani S Mar 09 '16 at 05:45