---
title: Read
slug: xero/9vsg-read
description: Learn how to retrieve specific payment records from Xero using filters such as "order", "page", and "where". Follow a detailed example showcasing the "where" filter to pull payments with a specific reference. Explore a code snippet demonstrating how to re
docTags: 
createdAt: 2021-12-22T07:43:01.000Z
---

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.<br />e.g. page=1                                                                                              |
| where          | String   | Filter by Filter using the *where* parameter. We recommend you limit filtering to the [optimised elements](https://developer.xero.com/documentation/api/accounting/payments#get-payments) only. order status -  AUTHORISED, DELETED |



:::CodeblockTabs
Request

```apex
//  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);

```

Response

```json
{
   action=readPayment,
   responseJSON={
       "statusCode":200
      "Payments":[
         {
            "UpdatedDateUTC":"/Date(1640247312807+0000)/",
            "Status":"AUTHORISED",
            "SalesforceRecordId":null,
            "Reference":"Test Payment",
            "PaymentType":"ACCRECPAYMENT",
            "PaymentID":"731c9d1e-4669-42d4-b369-508a293d1429",
            "IsReconciled":false,
            "Invoice":{
               "Type":"ACCREC",
               "Payments":[
                  
               ],
               "LineItems":[
                  
               ],
               "IsDiscounted":false,
               "InvoiceNumber":"INV-0007",
               "InvoiceID":"93151e60-3cad-4384-a2ed-99935444a218",
               "HasErrors":false,
               "CurrencyCode":"INR",
               "CreditNotes":[
                  
               ],
               "Contact":{
                  "Name":"Breadwinner Inc1",
                  "ContactStatus":null,
                  "ContactID":"f3044b57-fa66-4a8c-9bfe-7a4638764adf"
               },
               "AmountPaid":null,
               "AmountDue":null
            },
            "HasAccount":true,
            "DateVariable":"/Date(1640217600000+0000)/",
            "CurrencyRate":1.0000000000,
            "CreditNote":null,
            "BatchPaymentID":null,
            "BatchPayment":null,
            "BankAmount":50.00,
            "Amount":50.00,
            "Account":{
               "Code":"880",
               "AccountID":"72bae77e-149a-4d3b-8dac-06bfca1dd3e4"
            }
         }
      ],
      "errors":[
         
      ]
   },
   timestamp=1636638418069,
   validRequest=true,
   version=1.0
}
```
:::

