Search code examples
quickbooksintuit-partner-platformquickbooks-online

quickbooks online API, bill with parent resale number doesn't have value


Referring to the following post: http://ippdocs.intuit.com/0025_QuickBooksAPI/0050_Data_Services/v2/0400_QuickBooks_Online/Customer/Custom_Fields_for_Customer_and_Job

I am specifically looking for accounts in my QBO that have a parent -> child relationship. Howewver, in cases where Bill With Parent is true, there is no value coming in for "Resale Number," which I would assume would be the parent's QBO Id?

Any help clarifying on how to pull this information would be helpful.

In C# I'm doing the following and looping the accounts available:

    var qboCustomer = new Intuit.Ipp.Data.Qbo.Customer();
    var qboCustomers = commonService.FindAll(qboCustomer, page, custKnt).ToList();
    custKnt = qboCustomers.Count;
    foreach (var c in qboCustomers)
    {
        Intuit.Ipp.Data.Qbo.BooleanTypeCustomField parentBilling = (Intuit.Ipp.Data.Qbo.BooleanTypeCustomField)c.CustomField.Where(a => a.DefinitionId == "Bill With Parent").FirstOrDefault();
        if (parentBilling != null)
        {
            if (parentBilling.Value == true)
            {
                Intuit.Ipp.Data.Qbo.StringTypeCustomField resaleNum = (Intuit.Ipp.Data.Qbo.StringTypeCustomField)c.CustomField.Where(a => a.DefinitionId == "Resale Number").FirstOrDefault();
                if (resaleNum != null)
                {
                    //do some stuff, however, resaleNum is ALWAYS null...
                }
            }
        }

Solution

  • Cases where Bill With Parent is true is like creating jobs(sub customers) for customers. The "Resale Number" should be set in the custom fields or on the UI under tax info as shown. Then only it is displayed and will not be null. It is not set to the parent's QBO Id. You code is correct. I verified it. Just set the resaleNum to retrieve it.Job info page

    Get root customer QBOID for a job/sub customer