Get Transactions
The Get Transactions operation allows you to retrieve details of transactions associated with a Fondy account. This operation requires the provision of a unique transaction reference or filtering criteria such as date range, status, and transaction type.
This page will guide you through using this operation. See the following sections for more details.
All requests into the stack are performed using the Encrypted Endpoint, where the request and response of the operation are encrypted. See How to Integrate Fondy API to learn how to encrypt your operations and send them through the endpoint.
Request
The request process of this operation consists of the following two steps:
See the sections below for more details on each step.
Step 1: Create the payload
The required information must be sent in the payload. See the example below:
{
"transaction_reference": "TXN1234567890",
"filters": {
"date_from": "2024-01-01T00:00:00.000Z",
"date_to": "2024-01-31T23:59:59.999Z",
"status": "COMPLETED",
"type": "PAYMENT"
}
}
Where:
Parameter | Description |
---|---|
transaction_reference | The unique reference ID for the transaction. |
filters.date_from | The start date for filtering transactions (ISO 8601 format). |
filters.date_to | The end date for filtering transactions (ISO 8601 format). |
filters.status | The status of the transactions to retrieve (e.g., PENDING , COMPLETED ). |
filters.type | The type of transaction (PAYMENT , REFUND , WITHDRAWAL ). |
Once you create the payload, it has to be encrypted. See the following section for more details.
Step 2: Make the encrypted request
To retrieve the transaction details, follow the steps below:
- Follow the steps in How to Integrate Fondy API to encrypt your request into the stack.
- Send the encrypted operation using Encrypted Endpoint. See an example below:
{
"encrypted_payload": ENCRYPTED(transactionRequest),
"encrypted_user": ENCRYPTED(<username>),
"encrypted_url": ENCRYPTED("/transactions"),
"method": "GET"
}
In the request, ENCRYPTED(transactionRequest)
is the payload previously created, which is now encrypted.
Response
A successful request will return the encrypted response, as shown below:
{
"encrypted_payload": ENCRYPTED(transactionDetails),
"encrypted_url": null,
"method": null,
"nonce": null
}
This response has to be decrypted using the process explained in How to Integrate Fondy API. Once it is decrypted, the unencrypted payload is as follows:
{
"transaction_reference": "TXN1234567890",
"amount": {
"currency": "GBP",
"value": 150
},
"status": "COMPLETED",
"transaction_type": "PAYMENT",
"created_date_time": "2024-01-10T12:45:00.000Z",
"updated_date_time": "2024-01-10T13:15:00.000Z",
"counterparty": {
"name": "ExampleMerchant",
"account_number": "98765432",
"sort_code": "65432"
}
}
Where:
Parameter | Description |
---|---|
transaction_reference | The unique reference ID for the transaction. |
amount.currency | The currency of the transaction. |
amount.value | The amount of the transaction in minor units. |
status | The current status of the transaction (PENDING , COMPLETED ). |
transaction_type | The type of transaction (PAYMENT , REFUND , WITHDRAWAL ). |
created_date_time | The date and time when the transaction was created. |
updated_date_time | The date and time when the transaction was last updated. |
counterparty.name | The name of the counterparty in the transaction. |
counterparty.account_number | The account number of the counterparty. |
counterparty.sort_code | The sort code of the counterparty's bank. |