1// Create a Map to store all the data of a Customer
2Map<String, Object> paymentMap = new Map<String, Object>();
3 paymentMap.put('Id','889');
4 paymentMap.put('TotalAmt','200');
5 paymentMap.put('CustomerRef' , new Map<String, Object>{'value' => '226'});
6 paymentMap.put('SyncToken','0');
7 paymentMap.put('PrivateNote','Memo field updated');
8
9// Initializing the RequestJSON Data to be passed.
10Map<String, Object> requestJSONMap = new Map<String, Object>();
11 requestJSONMap.put('payments', new List<Object>{paymentMap});
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', 'updatePayment');
17 reqObj.put('requestJSON', reqJSON);
18 //Required, if QuickBooks Multi-Org is enabled in Breadwinner.
19 reqObj.put('qbOrgId', '4620816365285051610');
20
21// Placing a request to Breadwinner Global API
22Map<String, Object> respMap = breadwinner_qbo.BreadwinnerQBAPI.call(reqObj);
23System.debug(respMap);