Choose where you’d like to start

Fetch records from Quickbooks

Overview

Fetch records from Quickbooks using this task.

Note: This task is applicable only to Zoho Creator.

Syntax

<variable> = intuit.quickbooks.getRecords<quickbooks_connection>, <quickbooks_module><company_ID><criteria>, <selectColumns> );

where,

ParameterDescriptionData type

<variable> 

is the variable which will hold the response returned by Quickbooks.

KEY-VALUE

<quickbooks_connection> 

is the name of the Quickbooks connection.

TEXT

<quickbooks_module>

is the name of the module in Quickbooks from where the records will be fetched.

Following are the names of applicable modules.

Customer

Vendor

Item

Invoice
AccountEmployee Department
TEXT
<company_ID>

refers to the unique ID generated by Quickbooks for each account.

You can find this under Your Company -> Account and Settings -> Billing & Subscription -> Company Id in your Quickbooks account.

TEXT

<criteria>

(optional)

Criteria based on which the records will be fetched.

The criteria must be in the format "<field name> = '<value>'". For example, "DisplayName = 'Henry'"

TEXT

<selectcolumns>

(optional)

Field names whose values will be included in the fetched records.

If this param is not specified, all field values will be included in the fetched records.

The criteria must be specified to be able to use this param.

LIST

Fetch records from Quickbooks

Let’s take an example of fetching records (containing select columns) using a criteria from the "Customer" module in Quickbooks. 

fieldList = List();
fieldList.add("FamilyName");
fieldList.add("Id");
fieldList.add("Industry");


response = intuit.quickbooks.getRecords("Quickbooks", "Customer", "1241802285", "DisplayName = 'Henry'", fieldList);

where,

ParameterDescription
"Quickbooks"is the name of the Quickbooks Connection
"Customer"is the module in Quickbooks, from where the records will be fetched
"1241802285"is the company ID of the account from which the records will be fetched
"DisplayName = 'Henry'"is the criteria based on which the records will be fetched
"fieldList"is a list variable which holds the list of field names whose values must be returned in the response
responseis response returned as map by Quickbooks

Sample Response

Following is a sample success response returned by Quickbooks:

{
“time":"2014-08-06T04:45:08.234-07:00",
"QueryResponse":"{" Customer":"[{" ShipAddr":{
"Line3":"123 street",
"Long":"-122.0960826",
"Line2":"Building 1",
"Line1":"Intuit",
"Lat":"37.4306346",
"Id":"7"
},
"PreferredDeliveryMethod":"Email",
"BalanceWithJobs":0,
"DisplayName":"Henry",
"FullyQualifiedName":"Henry",
"BillWithParent":false,
"Job":false,
"Active":true,
"MetaData":{
"CreateTime":"2014-08-01T02:29:29-07:00",
"LastUpdatedTime":"2014-08-01T02:35:45-07:00"
},
"Taxable":false,
"BillAddr":{
"Long":"-77.02225539999999",
"Line1":"450 7th StreetnWashington DC",
"Lat":"38.8958239",
"Id":"6"
},
"domain":"QBO",
"SyncToken":"1",
"PrintOnCheckName":"Hudson",
"CurrencyRef":{
"name":"Indian Rupee",
"value":"INR"
},
"Id":"5",
"FamilyName":"Hudson",
"Balance":0,
"sparse":false
}
]","maxResults":1,
"startPosition":1
}
}

To fetch the record IDs (and SyncTokens) from the response, use the following snippet:

var = <response_variable>.get("QueryResponse").get("<module_name>");
// example for <module_name> is Customer
for each var1 in var
{
info var1.get("Id");
// use "SyncToken" instead of "Id" to fetch the SyncToken values
}

The following is a sample failure response, due to incorrect parameter name:

{
"Error":"[{
"Detail":"Property Name:Can not instanti specified is unsupported or invalid",
"Message":"Request has invalid or unsupported property",
"code":"2010"
}]"
}

Related Links

Get Started Now

Execute