Transactions

This object represents a customer's transaction (completed, pending and failed). These can be undertaken within our system or yours.

An example transaction object

{
"id": "b5e1bd24-7379-4d27-b4d8-07120fefc25c",
"amount": 1000,
"currency": "GBX",
"booking": {
"id": "9a33a74f-1e3e-595d-b89f-9da87d289e05",
"email": "tom@felloh.org",
"customer_name": "Tom Jones",
"booking_reference": "FEL-123456",
"departure_date": null,
"return_date": null,
"created_at": "2021-11-17T15:10:37.589Z"
},
"organisation": {
"id": "X000",
"name": "Felloh"
},
"status": "COMPLETE",
"method": "PARTNER",
"type": "CARD",
"provider_reference": "vmtest-12313211413-ab",
"completed_at": "2021-11-17T15:11:37.581Z",
"created_at": "2021-11-17T15:11:37.581Z"
}

An example compact transaction object

{
"id": "b5e1bd24-7379-4d27-b4d8-07120fefc25c",
"amount": 1000,
"currency": "GBX",
"status": "COMPLETE",
"method": "ONLINE",
"type": "CARD",
"completed_at": "2021-11-17T15:11:37.581Z",
"created_at": "2021-11-17T15:11:37.581Z"
}

idstring

Unique identifier for the object.

amountnumber

The amount of the transaction

currencystring

The currency of the transaction | see currency documentation

bookingobject

The booking object that the transaction is linked to.

organisationobject

The organisation object that the transaction is linked to.

statusstring

The status of the payment

statusstring

The method that was used to take payment

statusstring

The type of payment method that was used

provider_referencestring

The payment providers reference for the transaction

completed_atdatetime

The datetime at which the transaction object was completed (payment taken).

created_atdatetime

The datetime at which the transaction object was created within our systems


Create one

PUT/partner/transactions/

import axios from 'axios';
const response = await axios(
{
method: 'put',
url: `https://api.felloh.com/partner/transactions`,
data : JSON.stringify({
amount: 20000,
currency: 'GBX',
booking_id: '226009ab-ffe9-4c80-922b-982e8e7849f8',
organisation: 'X1234',
status: 'COMPLETE',
provider_reference: 'vmtest-12313211413-ab',
customer_name: 'Tom Brady',
completed_at: new Date().toISOString(),
}),
headers: {
'Content-Type': 'application/json',
Authorization: `Bearer <YOUR TOKEN HERE>`,
},
},
);
require 'vendor/autoload.php'; // Include Guzzle library
use GuzzleHttp\Client;
$client = new Client();
$response = $client->request('PUT', 'https://api.felloh.com/partner/transactions', [
'json' => [
'amount' => 20000,
'currency' => 'GBX',
'booking_id' => '226009ab-ffe9-4c80-922b-982e8e7849f8',
'organisation' => 'X1234',
'status' => 'COMPLETE',
'provider_reference' => 'vmtest-12313211413-ab',
'customer_name' => 'Tom Brady',
'completed_at' => (new DateTime())->format(DateTime::ISO8601),
],
'headers' => [
'Content-Type' => 'application/json',
'Authorization' => 'Bearer <YOUR TOKEN HERE>',
],
]);
echo $response->getBody();
import requests
import json
from datetime import datetime
def update_partner_transaction(token):
url = 'https://api.felloh.com/partner/transactions'
payload = {
'amount': 20000,
'currency': 'GBX',
'booking_id': '226009ab-ffe9-4c80-922b-982e8e7849f8',
'organisation': 'X1234',
'status': 'COMPLETE',
'provider_reference': 'vmtest-12313211413-ab',
'customer_name': 'Tom Brady',
'completed_at': datetime.utcnow().strftime('%Y-%m-%dT%H:%M:%S.%f')[:-3] + 'Z'
}
headers = {
'Content-Type': 'application/json',
'Authorization': f'Bearer {token}'
}
response = requests.put(url, data=json.dumps(payload), headers=headers)
response.raise_for_status()
result = response.json()['data']
return result
result = update_partner_transaction('<YOUR TOKEN HERE>')
print(result)
using System;
using System.Net.Http;
using System.Text;
using System.Threading.Tasks;
class Program
{
static async Task Main()
{
var token = "<YOUR TOKEN HERE>";
var response = await UpdatePartnerTransaction(token);
Console.WriteLine(response);
}
static async Task<string> UpdatePartnerTransaction(string token)
{
using (var httpClient = new HttpClient())
{
var url = "https://api.felloh.com/partner/transactions";
var requestData = new
{
amount = 20000,
currency = "GBX",
booking_id = "226009ab-ffe9-4c80-922b-982e8e7849f8",
organisation = "X1234",
status = "COMPLETE",
provider_reference = "vmtest-12313211413-ab",
customer_name = "Tom Brady",
completed_at = DateTime.UtcNow.ToString("yyyy-MM-ddTHH:mm:ss.fffZ")
};
var jsonContent = new StringContent(Newtonsoft.Json.JsonConvert.SerializeObject(requestData), Encoding.UTF8, "application/json");
httpClient.DefaultRequestHeaders.Add("Content-Type", "application/json");
httpClient.DefaultRequestHeaders.Add("Authorization", $"Bearer {token}");
var response = await httpClient.PutAsync(url, jsonContent);
response.EnsureSuccessStatusCode();
var responseData = await response.Content.ReadAsStringAsync();
var result = Newtonsoft.Json.JsonConvert.DeserializeObject<dynamic>(responseData).data;
return result;
}
}
}

RESPONSE

{
"data": {
"id": "226009ab-ffe9-4c80-922b-982e8e7849f8",
},
"errors": {},
"meta": {
"code": 200,
"reason": "OK",
"message": "The request was successful",
"request_id": "cdd40f5c-9d82-44c2-92e3-b5d2cad364f6"
}
}

This endpoint allows you to create a transaction for one of your organisations

HTTP Method

PUT

HTTP Endpoint

PRODhttps://api.felloh.com/partner/transactions

SANDBOXhttps://sandbox.felloh.com/partner/transactions

Payload

ParameterRequiredTypeDescription
amounttrueintegerThe value that the transaction was for
currencyfalsestringThe currency that transactions was undertaken in, defaults to GBX, see currency documentation for more information.
booking_idfalsestringThe booking ID that the transaction is linked to.
organisationtruestringThe organisation ID that you want to create the transaction for.
statustruestringA full list of transaction statuses can be found by using the enums endpoint
provider_referencetruestringThe payment providers reference for the transaction
customer_nametruestringThe customers full name.
completed_attruedatetimeThe datetime at which the transaction object was completed (payment taken).

Response

ParameterTypeDescription
idUUIDThe ID of the payment link that you have created