Ledger

The ledger (and ledger items) represent all transactions into and out of your account.

An example of a settled transaction ledger object

{
"id": "a9832728-0107-11ed-b939-0242ac120002",
"type": "credit",
"amount": 72500,
"currency": "GBX",
"source": "settled transaction",
"created_at": "2022-07-08T00:00:00.000Z",
"transaction": {
"id": "af228f0c-0107-11ed-b939-0242ac120002",
"amount": 72500,
"currency": "GBX",
"created_at": "2022-07-07T09:25:07.982Z",
"completed_at": "2022-07-07T09:25:07.982Z"
}
}

An example of a disbursal ledger object

{
"id": "1b75d352-0109-11ed-b939-0242ac120002",
"type": "debit",
"amount": 168014,
"currency": "GBX",
"source": "disbursal",
"created_at": "2022-07-07T14:08:03.982Z",
"disbursal": {
"id": "919c9dba-0102-11ed-b939-0242ac120002",
"amount": 1060200,
"currency": "GBX",
"bank_reference": "X9876-080720221401",
"created_at": "2022-07-08T14:08:04.130Z",
"receiving_account": {
"iban": "GB89BARC20040444858415",
"account_number": "12345678",
"sort_code": "102030",
"name": "FELLOH",
"created_at": "2022-01-16T06:52:42.423Z"
}
}
}

idstring

Unique identifier for the ledger entry

typestring

Can be credit or debit and represents whether funds are coming in or out

amountinteger

The total value of the ledger entry.

currencystring

The currency of the ledger entry | see currency documentation

sourcestring

Can be settled transaction, disbursal or amendment. This indicates the source of the ledger entry (e.g. whether it was a transaction settling, a disbursal to bank account or an amendment from merchant acquirer)

created_atdatetime

The datetime at which the object was created within our systems

transactionobject

If the source of the ledger entry was a settled transaction, then this will contain a compact transaction object

disbursalobject

If the source of the ledger entry was a disbursal, then this will contain a disbursement object

amendmentobject

If the source of the ledger entry was a amendment, then this will contain an amendment object


Fetch all

POST/ledger

import axios from 'axios';
const response = await axios(
{
method: 'post',
url: 'https://api.felloh.com/ledger',
data: {
organisation: 'X9876',
skip: 10,
take: 20
},
headers: {
'Content-Type': 'application/json',
Authorization: `Bearer <YOUR TOKEN HERE>`,
},
},
);
use GuzzleHttp\Client;
function fetchLedgerData($token, $organization, $skip, $take) {
$url = "https://api.felloh.com/ledger";
$client = new Client();
$response = $client->post($url, [
'headers' => [
'Content-Type' => 'application/json',
'Authorization' => "Bearer $token",
],
'json' => [
'organisation' => $organization,
'skip' => $skip,
'take' => $take,
],
]);
$data = json_decode($response->getBody(), true);
return $data;
}
$token = "<YOUR TOKEN HERE>";
$organization = 'X9876';
$skip = 10;
$take = 20;
$response = fetchLedgerData($token, $organization, $skip, $take);
import requests
import json
def post_ledger(organisation, skip, take, access_token):
api_url = 'https://api.felloh.com/ledger'
headers = {
'Content-Type': 'application/json',
'Authorization': f'Bearer {access_token}'
}
data = {
'organisation': organisation,
'skip': skip,
'take': take
}
response = requests.post(api_url, headers=headers, data=json.dumps(data))
response.raise_for_status()
return response.text
response_data = post_ledger('X9876', 10, 20, '<YOUR TOKEN HERE>')
print(response_data)
using System;
using System.Net.Http;
using System.Text;
using System.Threading.Tasks;
class Program
{
static async Task Main()
{
var response = await PostLedger("X9876", 10, 20, "<YOUR TOKEN HERE>");
Console.WriteLine(response);
}
static async Task<string> PostLedger(string organisation, int skip, int take, string accessToken)
{
using (HttpClient client = new HttpClient())
{
string apiUrl = "https://api.felloh.com/ledger";
client.DefaultRequestHeaders.Add("Content-Type", "application/json");
client.DefaultRequestHeaders.Add("Authorization", $"Bearer {accessToken}");
var requestData = new
{
organisation = organisation,
skip = skip,
take = take
};
var content = new StringContent(Newtonsoft.Json.JsonConvert.SerializeObject(requestData), Encoding.UTF8, "application/json");
var httpResponse = await client.PostAsync(apiUrl, content);
httpResponse.EnsureSuccessStatusCode();
return await httpResponse.Content.ReadAsStringAsync();
}
}
}

JSON RESPONSE Defined by type parameter being NULL or 'json'

{
"data": [
{
"id": "a9832728-0107-11ed-b939-0242ac120002",
"type": "credit",
"amount": 72500,
"currency": "GBX",
"source": "settled transaction",
"created_at": "2022-07-08T00:00:00.000Z",
"transaction": {
"id": "af228f0c-0107-11ed-b939-0242ac120002",
"amount": 72500,
"currency": "GBX",
"created_at": "2022-07-07T09:25:07.982Z",
"completed_at": "2022-07-07T09:25:07.982Z"
}
},
{
"id": "1b75d352-0109-11ed-b939-0242ac120002",
"type": "debit",
"amount": 168014,
"currency": "GBX",
"source": "disbursal",
"created_at": "2022-07-07T14:08:03.982Z",
"disbursal": {
"id": "919c9dba-0102-11ed-b939-0242ac120002",
"amount": 1060200,
"currency": "GBX",
"bank_reference": "X9876-080720221401",
"created_at": "2022-07-08T14:08:04.130Z",
"receiving_account": {
"iban": "GB89BARC20040444858415",
"account_number": "12345678",
"sort_code": "102030",
"name": "FELLOH",
"created_at": "2022-01-16T06:52:42.423Z"
}
}
}
],
"errors": {},
"meta": {
"code": 200,
"reason": "OK",
"message": "The request was successful",
"request_id": "cdd40f5c-9d82-44c2-92e3-b5d2cad364f6",
"count": 2
}
}

CSV RESPONSE Defined by type parameter being 'csv'

{
"data": {
"url": "https://ledger-production-reports.s3.eu-west-2.amazonaws.com/02803bec-dddf-4f3e-902d-ef0e42a856af.csv"
},
"errors": [],
"meta": {
"code": 200,
"reason": "OK",
"message": "The request was successful",
"request_id": "02803bec-dddf-4f3e-902d-ef0e42a856af",
"count": 184
}
}

This endpoint retrieves all ledger entries. Entries are sorted by creation date, with the most recent entries coming first.

HTTP Method

POST

HTTP Endpoint

PRODhttps://api.felloh.com/ledger

SANDBOXhttps://sandbox.felloh.com/ledger

Payload

ParameterRequiredTypeDescription
organisationtruestringThe organisation ID that you want to fetch ledger entries for. You can find the organisation that you have access to by using the List all organisations method.
keywordfalsestringA customer name, booking reference or email address that you want to filter by.
skipfalseIntegerSee pagination section for details
takefalseIntegerSee pagination section for details
typefaslestringCan be 'csv' or 'json', defaults to json

Response

Returns an array of Ledger Objects