bksi
bksi

Reputation: 1625

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>[email protected]</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?

Upvotes: 3

Views: 4345

Answers (5)

Machavity
Machavity

Reputation: 31654

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

Upvotes: 6

Annapoorani S
Annapoorani S

Reputation: 1

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

Upvotes: 0

Josh
Josh

Reputation: 8596

Looks like you can search by email address now: "Select * From Customer Where PrimaryEmailAddr = '[email protected]'"

This is based on API v3

Upvotes: 0

bksi
bksi

Reputation: 1625

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

Upvotes: 2

William Lorfing
William Lorfing

Reputation: 2656

Fullname yes, email address no.

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

Upvotes: 3

Related Questions