Get Payments
The Get Payments operation allows you to retrieve details of payments associated with a Fondy account. This operation requires the provision of a unique payment reference or filtering criteria such as date range and status.
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 code block below for an example:
{
"payment_reference": "11122223333",
"filters": {
"date_from": "2024-01-01T00:00:00.000Z",
"date_to": "2024-01-31T23:59:59.999Z",
"status": "COMPLETED"
}
}
Where:
Parameter | Description |
---|---|
payment_reference | The unique reference ID for the payment. |
filters.date_from | The start date for filtering payments (ISO 8601 format). |
filters.date_to | The end date for filtering payments (ISO 8601 format). |
filters.status | The status of the payments to retrieve (e.g., PENDING , COMPLETED ). |
Step 2: Make the encrypted request
To retrieve the payment 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(paymentRequest),
"encrypted_user": ENCRYPTED(<username>),
"encrypted_url": ENCRYPTED("/payments"),
"method": "GET"
}
In the request, ENCRYPTED(paymentRequest)
is the payload previously created, which is now encrypted.
Response
A successful request will return the encrypted response, as in the code block below:
{
"encrypted_payload": ENCRYPTED(paymentDetails),
"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:
{
"payment_reference": "11122223333",
"amount": {
"currency": "GBP",
"value": 99
},
"status": "COMPLETED",
"created_date_time": "2024-01-15T14:30:00.000Z",
"updated_date_time": "2024-01-15T15:00:00.000Z",
"counterparty": {
"name": "ExampleCounterparty",
"account_number": "12345678",
"sort_code": "35648"
}
}
Where:
Parameter | Description |
---|---|
payment_reference | The unique reference ID for the payment. |
amount.currency | The currency of the payment. |
amount.value | The amount of the payment in minor units. |
status | The current status of the payment (PENDING, COMPLETED). |
created_date_time | The date and time when the payment was created. |
updated_date_time | The date and time when the payment was last updated. |
counterparty.name | The name of the counterparty receiving the payment. |
counterparty.account_number | The account number of the counterparty. |
counterparty.sort_code | The sort code of the counterparty's bank. |