Link

Read Customer Subsidiary Relationship

Read Customer Subsidiary Relationship requestJSON has the following parameters.

Field NameData TypeDescription
customParametersMap<String,ParamValue>It is used to add filters to your search results
pageIndexIntegerrequest any page from the search results reponse
searchIdStringrequest any page with the Search Id from the search results reponse
customPageSizeStringno. 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

Param NameParam ValueDescription
wherekeyValueMapPass the supported where filters in Key-Value pair

Param Value can be passed in the following two ways.

ParamValue

Field NameData TypeDescription
valueStringsingle param value
keyValueMapMap<String,String>adding multiple key value params (where filters)

Supported “where” Filters

Field NameData TypeDescription
entityStringInternal ID of the Customer. Multiple values can be passed in a comma separated string.
subsidiaryStringInternal ID of Subsidiary. Multiple IDs can be passed in a comma separated string Ex: 1,2

Sample Requests and Responses

The following is an example request which can be used while using ‘readCustomerSubsidiaryRelationship’ action.

Request

Map<String, Object> filterMap = new Map<String, Object>();
Map<String, Object> filters = new Map<String, Object>();
filters.put('entity','6');

filterMap.put('where',new Map<String,Object>{'keyValueMap'=>filters}); // field 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', 'readCustomerSubsidiaryRelationship');
reqObj.put('requestJSON', reqJSON);

//  Placing a request to Breadwinner Global API
Map<String, Object> resp = breadwinner_ns.BreadwinnerNetSuiteAPI.call(reqObj);

Response

{
  action=readCustomerSubsidiaryRelationship,
  timestamp=1631545006430,
  validRequest=true,
  version=1.0,
  responseJSON={
    "status": "200",
    "currentPageRecords": 3,
    "totalRecords": 3,
    "totalPages": 1,
    "searchId": "WEBSERVICES_5333445_SB1_091320215425706211450337308_eeb1aa13",
    "pageIndex": 1,
    "errors": [],
    "customParamters": {
      "where": {
        "value": null,
        "keyValueMap": {
          "entity": "6"
        }
      }
    },
    "customerSubsidiaryRelationships": [
      {
        "subsidiary": {
          "type": null,
          "name": "Parent Company",
          "internalId": "1",
          "externalId": null
        },
        "primaryCurrency": {
          "type": null,
          "name": "INR",
          "internalId": "1",
          "externalId": null
        },
        "isPrimarySub": true,
        "internalId": "9",
        "entity": {
          "type": null,
          "name": "1 Gallery Collection",
          "internalId": "6",
          "externalId": null
        }
      },
      {
        "subsidiary": {
          "type": null,
          "name": "Atlanta",
          "internalId": "20",
          "externalId": null
        },
        "primaryCurrency": {
          "type": null,
          "name": "INR",
          "internalId": "1",
          "externalId": null
        },
        "isPrimarySub": false,
        "internalId": "1866",
        "entity": {
          "type": null,
          "name": "1 Gallery Collection",
          "internalId": "6",
          "externalId": null
        }
      },
      {
        "subsidiary": {
          "type": null,
          "name": "Sydney",
          "internalId": "13",
          "externalId": null
        },
        "primaryCurrency": {
          "type": null,
          "name": "INR",
          "internalId": "1",
          "externalId": null
        },
        "isPrimarySub": false,
        "internalId": "1867",
        "entity": {
          "type": null,
          "name": "1 Gallery Collection",
          "internalId": "6",
          "externalId": null
        }
      }
    ]
  }
}