> For the complete documentation index, see [llms.txt](https://6dot50.gitbook.io/6dot50-apis/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://6dot50.gitbook.io/6dot50-apis/pay-api/batches/get-batches.md).

# GET /batches

Gets a list of payment batches based on supplied filter criteria defined below.

Results will be limited to 1000 items if skip/take is not supplied. Results are returned ordered by CreatedAt descending.

A list of valid statusCode's can be obtained by calling [`GET /batch/statusCodes`](/6dot50-apis/pay-api/batches/get-batches-statuscodes.md).

### Request

Ensure the bearer token is included in the Header of the GET operation:

<table><thead><tr><th width="187">Header</th><th width="144.33333333333331">Mandatory</th><th>Description</th></tr></thead><tbody><tr><td><code>Authorization</code></td><td>Yes</td><td>Bearer token from <a href="/6dot50-apis/pay-api/authentication.md">/authentication/getToken</a></td></tr></tbody></table>

<table><thead><tr><th width="190">Parameter</th><th width="142">Type</th><th width="125">Mandatory</th><th>Description</th></tr></thead><tbody><tr><td><code>statusCode</code></td><td>string</td><td>No</td><td>Filter Batches by <code>statusCode</code>. <br><br>A list of valid <code>statusCode</code>'s can be obtained by calling <a href="/6dot50-apis/pay-api/batches/get-batches-statuscodes.md"><code>GET /batch/statusCodes</code></a>.</td></tr><tr><td><code>externalId</code></td><td>string</td><td>No</td><td>Filter Batches by External ID</td></tr><tr><td><code>skip</code></td><td>int</td><td>No</td><td>Items to skip when searching</td></tr><tr><td><code>take</code></td><td>int</td><td>No</td><td>Items to take when searching</td></tr></tbody></table>

### Response

An empty result set will be returned if no matches are found for supplied search criteria.

An array of Batches will be returned, with a Summary for each Batch:

```
[
  {
    "id": "string($guid)",
    "name": "string",
    "statusCode": "string",
    "externalId": "string",
    "createdAt": "string($date-time)",
    "summary": {
      "paymentsAmount": decimal,
      "paymentsCount": int32,
      "referralsAmount": decimal,
      "settledAmount": decimal,
      "settledCount": int32,
      "cancelledAmount": decimal,
      "cancelledCount": int32
    }
  }
]
```

<table><thead><tr><th width="178.33333333333331">Field</th><th width="202">Response Type</th><th>Description</th></tr></thead><tbody><tr><td><code>id</code></td><td>string($guid)</td><td>Unique ID for the Batch. Used for subsequent calls to other Batch operations.</td></tr><tr><td><code>name</code></td><td>string</td><td>Name of the Batch as supplied in the request.</td></tr><tr><td><code>externalId</code></td><td>string</td><td>External ID of the Batch as supplied in the request.</td></tr><tr><td><code>statusCode</code></td><td>string</td><td>Status of the Batch. A new Batch will always have a DRAFT status code.</td></tr><tr><td><code>createdAt</code></td><td>string($date-time)</td><td>Date and time when the Batch was created.</td></tr><tr><td><code>summary</code></td><td><a href="#batchsummary"><code>BatchSummary</code></a> </td><td>Standard Batch Summary response model.</td></tr></tbody></table>

#### BatchSummary

<table><thead><tr><th width="203.33333333333331">Field</th><th width="179">Response Type</th><th>Description</th></tr></thead><tbody><tr><td><code>paymentsAmount</code></td><td>decimal</td><td>Total value of payments to be made.</td></tr><tr><td><code>paymentsCount</code></td><td>int32</td><td>Total count of payments to be made.</td></tr><tr><td><code>referralsAmount</code></td><td>decimal</td><td>Total value of referral payments to be made.</td></tr><tr><td><code>settledAmount</code></td><td>decimal</td><td>Total value of payments that have been settled to users (i.e. paid to their accounts). The balance (<code>paymentsAmount</code> less <code>settledAmount</code>) is the value of payments pending to non-6DOT50 members (i.e. still to join)</td></tr><tr><td><code>settledCount</code></td><td>int32</td><td>Total count of Payments settled</td></tr><tr><td><code>cancelledAmount</code></td><td>decimal</td><td>Total amount of Payments cancelled in the batch (e.g. by using cancel operation)</td></tr><tr><td><code>cancelledCount</code></td><td>int32</td><td>Total count of Payments cancelled</td></tr></tbody></table>

{% code title="Example Response" %}

```
[  
  {
    "id": "26828622-cf47-4416-b9fa-3ba65d4d4d19",
    "name": "Test Batch X",
    "statusCode": "CLOSED",
    "createdAt": "2022-10-31T08:39:12.06",
    "summary": {
      "paymentsAmount": 30,
      "paymentsCount": 2,
      "referralsAmount": 0,
      "settledAmount": 10,
      "settledCount": 1,
      "cancelledAmount": 20,
      "cancelledCount": 1
    }
  },
  {
    "id": "f915671c-b00f-4f77-8175-253093d51a21",
    "name": "Test Batch Y",
    "statusCode": "DRAFT",
    "createdAt": "2022-06-14T06:26:43.473",
    "summary": {
      "paymentsAmount": 18500,
      "paymentsCount": 185,
      "referralsAmount": 0,
      "settledAmount": 0,
      "settledCount": 0,
      "cancelledAmount": 0,
      "cancelledCount": 0
    }
  },
  {
    "id": "ee1f02aa-40c5-48f3-a430-2f0ad86e5f5d",
    "name": "Test Batch Z",
    "statusCode": "CLOSED",
    "createdAt": "2022-03-11T11:56:25.493",
    "summary": {
      "paymentsAmount": 30,
      "paymentsCount": 3,
      "referralsAmount": 0,
      "settledAmount": 15,
      "settledCount": 2,
      "cancelledAmount": 15,
      "cancelledCount": 1
    }
  }
]
```

{% endcode %}
