---
title: Read
slug: xero/EtOs-read
description: Learn how to retrieve purchase orders from Xero in a targeted manner with this helpful guide. Discover various filters like order, page, status, date from, and date to, and explore an example code demonstrating their implementation. Follow easy steps to c
docTags: 
createdAt: 2021-11-02T07:47:44.000Z
---

You can read all POs 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.<br />e.g. page=1 |
| Status         | String   | Filter by purchase order status - DRAFT, AUTHORISED, BILLED                                                                            |
| Date From      | Date     | Filter by purchase order date                                                                                                          |
| Date To        | Date     | Filter by purchase order date                                                                                                          |



:::CodeblockTabs
Request

```apex
//  Create a Map to store all the data of a Purchase Order
Map<String, Object> purchaseOrderMap = new Map<String, Object>();
purchaseOrderMap.put('Status', 'DRAFT');    

//  Initializing the Request Data to be passed.
    Map<String, Object> reqObj = new Map<String, Object>();
    reqObj.put('version', '1.0');
    reqObj.put('action', 'readPurchaseOrder');
    reqObj.put('queryParameters', purchaseOrderMap);
    //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);

```

Response

```json
{
   action=readPurchaseOrder,
   responseJSON={
       "statusCode":200
      "purchaseOrders":[
         {
            "UpdatedDateUTC":null,
            "Type":"PURCHASEORDER",
            "TotalTax":0.00,
            "TotalDiscount":null,
            "Total":1000.00,
            "Telephone":"",
            "SubTotal":1000.00,
            "Status":"DRAFT",
            "SentToContact":null,
            "SalesforceRecordId":null,
            "Reference":null,
            "PurchaseOrderNumber":"PO-0001",
            "PurchaseOrderID":"2fef007e-1979-4634-9bb7-87c4559a0038",
            "Payments":null,
            "LineItems":[
               {
                  "UnitAmount":100.0000,
                  "Tracking":[
                     
                  ],
                  "TaxType":"INPUT",
                  "TaxAmount":0.00,
                  "Quantity":10.0000,
                  "LineItemID":"fd9bd48c-9f10-44de-aee4-c6185b2868c3",
                  "LineAmount":1000.00,
                  "ItemCode":null,
                  "DiscountRate":null,
                  "Description":"Line Item Description updated",
                  "AccountCode":"310"
               }
            ],
            "LineAmountTypes":"Exclusive",
            "IsDiscounted":false,
            "InvoiceNumber":null,
            "InvoiceID":null,
            "HasErrors":false,
            "DueDateString":null,
            "DueDate":null,
            "DeliveryInstructions":"",
            "DeliveryDateString":"2021-12-06T00:00:00",
            "DeliveryDate":"2021-12-06",
            "DeliveryAddress":"",
            "DateVariable":"/Date(1636588800000+0000)/",
            "DateString":"2021-11-11T00:00:00",
            "CurrencyRate":1.0000000000,
            "CurrencyCode":"INR",
            "CreditNotes":null,
            "Contact":{
               "Name":"Test Contact 2",
               "ContactStatus":"ACTIVE",
               "ContactID":"c84ebb15-0a8d-4145-933f-203e68d014a0"
            },
            "BrandingThemeID":null,
            "AttentionTo":"",
            "AmountPaid":null,
            "AmountDue":null,
            "AmountCredited":0.00
         }
      ],
      "errors":[
         
      ]
   },
   timestamp=1636638418069,
   validRequest=true,
   version=1.0
}
```
:::

