---
title: Read
slug: netsuite/GoqG-read
description: Learn about the parameters used to read customer data including customParameters, pageIndex, searchId, and customPageSize. Explore how the customParameters parameter can be utilized to filter search results based on specific criteria. Discover how to inco
docTags: 
createdAt: 2021-10-25T16:08:29.000Z
---

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&#x20;*&#x74;o 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 additionalFilter. Multiple IDs can be passed in a comma-separated string. Ex: 1,2                                                      |
| additonalFilter                                                                                                                                                                                                           | String                                        | Construct the additional filter with a combination of the above fields using ‘+and+’ separator and pass it as a single string. Make sure to wrap the whole string using EncodingUtil.urlEncode |
| email                                                                                                                                                                                                                     | String                                        | This filters based on an exact email match                                                                                                                                                     |
| Custom Fields:<br />Syntax:<br />cf\_dataType\_scriptId<br />e.g., cf\_date\_custentity13<br />Note:<br />Supported datatypes<br />1. cf\_date<br />2. cf\_string<br />3. cf\_boolean<br />4. cf\_long<br />5. cf\_double | true (cf\_boolean), 1606803100 (cf\_date) ... | Used to include the custom fields as the filter for the request.e.g., cf\_date\_custentity13>1606803100+and+cf\_string\_custentity25=marketing+and+cf\_boolean\_custentity\_checkbox=true.     |

### Example

:::CodeblockTabs
Request

```apex
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

```json
{
  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
      },
    ]
  }
}
```
:::

