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// Required, make sure you add all Lines, otherwise, the payment will not be applied to any invoices.
10
11// Initializing the RequestJSON Data to be passed.
12Map<String, Object> requestJSONMap = new Map<String, Object>();
13 requestJSONMap.put('payments', new List<Object>{paymentMap});
14 String reqJSON = JSON.serialize(requestJSONMap);
15
16Map<String, Object> reqObj = new Map<String, Object>();
17 reqObj.put('version', '1.0');
18 reqObj.put('action', 'updatePayment');
19 reqObj.put('requestJSON', reqJSON);
20 //Required, if QuickBooks Multi-Org is enabled in Breadwinner.
21 reqObj.put('qbOrgId', '4620816365285051610');
22
23// Placing a request to Breadwinner Global API
24Map<String, Object> respMap = breadwinner_qbo.BreadwinnerQBAPI.call(reqObj);
25System.debug(respMap);