Read
1 min
You can read all Payments from Xero without passing any filters. However, to retrieve specific records based on any filter conditions, you can add the following filters as "queryParameters" as shown in the below example.
Param Name | Type | Description |
|---|---|---|
order | String | Order by any element returned |
page | String | Up to 100 purchase orders will be returned per call, with line items shown for each, when the page parameter is used. e.g. page=1 |
where | String | Filter by Filter using the where parameter. We recommend you limit filtering to the optimised elements only. order status - AUTHORISED, DELETED |
// Create a Map to store all the data of a Payment
Map<String, Object> paymentMap = new Map<String, Object>();
paymentMap.put('where', 'Reference="Test Payment"');
// Initializing the Request Data to be passed.
Map<String, Object> reqObj = new Map<String, Object>();
reqObj.put('version', '1.0');
reqObj.put('action', 'readPayment');
reqObj.put('queryParameters', paymentMap);
//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);