Update
1 min
The following is an example to update the existing Xero Contact using the Unique ContactID as a reference.
// Create a Map to store all the data of a Contact
Map<String, Object> contactMap = new Map<String, Object>();
contactMap.put('ContactID', '950f2525-14a8-4871-8348-980d6b9c5757');
contactMap.put('Name', 'Breadwinner Inc');
contactMap.put('SkypeUserName', 'jack.Rogers');
// Initializing the RequestJSON Data to be passed.
Map<String, Object> requestJSONMap = new Map<String, Object>();
requestJSONMap.put('contacts', new List<Object>{contactMap});
String reqJSON = JSON.serialize(requestJSONMap);
Map<String, Object> reqObj = new Map<String, Object>();
reqObj.put('version', '1.0');
reqObj.put('action', 'updateContact');
reqObj.put('requestJSON', reqJSON);
//Required, if Xero Multi-Org is enabled in Breadwinner.
reqObj.put('xeroOrgId', '!aa00TM');
// Placing a request to Breadwinner Global API
Map<String, Object> respMap = bread_winner.BreadwinnerXeroAPI.call(reqObj);
System.debug(respMap);