Charges

The charges object represents charges against transactions raised by a merchant acquirer.

An example of the charges object

{
"booking": {
"id": "ce9c7525-ec4e-44cd-a400-f2b6c8a5e1a9",
"booking_reference": "ABC-1234"
},
"charges": {
"amount": "2013",
"currency": "GBX",
"rate": "0.85"
},
"metadata": {
"level": "PERSONAL",
"card_type": "DEBIT",
"country_type": "DOMESTIC",
"payment_brand": "MASTER"
},
"transaction": {
"id": "a9832728-0107-11ed-b939-0242ac120002",
"amount": 130808,
"completed_at": "2024-03-31T04:01:14.000Z",
"created_at": "2024-03-31T04:00:10.149Z",
"currency": "GBX"
}
}

booking.idstring

The felloh booking id for the booking

booking.booking_referencestring

Your reference for the booking

transactionobject

The compact transaction object that the charge relates to.

metadata.levelstring

The bin type of the card

metadata.card_typestring

The card type that the charge was for, can be CREDIT or DEBIT

metadata.country_typestring

Country type of the card, can be DOMESTIC, INTRA or INTER

metadata.payment_brandstring

The brand of the card that payment was taken on. Most common values are MASTER, AMEX or VISA

charges.amountnumber

Total value of charges (in pence)

charges.currencystring

The currency of the transaction | see currency documentation

charges.ratenumber

Rate that the card was charged at


Fetch all

POST/agent/charges

import axios from 'axios';
const response = await axios(
{
method: 'post',
url: 'https://api.felloh.com/agent/charges',
data: {
organisation: 'X9876',
date_from: '2020-02-01',
date_to: '2021-05-10',
skip: 10,
take: 20
},
headers: {
'Content-Type': 'application/json',
Authorization: `Bearer <YOUR TOKEN HERE>`,
},
}
);
use GuzzleHttp\Client;
function getCharges($token, $dateFrom, $dateTo, $skip, $take) {
$url = 'https://api.felloh.com/agent/charges';
$client = new Client();
$response = $client->post($url, [
'json' => [
'organisation' => 'X9876',
'date_from' => $dateFrom,
'date_to' => $dateTo,
'skip' => $skip,
'take' => $take,
],
'headers' => [
'Content-Type' => 'application/json',
'Authorization' => 'Bearer ' . $token,
],
]);
$data = json_decode($response->getBody(), true);
return $data;
}
$token = 'YOUR_TOKEN_HERE'; // Replace with the actual token
$dateFrom = '2020-02-01'; // Specify the start date
$dateTo = '2021-05-10'; // Specify the end date
$skip = 10; // Specify the number of charges to skip
$take = 20; // Specify the number of charges to take
$response = getCharges($token, $dateFrom, $dateTo, $skip, $take);
import requests
import json
def post_agent_charges(organisation, date_from, date_to, skip, take, access_token):
api_url = 'https://api.felloh.com/agent/charges'
headers = {
'Content-Type': 'application/json',
'Authorization': f'Bearer {access_token}'
}
data = {
'organisation': organisation,
'date_from': date_from,
'date_to': date_to,
'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_agent_charges('X9876', '2020-02-01', '2021-05-10', 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 PostAgentCharges("X9876", "2020-02-01", "2021-05-10", 10, 20, "<YOUR TOKEN HERE>");
Console.WriteLine(response);
}
static async Task<string> PostAgentCharges(string organisation, string dateFrom, string dateTo, int skip, int take, string accessToken)
{
using (HttpClient client = new HttpClient())
{
string apiUrl = "https://api.felloh.com/agent/charges";
client.DefaultRequestHeaders.Add("Content-Type", "application/json");
client.DefaultRequestHeaders.Add("Authorization", $"Bearer {accessToken}");
var requestData = new
{
organisation = organisation,
date_from = dateFrom,
date_to = dateTo,
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();
}
}
}

RESPONSE

{
"data": [
{
"booking": {
"id": "ce9c7525-ec4e-44cd-a400-f2b6c8a5e1a9",
"booking_reference": "ABC-1234"
},
"charges": {
"amount": "2013",
"currency": "GBX",
"rate": "0.85"
},
"metadata": {
"level": "PERSONAL",
"card_type": "DEBIT",
"country_type": "DOMESTIC",
"payment_brand": "MASTER"
},
"transaction": {
"id": "a9832728-0107-11ed-b939-0242ac120002",
"amount": 130808,
"completed_at": "2024-03-31T04:01:14.000Z",
"created_at": "2024-03-31T04:00:10.149Z",
"currency": "GBX"
}
}
],
"errors": {},
"meta": {
"code": 200,
"reason": "OK",
"message": "The request was successful",
"request_id": "cdd40f5c-9d82-44c2-92e3-b5d2cad364f6",
"count": 1
}
}

This endpoint retrieves all charges.

HTTP Method

POST

HTTP Endpoint

PRODhttps://api.felloh.com/agent/charges

SANDBOXhttps://sandbox.felloh.com/agent/charges

Payload

ParameterRequiredTypeDescription
organisationtruestringThe organisation ID that you want to fetch charges for. You can find the organisation that you have access to by using the List all organisations method.
skipfalseIntegerSee pagination section for details
takefalseIntegerSee pagination section for details
date_fromfalsedateThe date that you want to get charges from, in ISO 8601 format
date_tofalsedateThe date that you want to get charges to, in ISO 8601 format

Response

Returns an array of Charges Objects