---
title: Read
slug: xero/read
description: Learn how to retrieve specific invoice records from Xero using filters with this comprehensive document. Discover the various filters available, such as order, page, includeArchived, IDs, ContactIDs, Statuses, InvoiceNumbers, and where. We provide an exam
docTags: 
createdAt: 2021-11-02T07:47:05.000Z
---

You can read all the Invoices 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.<br />e.g. page=1                                                                            |
| includeArchived | Boolean  | E.g. includeArchived=true<br />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                                                                                                                                                         |
| where           | String   | Filter using the *where* parameter. We recommend you limit filtering to the [optimised elements](https://developer.xero.com/documentation/api/accounting/invoices#optimised-use-of-the-where-filter) only. |



:::CodeblockTabs
Request

```apex
//  Create a Map to store all the data of a Invoice
Map<String, Object> invoiceFiltersMap = new Map<String, Object>();
invoiceFiltersMap.put('IDs', 'c8a475b9-42db-4c6b-8450-5f62e2df29a1');    

//  Initializing the Request Data to be passed.
    Map<String, Object> reqObj = new Map<String, Object>();
    reqObj.put('version', '1.0');
    reqObj.put('action', 'readInvoice');
    reqObj.put('queryParameters', invoiceFiltersMap);
    //Required, if Xero Multi-Org is enabled in Breadwinner. 
    reqObj.put('xeroOrgId', '!Abc123');  

//  Placing a request to Breadwinner Global API
Map<String, Object> respMap = bread_winner.BreadwinnerXeroAPI.call(reqObj);
System.debug(respMap);

```

Response

```json
{
   action=readInvoice,
   responseJSON={
      "statusCode":200,
      "invoices":[
         {
            "UpdatedDateUTC":null,
            "Type":"ACCREC",
            "TotalTax":0.00,
            "TotalDiscount":null,
            "Total":1000.00,
            "Telephone":"",
            "SubTotal":1000.00,
            "Status":"DRAFT",
            "SentToContact":null,
            "SalesforceRecordId":null,
            "Reference":"",
            "PurchaseOrderNumber":null,
            "PurchaseOrderID":null,
            "Payments":[
               
            ],
            "LineItems":[
               
            ],
            "LineAmountTypes":"Exclusive",
            "IsDiscounted":false,
            "InvoiceNumber":"INV-0001",
            "InvoiceID":"c8a475b9-42db-4c6b-8450-5f62e2df29a1",
            "HasErrors":false,
            "DueDateString":"2021-12-06T00:00:00",
            "DueDate":"/Date(1638748800000+0000)/",
            "DeliveryInstructions":"",
            "DeliveryDateString":null,
            "DeliveryDate":null,
            "DeliveryAddress":"",
            "DateVariable":"/Date(1636588800000+0000)/",
            "DateString":"2021-11-11T00:00:00",
            "CurrencyRate":1.0000000000,
            "CurrencyCode":"INR",
            "CreditNotes":[
               
            ],
            "Contact":{
               "Name":"Test Contact 2",
               "ContactStatus":null,
               "ContactID":"c84ebb15-0a8d-4145-933f-203e68d014a0"
            },
            "BrandingThemeID":"8e43230b-c814-4435-bdb4-84cad1875e3d",
            "AttentionTo":"",
            "AmountPaid":0.00,
            "AmountDue":1000.00,
            "AmountCredited":0.00
         }
      ],
      "errors":[
         
      ]
   },
   timestamp=1636611532979,
   validRequest=true,
   version=1.0
}
```
:::

