Read
You can read all Bills 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 invoices will be returned per call, with line items shown for each, when the page parameter is used. e.g. page=1 |
includeArchived | Boolean | E.g. includeArchived=true Invoices with a status of ARCHIVED will be included in the response |
IDs | String | Filter by a comma-separated list of InvoicesIDs |
ContactIDs | String | Filter by a comma-separated list of ContactIDs |
Statuses | String | Filter by a comma-separated list of Statuses |
InvoiceNumbers | String | Filter by a comma-separated list of InvoiceNumbers |
// Create a Map to store all the data of a Bill
Map<String, Object> billMap = new Map<String, Object>();
billMap.put('IDs','192d2166-7cfa-4f30-89c1-9ad1dc1f55df');
// Initializing the Request Data to be passed.
Map<String, Object> reqObj = new Map<String, Object>();
reqObj.put('version', '1.0');
reqObj.put('action', 'readBill');
reqObj.put('queryParameters',billMap);
//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);