Global API
...
Requests
Customer
Read
5min
to read customers, please use the below parameters field name data type description customparameters map\<string, paramvalue> it is used to add filters to your search results pageindex integer request any page from the search results reponse searchid string request any page with the search id from the search results reponse custompagesize string no of records to return per search request custom parameters in the requestjson are in the form of param name and value map which are used for filtering different search results there is currently only one supported custom parameter supported custom parameters field name data type description where keyvaluemap pass the supported where filters in key value pair param value can be passed in the following two ways paramvalue field name data type description value string single param value keyvaluemap map\<string, string> adding multiple key value params (where filters) supported “where” filters field name data type description category string pass in the netsuite category internal id you want to filter on datecreated long this will filter on an exact match (equal) use the “additionalfilter” option for a range of dates internalid string internal id of the customer multiple values can be passed in a comma separated string isinactive boolean pass false to grab active customers lastmodifieddate long this will filter on an exact match (equal) use the “additionalfilter” option for a range of dates stage string stage can be ‘ customer’, ‘ prospect’ or ‘ lead’ multiple values can be passed in a comma separated string ex customer, prospect subsidiary string internal id of subsidiary (primary) do not use this in additonalfilter multiple ids can be passed in a comma separated string ex 1,2 additonalfilter string construct the additional filter with a combination of above fields using ‘+and+’ separator and pass it as a single string make sure to wrap the whole string using encodingutil urlencode example request map\<string, object> filters = new map\<string, object>(); filters put('subsidiary', '1,2'); filters put('additionalfilter', encodingutil urlencode('lastmodifieddate>1628091060+and+lastmodifieddate<1629127860', 'utf 8')); // encode additionalfilter after constructing it with +and+ for multi filters // field filters and additionalfilter for where param map\<string, object> filtermap = new map\<string, object>(); filtermap put('where', new map\<string, object>{'keyvaluemap'=>filters}); map\<string, object> requestjsonmap = new map\<string, object>(); requestjsonmap put('customparameters', filtermap); string reqjson = json serialize(requestjsonmap); map\<string, object> reqobj = new map\<string, object>(); reqobj put('version', '1 0'); reqobj put('action', 'readcustomer'); reqobj put('requestjson', reqjson); // place a request to breadwinner global api map\<string, object> resp = breadwinner ns breadwinnernetsuiteapi call(reqobj); system debug(resp); response { action=readcustomer, timestamp=1631109943108, validrequest=true, version=1 0, responsejson={ "currentpagerecords" 2, "totalrecords" 2, "totalpages" 1, "searchid" "webservices 5333445 sb1 090820219776321931335921658 242f8c69", "pageindex" 1, "errors" \[], "customparamters" { "where" { "value" null, "keyvaluemap" { "subsidiary" "1", "additionalfilter" "lastmodifieddate%3e1628091060%2band%2blastmodifieddate%3c1629127860" } } }, "status" "200", "customers" \[ { "vatregnumber" null, "url" "https //www grandhotel com", "title" null, "territory" { "type" null, "name" "default round robin", "internalid" " 5", "externalid" null }, "terms" { "type" null, "name" "1% 10 net 30", "internalid" "5", "externalid" null }, "taxitem" null, "subsidiary" { "type" null, "name" "parent company", "internalid" "1", "externalid" null }, "startdate" 1606847400, "stage" " customer", "salutation" null, "salesrep" { "type" null, "name" "james m", "internalid" "4", "externalid" null }, "salesforceid" null, "resalenumber" null, "reminderdays" null, "receivablesaccount" { "type" null, "name" "accounts receivable", "internalid" "122", "externalid" null }, "pricelevel" { "type" null, "name" "base price", "internalid" "1", "externalid" null }, "phone" 9888888888, "parent" null, "nullfieldlist" null, "middlename" null, "lastname" null, "lastmodifieddate" 1606907165, "itempricinglist" null, "isperson" false, "isinactive" false, "internalid" "32342", "firstname" null, "fax" null, "externalid" null, "entitystatus" { "type" null, "name" "customer closed won", "internalid" "13", "externalid" null }, "entityid" "cust533at grand hotels & resorts ltd", "enddate" null, "email" null, "datecreated" 1606907165, "customform" { "type" null, "name" "standard customer form", "internalid" " 2", "externalid" null }, "customfieldlist" { "customfield" \[ { "valuelookup" null, "value" "76 89", "scriptid" "custentity decimal", "internalid" "435", "fieldtype" null }, { "valuelookup" { "type" null, "name" "acquired", "internalid" "2", "externalid" null }, "value" null, "scriptid" "custentityrating", "internalid" "42", "fieldtype" null } ] }, "currencyrecord" { "type" null, "name" "inr", "internalid" "1", "externalid" null }, "currencylist" { "currencyrecord" \[ { "currencyrecord" { "type" null, "name" "inr", "internalid" "1", "externalid" null } } ] }, "creditlimit" null, "creditholdoverride" " auto", "companyname" "grand hotels & resorts ltd", "category" null, "addressbooklist" { "replaceall" null, "addressbook" \[ { "label" "2334 n michigan avenue, suite 1500", "isresidential" true, "internalid" "29188", "defaultshipping" true, "defaultbilling" true, "addressbookaddress" { "zip" "60601", "state" "il", "internalid" null, "country" " unitedstates", "city" "chicago", "attention" null, "addrphone" null, "addressee" "grand hotels & resorts ltd", "addr3" null, "addr2" null, "addr1" "2334 n michigan avenue, suite 1500" } } ] }, "accountnumber" null }, ] } }