---
title: Read
slug: netsuite/dcEB-read
description: Learn how to read cash sales data effectively using various filters such as dateCreated, internalId, lastModifiedDate, subsidiary, additionalFilter, tranDate, status, and customer. This document provides examples and a code block in Apex to demonstrate th
docTags: 
createdAt: 2021-12-14T13:05:20.000Z
---

To read Cash Sales, please use the below parameters.

### Supported “*where*” Filters

| **Field Name**   | **Data Type** | **Description**                                                                                                                                                                                |
| ---------------- | ------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| 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 Cash Sale. Multiple values can be passed in a comma-separated string.                                                                                                       |
| lastModifiedDate | Long          | This will filter on an exact match (equal). Use the “additionalFilter” option for a range of dates.                                                                                            |
| 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 the above fields using ‘+and+’ separator and pass it as a single string. Make sure to wrap the whole string using EncodingUtil.urlEncode |
| tranDate         | Long          | Transaction date of the record. Use the “additionalFilter” option for a range of dates.                                                                                                        |
| status           | String        | To filter the records based on the Status value. Ex: Status=active                                                                                                                             |
| customer         | String        | To filter the records based on the Customer. Multiple IDs can be passed in a comma-separated string Ex: 6,7                                                                                    |

### 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', 'readCashSale');
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=readCashSale,
  timestamp=1657007086564,
  validRequest=true,
  version=1.0,
  responseJSON={
    "currentPageRecords": null,
    "totalRecords": 1,
    "totalPages": 1,
    "searchId": "WEBSERVICES_5333445_SB1_07052022850298616113790521_b28e5b57f",
    "pageIndex": 1,
    "errors": [
      
    ],
    "customParamters": {
      "where": {
        "value": null,
        "keyValueMap": {
          "internalId": "73450"
        }
      }
    },
    "status": "200""cashSales": [
      {
        "undepFunds": true,
        "tranId": "9",
        "tranDate": 1615878000,
        "total": 146.32,
        "terms": null,
        "taxTotal": 22.32,
        "subTotal": 124.0,
        "subsidiary": {
          "type": null,
          "name": "Parent Company",
          "internalId": "1",
          "externalId": null
        },
        "status": "Not Deposited",
        "shippingCost": null,
        "shippingAddress": {
          "zip": "94567",
          "state": "CA",
          "internalId": "23528",
          "country": "_india",
          "city": "Pope Valley",
          "attention": null,
          "addrPhone": null,
          "addressee": "CUST465AT Rakesh Reddy",
          "addr3": null,
          "addr2": null,
          "addr1": "Palo Alto"
        },
        "salesRep": null,
        "salesforceID": null,
        "otherRefNum": null,
        "nullFieldList": null,
        "memo": "2312",
        "location": {
          "type": null,
          "name": "Hyderabad",
          "internalId": "6",
          "externalId": null
        },
        "lastModifiedDate": 1656405363,
        "itemList": {
          "replaceAll": null,
          "item": [
            {
              "unitsDisplay": null,
              "taxRate1": "18.0",
              "taxCode": {
                "type": null,
                "name": "VAT_IN:GST 18",
                "internalId": "36",
                "externalId": null
              },
              "tax1Amt": 22.32,
              "shipMethod": null,
              "shipGroup": null,
              "serialNumbers": null,
              "revRecStartDate": null,
              "revRecSchedule": null,
              "revRecEndDate": null,
              "rate": null,
              "quantityRemaining": null,
              "quantityReceived": null,
              "quantityBilled": null,
              "quantity": 1.0,
              "price": {
                "type": null,
                "name": "Custom",
                "internalId": "-1",
                "externalId": null
              },
              "poNum": null,
              "orderLine": null,
              "onHand": null,
              "location": null,
              "line": 1,
              "jobName": null,
              "itemReceive": null,
              "itemName": null,
              "itemIsFulfilled": null,
              "item": {
                "type": null,
                "name": "Laptop",
                "internalId": "591",
                "externalId": null
              },
              "grossAmt": 146.32,
              "expectedReceiptDate": null,
              "description": null,
              "department": null,
              "customFieldList": {
                "customField": [
                  {
                    "valueLookup": null,
                    "value": "true",
                    "scriptId": "custcol_checkbox",
                    "internalId": "443",
                    "fieldType": null
                  },
                  {
                    "valueLookup": null,
                    "value": "123.0",
                    "scriptId": "custcol_decimal",
                    "internalId": "449",
                    "fieldType": null
                  },
                  {
                    "valueLookup": null,
                    "value": "desc",
                    "scriptId": "custcollinedes",
                    "internalId": "242",
                    "fieldType": null
                  }
                ]
              },
              "createPo": null,
              "costEstimateType": null,
              "costEstimate": null,
              "classification": null,
              "amount": 124.0
            }
          ]
        },
        "internalId": "73450",
        "handlingCost": null,
        "externalId": null,
        "exchangeRate": 23.0,
        "entity": {
          "type": null,
          "name": "CUST465AT GS Solutions : Rakesh Reddy",
          "internalId": "20198",
          "externalId": null
        },
        "dueDate": null,
        "discountTotal": null,
        "discountRate": null,
        "discountItem": null,
        "department": null,
        "customForm": null,
        "customFieldList": {
          "customField": [
            {
              "valueLookup": null,
              "value": " - ",
              "scriptId": "custbody_breadwinner_pc_internal_id",
              "internalId": "588",
              "fieldType": null
            },
            {
              "valueLookup": null,
              "value": "false",
              "scriptId": "custbody_checkbox",
              "internalId": "272",
              "fieldType": null
            },
            {
              "valueLookup": null,
              "value": "76.89",
              "scriptId": "custbody_decimal",
              "internalId": "448",
              "fieldType": null
            },
            {
              "valueLookup": null,
              "value": "false",
              "scriptId": "custbody_edoc_gen_trans_pdf",
              "internalId": "925",
              "fieldType": null
            },
            {
              "valueLookup": null,
              "value": "false",
              "scriptId": "custbody_ei_ds_txn_identifier",
              "internalId": "932",
              "fieldType": null
            },
            {
              "valueLookup": null,
              "value": "prw",
              "scriptId": "custbody_freeformtext",
              "internalId": "451",
              "fieldType": null
            }
          ]
        },
        "currencyRecord": {
          "type": null,
          "name": "US Dollars",
          "internalId": "2",
          "externalId": null
        },
        "currencyName": "US Dollars",
        "createdFrom": null,
        "createdDate": 1615876585,
        "classification": null,
        "billingAddress": {
          "zip": "94567",
          "state": "CA",
          "internalId": "23528",
          "country": "_india",
          "city": "Pope Valley",
          "attention": null,
          "addrPhone": null,
          "addressee": "CUST465AT Rakesh Reddy",
          "addr3": null,
          "addr2": null,
          "addr1": "Palo Alto"
        },
        "account": null
      }
    ],
  },  
}
```
:::

