Skip to main content

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.

Encrypted Requests

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:

  1. Create the payload
  2. Make the encrypted request

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:

ParameterDescription
payment_referenceThe unique reference ID for the payment.
filters.date_fromThe start date for filtering payments (ISO 8601 format).
filters.date_toThe end date for filtering payments (ISO 8601 format).
filters.statusThe 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:

  1. Follow the steps in How to Integrate Fondy API to encrypt your request into the stack.
  2. 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:

ParameterDescription
payment_referenceThe unique reference ID for the payment.
amount.currencyThe currency of the payment.
amount.valueThe amount of the payment in minor units.
statusThe current status of the payment (PENDING, COMPLETED).
created_date_timeThe date and time when the payment was created.
updated_date_timeThe date and time when the payment was last updated.
counterparty.nameThe name of the counterparty receiving the payment.
counterparty.account_numberThe account number of the counterparty.
counterparty.sort_codeThe sort code of the counterparty's bank.