---
title: Testing GET Transactions
slug: testing-get-transactions
docTags: 
createdAt: 2024-06-10T11:14:24.851Z
---

## GET Transactions Scenarios (Positive Flow)

### Important to Consider

- Ensure the **List All Transactions** permission is enabled on your API credentials.
- There are no limits on **date ranges**.
  - Queries for long date ranges may time out.&#x20;
    We recommend you use **short&#x20;**&#x64;ate ranges.
- The page size is currently limited t&#x6F;**&#x20;500 or less**.
- Retrieve details using a specific **yourConsumerReference**.
- Retrieve details using a specific **yourPaymentReference**.
- Retrieve details of a single transaction using the **receiptId**.
  - Use the sandbox endpoint:
    `.../transactions/{receiptId}`
- You can query the following transaction types:
  - payments
  - preAuths
  - refunds
  - collections
    Use the sandbox endpoint:
    `.../transactions/{transactionType}`

***

### Scenarios

Return a list of transactions within a given **time frame**, a specific **consumer**, or a specific **payment**:

| **Suggested Test Scenario**                                                                                                                                                                                                                                                                                            | **Expected Outcome** | **Tip**                                                                                                                                                                                                |
| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| Get a list of transactions, sorted in time-ascending order.                                                                                                                                                                                                                                                            | 200<br />Successful  | Sort field.<br />Values:<br />* time-descending
* time-ascending<br />**Default value: time-descending**                                                                                               |
| Get a list of transactions, sorted in time-descending order.                                                                                                                                                                                                                                                           | 200<br />Successful  | Sort field.<br />Values:<br />* time-descending
* time-ascending<br />**Default value: time-descending**                                                                                               |
| Get a list of 20 transactions.                                                                                                                                                                                                                                                                                         | 200<br />Successful  | pageSize field.<br />Values:<br />* minimum: 1
* maximum: 500<br />**Default value: 10**<br />Enter pageSize = 20                                                                                      |
| Get a list of transactions with a specific yourConsumerReference.                                                                                                                                                                                                                                                      | 200<br />Successful  | Unique reference to anonymously identify your customer.<br />Format:<br />* Must be below 40 characters.<br />Enter a specific **yourConsumerReference&#x20;**&#x69;n the yourConsumerReference field. |
| Get a list of transactions with a specific yourPaymentReference.                                                                                                                                                                                                                                                       | 200<br />Successful  | Your unique reference for this payment.<br />Format:<br />* Maximum length 50 characters.<br />Enter a specific **yourPaymentReference&#x20;**&#x69;n the yourPaymentReference field.                  |
| Specify a date range and yourConsumerReference where there are **no transactions** based on that criteria.<br />You will receive a successful response (displaying zero transactions).<br />Ensure the null return is properly displayed for the consumer, and handle how your app responds to this specific scenario. | 200<br />Successful  | :::BlockQuote
\{&#xA; "resultCount": 0,&#xA; "pageSize": 10,&#xA; "offset": 0,&#xA; "results": \[],&#xA; "sort": "time-descending"&#xA;}
:::                                                           |

***

Retrieve details of a **single transaction** using the **receiptId**:

| **Suggested Test Scenario**                                                                                       | **Expected Outcome** | **Tip**<br />                                                                                                                         |
| ----------------------------------------------------------------------------------------------------------------- | -------------------- | ------------------------------------------------------------------------------------------------------------------------------------- |
| Get the details of a transaction using the receiptId from a test:<br />* payment
* preAuth
* checkCard
* saveCard | 200<br />Successful  | Get the **receiptId&#x20;**&#x66;rom the response of the initial:<br />* payments \| preAuths \| checkCard \| saveCard test scenario. |
| Get the details of a transaction using the receiptId from a test:<br />* collection
* void                        | 200<br />Successful  | Get the **receiptId&#x20;**&#x66;rom the response of the initial:<br />* collections \| voids test scenario.                          |

***

Return a list of transactions of a **transactionType&#x20;**&#x61;ssociated with the given query:

| **Suggested Test Scenario**                                 | **Expected Outcome** | **Tip**<br />                                                                          |
| ----------------------------------------------------------- | -------------------- | -------------------------------------------------------------------------------------- |
| Get a list of transactions with transactionType = preauths. | 200<br />Successful  | Use the sandbox endpoint:<br />`https://api-sandbox.judopay.com/transactions/preauths` |
| Get a list of transactions with transactionType = refunds.  | 200<br />Successful  | Use the sandbox endpoint:<br />`https://api-sandbox.judopay.com/transactions/refunds`  |

***

### Request Parameters

Sandbox endpoint:
`https://api-sandbox.judopay.com/transactions`
Sandbox endpoint:
`https://api-sandbox.judopay.com/transactions/{receiptId}`
Sandbox endpoint:
`https://api-sandbox.judopay.com/transactions/{transactionType}`

HTTP Method: **GET**

**Header Parameters:**

Depending on how you integrate with Judopay, you can authenticate requests by:

- `/paymentsession`, or
- TokenSecretAuth
  - The token and secret pair

For more information, see [Authentication Methods](docId\:ylKW5coh5NQnfQ3j_Wjk2).

| API-Version:  | 6.26<br />For the latest version of the Judopay Transaction API, see [Latest Version](docId\:bcXNM5keOk-nlNrZTafUT). |
| ------------- | -------------------------------------------------------------------------------------------------------------------- |
| Content-Type: | application/json                                                                                                     |
| Accept:       | application/json                                                                                                     |

***

**Body Parameters**:

**Configuration Property Descriptions**

| **Parameter**                                                      | **Description**                                                                                                                  |
| ------------------------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------- |
| `pageSize`<br />Integer                                            | The number of records to display per page.<br />**Default value: 10**                                                            |
| `offset`<br />Integer                                              | The (zero-based) index in the sorted list of records from which the results set will start.<br />**Default value: 0**            |
| `sort`<br />String                                                 | Determines how the list is sorted.<br />Values :<br />* time-descending
* time-ascending<br />**Default value: time-descending** |
| `from`<br />String                                                 | Earliest date used to find transactions.<br />Format:<br />* DD/MM/YYYY                                                          |
| `to`<br />String                                                   | Latest date used to find transactions.<br />Format:<br />* DD/MM/ YYYY                                                           |
| `yourConsumerReference`<br />String                                | If specified, the list of transactions will match thi&#x73;**&#x20;yourConsumerReference**.                                      |
| `yourPaymentReference`<br />String                                 | If specified, the list of transactions will match this **yourPaymentReference**.                                                 |
| `receiptId`<br />String<br /><font color="#ef5b2e">Required</font> | Judopay’s reference, that identifies the transaction.<br />Get the receiptId from the response of the initial request.           |

:::CodeblockTabs
GET ReceiptID

```json

https://api-sandbox.judopay.com/transactions/968893796475637760
```

Response Example (ReceiptID)

```json
{
    "receiptId": "968893796475637760",
    "yourPaymentReference": "Payment111",
    "type": "Payment",
    "createdAt": "2023-04-27T16:18:02.3780+01:00",
    "result": "Success",
    "message": "AuthCode: 033670",
    "judoId": 100042597,
    "merchantName": "Shodan",
    "appearsOnStatementAs": "Shodan",
    "netAmount": "5.00",
    "amount": "5.00",
    "currency": "GBP",
    "acquirerTransactionId": "75516047204453281723",
    "externalBankResponseCode": "",
    "authCode": "033670",
    "postCodeCheckResult": "Unknown",
    "acquirer": "Barclays",
    "cardDetails": {
        "cardLastfour": "3436",
        "endDate": "1230",
        "cardToken": "SOF-u-CNJ8D3TSmz70eeCeZ_2g",
        "cardType": 11,
        "cardScheme": "VISA",
        "cardFunding": "Debit",
        "cardCategory": "",
        "cardCountry": "FR",
        "bank": "CREDIT INDUSTRIEL ET COMMERCIAL",
        "cardHolderName": "Emma Waters"
    },
    "billingAddress": {},
    "consumer": {
        "yourConsumerReference": "Alayna.Crona@example.net"
    },
    "yourPaymentMetaData": {},
    "threeDSecure": {
        "attempted": false
    },
    "risks": {
        "postCodeCheck": "UNKNOWN",
        "cv2Check": "PASSED",
        "merchantSuggestion": "Allow"
    }
}
```

GET All Transactions

```json

https://api-sandbox.judopay.com/transactions?from=01/01/2021&to=01/01/2023&pageSize=50

```

Response Example (All Transactions)&#x20;

```json
{
    "resultCount": 1060479,
    "pageSize": 10,
    "offset": 0,
    "results": [
        {
            "receiptId": "965609160727236608",
            "yourPaymentReference": "5fb14ac3-ddff-49b4-ad20-4ad1ac473b01",
            "type": "PreAuth",
            "createdAt": "2023-04-18T14:46:06.0231+01:00",
            "result": "Success",
            "message": "AuthCode: 5",
            "judoId": 100502614,
            "merchantName": "Shodan",
            "appearsOnStatementAs": "Shodan",
            "amountCollected": "0.00",
            "netAmount": "5.00",
            "amount": "5.00",
            "currency": "GBP",
            "postCodeCheckResult": "Unknown",
            "cardDetails": {
                "cardLastfour": "1111",
                "endDate": "1230",
                "cardType": 1,
            },
            "consumer": {
                "yourConsumerReference": "Consumer"
            },
            "yourPaymentMetaData": {}
        },
        {
            "receiptId": "965577423548743680",
            "yourPaymentReference": "98b46ad3-4ced-4b4a-93cf-7e81f82a8fc1",
            "type": "Payment",
            "createdAt": "2023-04-18T12:39:57.0387+01:00",
            "result": "Success",
            "message": "AuthCode: 961022",
            "judoId": 100042297,
            "merchantName": "Shodan",
            "appearsOnStatementAs": "Shodan",
            "netAmount": "1.01",
            "amount": "1.01",
            "currency": "GBP",
            "postCodeCheckResult": "Unknown",
            "cardDetails": {
                "cardLastfour": "3436",
                "endDate": "1225",
                "cardType": 11,
            },
            "consumer": {
                "yourConsumerReference": "Consumer"
            },
            "yourPaymentMetaData": {
                "internalLocationRef": "Example",
                "internalId": 99
            }
        },
        {
            "receiptId": "965576965044207616",
            "yourPaymentReference": "d48503dc-9619-4413-a39c-4e99478ba96c",
            "type": "Payment",
            "createdAt": "2023-04-18T12:38:07.7234+01:00",
            "result": "Success",
            "message": "AuthCode: 217509",
            "judoId": 100042197,
            "merchantName": "Shodan",
            "appearsOnStatementAs": "Shodan",
            "netAmount": "1.01",
            "amount": "1.01",
            "currency": "GBP",
            "postCodeCheckResult": "Unknown",
            "cardDetails": {
                "cardLastfour": "3436",
                "endDate": "1225",
                "cardType": 11,
            },
            "consumer": {
                "yourConsumerReference": "Consumer"
            },
            "yourPaymentMetaData": {
                "internalLocationRef": "Example",
                "internalId": 99
            }
        },
        }
    ],
    "sort": "time-descending"
}
```
:::

***

## GET Transactions Scenarios (Negative Flow)

Field and formatting errors can occur for various reasons, it can be impossible to simulate all the negative scenarios in a sandbox environment.

| **Suggested Negative Test Scenario**                                                                                                                      | **Expected Error Code** | **Error Description**                                                                                                                                                                                                              |
| --------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Attempt to retrieve a list of transactions where the **List All Transactions&#x20;**&#x70;ermission **is not&#x20;**&#x65;nabled on your API credentials. | 84                      | :::BlockQuote
\{&#xA; "message": "Sorry, it looks  like permissions are not enabled to perform this request. &#xA;Application permissions can be configured in the judo Dashboard.",&#xA; "code": 84,&#xA; "category": 1&#xA;}
::: |
| Attempt to return the details of a single transaction using a **receiptId&#x20;**&#x74;hat **does not&#x20;**&#x65;xist.                                  | 82                      | :::BlockQuote
\{&#xA; "message": "Sorry, the transaction you've specified has not been found. &#xA;Please check your details and try again.",&#xA; "code": 82,&#xA; "category": 2&#xA;}
:::                                        |
| Attempt to return a list of 550 transactions.                                                                                                             | 20015<br />             | Sorry, but the page size is currently limited to 500 or less.                                                                                                                                                                      |

:::hint{type="warning"}
Where the codes remain fixed, the descriptions may change.&#x20;
You **should not&#x20;**&#x62;uild any error handling logic based on these descriptions.
:::

For a list of possible error codes, types and descriptions, see  [Error Codes and Descriptions](docId:_zrsihomUEW-XnRQ4PBtJ).

