# Get Transaction By Reference

> GET `/GetTransactionByReference`
> Part of the Payments API reference. Source: https://hub.ozow.com/api-reference/payments-api/get-get-transaction-by-reference/

Server: `https://api.ozow.com` (Production)

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

This operation is used  when you want to query transactions using the merchant's transaction reference, specified when creating the payment request. 
This method is able to return multiple results. Ozow does not restrict the merchant from sending duplicate merchant references, though it is advised that a unique reference is sent per transaction. The number of results returned are limited to 10.
Note that the site code must be the same as the one used when the associated payment request was created.

## Authentication

- `ApiKey` (API key in the ApiKey header)
  - The unique API key for the merchant. See [Prerequisites and onboarding](../../getting-started/prerequisites-and-onboarding.md) for where to find it.

## Query parameters

- `siteCode` (string, required) - A unique code for the each of the merchant's sites. A site code is generated when adding a site in the Ozow merchant admin section.
- `transactionReference` (string, required) - The merchant's reference for the transaction.
- `isTest` (boolean) - Defaults to false. Use true only to get results for test requests.

## Request body

This method is called when you want to query transactions using the merchant's reference. This method is able to return multiple results. Ozow does not restrict the merchant from sending duplicate merchant references, though it is advised that a unique reference is sent per transaction. The number of results returned are limited to 10.

## Responses

### 200 Array of TransactionModel

**application/json**

array of TransactionModel

**application/xml**

array of TransactionModel

### 401 Unauthorized. The `ApiKey` header is missing or does not match the site, or for a `Secure` operation the bearer token is missing, expired or invalid.

string

Example (example 1):

```json
API key is missing or invalid.
```

### 403 Forbidden. The credentials were readable but the site cannot be authorised, because no merchant matches the site code or the merchant is deactivated.

string

Example (example 1):

```json
Merchant for site code TSTSTE0001 is deactivated
```

### 500 Internal Server Error. Something failed on the Ozow side.

string
