# Get Payouts by Reference

> POST `/getpayoutbyreference`
> Part of the Payouts API reference. Source: https://hub.ozow.com/api-reference/payouts-api/post-getpayoutbyreference/

Server: `https://payoutsapi.ozow.com/v1` (Production)

Other environments: `https://stagingpayoutsapi.ozow.com/v1` (Staging)

Search a site's payouts. Filtering on the merchant reference is the common case, and is what a status check falls back to when the payout identifier was not recorded.

## Authentication

- `ApiKey` (API key in the ApiKey header)

## Header parameters

- `SiteCode` (string, required) - A unique code for the site currently in use. A site code is generated when adding a site in the Ozow merchant admin section. [Please contact support for SiteCode - support@ozow.com]

## Request body (required)

- `pageSize` (integer) - How many payouts to return per page. Below 1 is treated as 1.
- `pageIndex` (integer) - Which page to return, counting from 1. Below 1 is treated as 1.
- `searchFields` (array of PayoutField) - Which fields `searchString` is matched against.
- `searchString` (string) - The value to search for in the fields named by `searchFields`.
- `sortField` (integer, one of 0, 1, 2, 3, 4) - The field to order the results by.
- `minAmount` (number) - Exclude payouts below this amount.
- `maxAmount` (number) - Exclude payouts above this amount.
- `dateFrom` (string, date-time) - Exclude payouts created before this moment.
- `dateTo` (string, date-time) - Exclude payouts created after this moment.
- `isRtc` (boolean) - Return only real time clearing payouts.
- `bulkReference` (string) - Return only payouts from the bulk upload with this reference.

## Responses

### 200 OK

- Header `X-Pagination`: Pagination metadata for the result set, as a JSON object. Carries the page counts and the flags for whether further pages exist.

array of PayOut

### 400 Bad Request. The request did not reach the API. A required header or query parameter is missing, or the body does not match the expected shape.

- `message` (string) - What was wrong with the request.

### 403 Forbidden. The `SiteCode` and `ApiKey` pair was not accepted.

- `message` (string) - What was wrong with the request.

### 500 Internal Server Error. The gateway could not reach the service or the integration failed. A failure inside the service is not this one. Those come back as a 200 with the reason in the payload, because the gateway maps every integration response it has no other rule for onto 200.

- `message` (string) - What was wrong with the request.
