Accessing customer contact details with QBSDK

332 views Asked by At

According to the QBSDK v12 and v13 OSR documentation, the SDK returns contact details (phone, email, etc.) for each of the contacts associated with a customer. In other words, tags within the contact. But when I query a customer that has multiple contacts associated with it, all I get is:

<Contact>Thing One</Contact>  (for the contact flagged as primary)
<AltContact>Thing Two</AltContact>   (for the contact flagged as secondary)
<AdditionalContactRef>
  <ContactName>Main Phone</ContactName>   (the main phone # for CUSTOMER, not contact)
  <ContactValue>425-555-1212</ContactValue>
</AdditionalContactRef>
etc...

The phone # and email set up for each contact is not included in the response XML. This is with QB Premier 2014 and QBSDK v13. Am I missing something, or does QB not yet return the contact details, which are supposedly supported by the SDK?

1

There are 1 answers

2
Jeremy On

If I understand the question correctly, you are looking for the ContactsRet element.

You should be able to request ContactsRet element using the IncludeRetElement element.

From the OSR:

<CustomerRet>
  <ContactsRet>                                 <!-- optional, may repeat -->
    <ListID>       IDTYPE       </ListID>       <!-- required -->
    <TimeCreated>  DATETIMETYPE </TimeCreated>  <!-- required -->
    <TimeModified> DATETIMETYPE </TimeModified> <!-- required -->
    <EditSequence> STRTYPE      </EditSequence> <!-- required -->
    <Contact>      STRTYPE      </Contact>      <!-- optional -->
    <Salutation>   STRTYPE      </Salutation>   <!-- optional -->
    <FirstName>    STRTYPE      </FirstName>    <!-- required -->
    <MiddleName>   STRTYPE      </MiddleName>   <!-- optional -->
    <LastName>     STRTYPE      </LastName>     <!-- optional -->
    <JobTitle>     STRTYPE      </JobTitle>     <!-- optional -->
    <AdditionalContactRef>                      <!-- must occur 0 - 5 times -->
      <ContactName>STRTYPE</ContactName>        <!-- required -->
      <ContactValue>STRTYPE</ContactValue>      <!-- required -->
    </AdditionalContactRef>
  </ContactsRet>
</CustomerRet>