1Map<String, Object> nsCustomerSub1 = new Map<String, Object>();
2 nsCustomerSub1.put('entity', new Map<String, Object>{'internalId'=>'362'});
3 nsCustomerSub1.put('subsidiary', new Map<String, Object>{'internalId'=>'9'});
4
5Map<String, Object> nsCustomerSub2 = new Map<String, Object>();
6 nsCustomerSub2.put('entity', new Map<String, Object>{'internalId'=>'392'});
7 nsCustomerSub2.put('subsidiary', new Map<String, Object>{'internalId'=>'9'});
8
9// Initializing the RequestJSON Data to be passed.
10Map<String, Object> requestJSONMap = new Map<String, Object>();
11 requestJSONMap.put('customerSubsidiaryRelationships', new List<Object>{nsCustomerSub1, nsCustomerSub2});
12 String reqJSON = JSON.serialize(requestJSONMap);
13
14Map<String, Object> reqObj = new Map<String, Object>();
15 reqObj.put('version', '1.0');
16 reqObj.put('action', 'createCustomerSubsidiaryRelationship');
17 reqObj.put('requestJSON', reqJSON);
18
19// Placing a request to Breadwinner Global API
20Map<String, Object> resp = breadwinner_ns.BreadwinnerNetSuiteAPI.call(reqObj);
21System.debug(resp);