# List payout batches for org
GET https://api-sandbox.payabli.com/api/Query/batchesOut/org/{orgId}
Retrieve a list of MoneyOut batches for an org. Use filters to limit results. Include the `exportFormat` query parameter to return the results as a file instead of a JSON response.
Reference: https://docs.payabli.com/developers/api-reference/query/get-list-of-moneyout-batches-for-an-org
## OpenAPI Specification
```yaml
openapi: 3.1.1
info:
title: Get list of MoneyOut batches for an org
version: endpoint_query.ListBatchesOutOrg
paths:
/Query/batchesOut/org/{orgId}:
get:
operationId: list-batches-out-org
summary: Get list of MoneyOut batches for an org
description: >-
Retrieve a list of MoneyOut batches for an org. Use filters to limit
results. Include the `exportFormat` query parameter to return the
results as a file instead of a JSON response.
tags:
- - subpackage_query
parameters:
- name: orgId
in: path
description: The numeric identifier for organization, assigned by Payabli.
required: true
schema:
type: integer
- name: exportFormat
in: query
required: false
schema:
$ref: '#/components/schemas/type_:ExportFormat'
- name: fromRecord
in: query
description: >-
The number of records to skip before starting to collect the result
set.
required: false
schema:
type: integer
default: 0
- name: limitRecord
in: query
description: >-
Max number of records to return for the query. Use `0` or negative
value to return all records.
required: false
schema:
type: integer
default: 20
- name: parameters
in: query
description: >-
Collection of field names, conditions, and values used to filter the
query.
**You must remove `parameters=` from the request before you send it, otherwise Payabli will ignore the filters.**
Because of a technical limitation, you can't make a request that includes filters from the API console on this page. The response won't be filtered. Instead, copy the request, remove `parameters=` and run the request in a different client.
For example:
--url https://api-sandbox.payabli.com/api/Query/transactions/org/236?parameters=totalAmount(gt)=1000&limitRecord=20
should become:
--url https://api-sandbox.payabli.com/api/Query/transactions/org/236?totalAmount(gt)=1000&limitRecord=20
See [Filters and Conditions
Reference](/developers/developer-guides/pay-ops-reporting-engine-overview#filters-and-conditions-reference)
for more information.
**List of field names accepted**:
- `batchDate` (gt, ge, lt, le, eq, ne)
- `batchNumber` (ne, eq)
- `batchAmount` (gt, ge, lt, le, eq, ne)
- `parentOrgId` (ne, eq, nin, in)
- `status` (in, nin, eq, ne)
- `orgId` (eq)
- `paypointLegal` (ne, eq, ct, nct)
- `paypointDba` (ne, eq, ct, nct)
- `orgName` (ne, eq, ct, nct)
- `paypointId` (ne, eq)
- `externalPaypointID` (ct, nct, eq, ne)
required: false
schema:
type: object
additionalProperties:
type: string
- name: sortBy
in: query
description: >-
The field name to use for sorting results. Use `desc(field_name)` to
sort descending by `field_name`, and use `asc(field_name)` to sort
ascending by `field_name`.
required: false
schema:
type: string
- name: requestToken
in: header
required: true
schema:
type: string
responses:
'200':
description: Success
content:
application/json:
schema:
$ref: '#/components/schemas/type_:QueryBatchesOutResponse'
'400':
description: Bad request/ invalid data
content: {}
'401':
description: Unauthorized request.
content: {}
'500':
description: Internal API Error
content: {}
'503':
description: Database connection error
content: {}
components:
schemas:
type_:ExportFormat:
type: string
enum:
- description: Comma-separated values file
value: csv
- description: Excel spreadsheet file
value: xlsx
type_:BatchNumber:
type: string
type_:Entrypointfield:
type: string
type_:ExternalPaypointId:
type: string
type_:QueryBatchesOutResponseRecordsItem:
type: object
properties:
AchAmount:
type: number
format: double
AchRecords:
type: integer
AchStatus:
type: integer
AchStatusText:
type: string
BatchAmount:
type: number
format: double
description: The amount of the batch.
BatchCancelledAmount:
type: number
format: double
BatchCancelledRecords:
type: integer
BatchDate:
type: string
format: date-time
description: The batch date.
BatchNumber:
$ref: '#/components/schemas/type_:BatchNumber'
BatchPaidAmount:
type: number
format: double
BatchPaidRecords:
type: integer
BatchProcessedAmount:
type: number
format: double
BatchProcessedRecords:
type: integer
BatchProcessingAmount:
type: number
format: double
BatchProcessingRecords:
type: integer
BatchRecords:
type: integer
description: The number of records in the batch.
BatchStatus:
type: integer
description: >-
The batch status. See [Batch
Status](/developers/references/money-out-statuses#batch-statuses)
for more.
BatchStatusText:
type: string
description: A text description of the batch status.
CardAmount:
type: number
format: double
CardRecords:
type: integer
CardStatus:
type: integer
CardStatusText:
type: string
CheckAmount:
type: number
format: double
CheckRecords:
type: integer
CheckStatus:
type: integer
CheckStatusText:
type: string
EntryName:
$ref: '#/components/schemas/type_:Entrypointfield'
externalPaypointID:
$ref: '#/components/schemas/type_:ExternalPaypointId'
IdBatch:
type: integer
description: The batch ID.
ParentOrgName:
type: string
description: The entrypoint's parent org.
PaypointDba:
type: string
description: Paypoint DBA name.
PaypointId:
type: integer
description: Paypoint ID.
PaypointName:
type: string
description: Paypoint legal name.
VcardAmount:
type: number
format: double
VcardRecords:
type: integer
VcardStatus:
type: integer
VcardStatusText:
type: string
WireAmount:
type: number
format: double
WireRecords:
type: integer
WireStatus:
type: integer
WireStatusText:
type: string
type_:PageIdentifier:
type: string
type_:BatchSummary:
type: object
properties:
pageidentifier:
$ref: '#/components/schemas/type_:PageIdentifier'
pageSize:
type: integer
description: Number of records on each response page.
totalAmount:
type: number
format: double
description: Total amount for the records.
totalNetAmount:
type: number
format: double
description: Total net amount for the records.
totalPages:
type: integer
description: Total number of pages in response.
totalRecords:
type: integer
description: Total number of records in response.
type_:QueryBatchesOutResponse:
type: object
properties:
Records:
type: array
items:
$ref: '#/components/schemas/type_:QueryBatchesOutResponseRecordsItem'
Summary:
$ref: '#/components/schemas/type_:BatchSummary'
required:
- Records
- Summary
```
## SDK Code Examples
```python
from payabli import payabli
client = payabli(
api_key="YOUR_API_KEY",
)
client.query.list_batches_out_org(
org_id=123,
from_record=251,
limit_record=0,
sort_by="desc(field_name)",
)
```
```typescript
import { PayabliClient } from "@payabli/sdk-node";
const client = new PayabliClient({ apiKey: "YOUR_API_KEY" });
await client.query.listBatchesOutOrg(123, {
fromRecord: 251,
limitRecord: 0,
sortBy: "desc(field_name)"
});
```
```go
import (
context "context"
option "github.com/payabli/sdk-go/option"
sdkgo "github.com/payabli/sdk-go"
sdkgoclient "github.com/payabli/sdk-go/client"
)
client := sdkgoclient.NewClient(
option.WithApiKey(
"",
),
)
response, err := client.Query.ListBatchesOutOrg(
context.TODO(),
123,
&sdkgo.ListBatchesOutOrgRequest{
FromRecord: sdkgo.Int(
251,
),
LimitRecord: sdkgo.Int(
0,
),
SortBy: sdkgo.String(
"desc(field_name)",
),
},
)
```
```csharp
using PayabliApi;
var client = new PayabliApiClient("API_KEY");
await client.Query.ListBatchesOutOrgAsync(
123,
new ListBatchesOutOrgRequest
{
FromRecord = 251,
LimitRecord = 0,
SortBy = "desc(field_name)",
}
);
```
```ruby
require 'uri'
require 'net/http'
url = URI("https://api-sandbox.payabli.com/api/Query/batchesOut/org/123?fromRecord=251&limitRecord=0&sortBy=desc%28field_name%29")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["requestToken"] = ''
response = http.request(request)
puts response.read_body
```
```java
HttpResponse response = Unirest.get("https://api-sandbox.payabli.com/api/Query/batchesOut/org/123?fromRecord=251&limitRecord=0&sortBy=desc%28field_name%29")
.header("requestToken", "")
.asString();
```
```php
request('GET', 'https://api-sandbox.payabli.com/api/Query/batchesOut/org/123?fromRecord=251&limitRecord=0&sortBy=desc%28field_name%29', [
'headers' => [
'requestToken' => '',
],
]);
echo $response->getBody();
```
```swift
import Foundation
let headers = ["requestToken": ""]
let request = NSMutableURLRequest(url: NSURL(string: "https://api-sandbox.payabli.com/api/Query/batchesOut/org/123?fromRecord=251&limitRecord=0&sortBy=desc%28field_name%29")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
```