Choose a language javascript

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": "ONLINE",
"type": "CARD",
"payment_link": {
"id": "b5e1bd24-7379-4d27-b4d8-07120fefc25c",
"amount": 1000,
"customer_name": "Tom Jones",
"description": "Deposit for Bali",
"success_url": "https://pay.felloh.com/b5e1bd24-7379-4d27-b4d8-07120fefc25c/success",
"failure_url": "https://pay.felloh.com/b5e1bd24-7379-4d27-b4d8-07120fefc25c/failure",
"cancel_url": "https://pay.felloh.com/b5e1bd24-7379-4d27-b4d8-07120fefc25c/cancel",
"expires_at": "2021-12-17T15:10:37.589Z",
"created_at": "2021-11-17T15:10:37.589Z"
},
"metadata": {
"card_type": "DEBIT",
"bin_type": "PERSONAL",
"payment_brand": "MASTER",
"issuing_country": "GB",
"currency": "GBP",
"last_four_digits": "4397",
"cardholder_name": "Tom Jones",
"created_at": "2021-11-17T15:11:37.581Z"
},
"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

payment_linkobject

The payment link object that was used to create the transaction.

metadata.card_typestring

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

metadata.bin_typestring

The bin type of the card, can be PERSONAL or COMMERCIAL

metadata.payment_brandstring

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

metadata.issuing_countrystring

Issuing country of card in ISO 3166 format

metadata.last_four_digitsstring

The last four digits of the payment card

metadata.cardholder_namestring

The name of the cardholder

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


Fetch all

POST/agent/transactions

import axios from 'axios';
const response = await axios(
{
method: 'post',
url: 'https://api.felloh.com/agent/transactions',
data: {
organisation: 'X9876',
keyword: 'james.dean@gmail.com',
date_from: '2020-02-01',
date_to: '2021-05-10',
skip: 10,
take: 20,
statuses: ['COMPLETE', 'PENDING']
},
headers: {
'Content-Type': 'application/json',
Authorization: `Bearer <YOUR TOKEN HERE>`,
},
},
);

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

{
"data": {
"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": "ONLINE",
"type": "CARD",
"payment_link": {
"id": "b5e1bd24-7379-4d27-b4d8-07120fefc25c",
"amount": 1000,
"customer_name": "Tom Jones",
"description": "Deposit for Bali",
"success_url": "https://pay.felloh.com/b5e1bd24-7379-4d27-b4d8-07120fefc25c/success",
"failure_url": "https://pay.felloh.com/b5e1bd24-7379-4d27-b4d8-07120fefc25c/failure",
"cancel_url": "https://pay.felloh.com/b5e1bd24-7379-4d27-b4d8-07120fefc25c/cancel",
"expires_at": "2021-12-17T15:10:37.589Z",
"created_at": "2021-11-17T15:10:37.589Z"
},
"metadata": {
"card_type": "DEBIT",
"bin_type": "PERSONAL",
"payment_brand": "MASTER",
"issuing_country": "GB",
"currency": "GBP",
"last_four_digits": "4397",
"cardholder_name": "Tom Jones",
"created_at": "2021-11-17T15:11:37.581Z"
},
"provider_reference": "vmtest-12313211413-ab",
"completed_at": "2021-11-17T15:11:37.581Z",
"created_at": "2021-11-17T15:11:37.581Z"
},
"errors": {},
"meta": {
"code": 200,
"reason": "OK",
"message": "The request was successful",
"request_id": "cdd40f5c-9d82-44c2-92e3-b5d2cad364f6",
"count": 1
}
}

CSV RESPONSE Defined by type parameter being 'csv'

{
"data": {
"url": "https://agent-data-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 transactions. Transactions are sorted by creation date, with the most recent transactions coming first.

HTTP Method

POST

HTTP Endpoint

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

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

Payload

ParameterRequiredTypeDescription
organisationtruestringThe organisation ID that you want to fetch transactions for. You can find the organisation that you have access to by using the List all organisations method.
keywordfalsestringA customer name booking reference that you want to filter by.
skipfalseIntegerSee pagination section for details
takefalseIntegerSee pagination section for details
show-child-organisationsfasleBooleanWhether to also show transactions for any of the requested organisations child organisations
typefaslestringCan be 'csv' or 'json', defaults to json
date_fromfalsedateThe date that you want to get transactions from, in ISO 8601 format
date_tofalsedateThe date that you want to get transactions to, in ISO 8601 format
statusesfalsearrayAn array of statuses can be provided if you wish to filter by transaction status. If this is not provided, the query will default to exlucde abandoned and pending transactions. A full list of transaction statuses can be found by using the enums endpoint

Response

Returns an array of Transaction Objects


Fetch one

GET/agent/transactions/226009ab-ffe9-4c80-922b-982e8e7849f8

import axios from 'axios';
const transactionID = '226009ab-ffe9-4c80-922b-982e8e7849f8';
const response = await axios(
{
method: 'get',
url: `https://api.felloh.com/agent/transactions/${transactionID}`,
headers: {
'Content-Type': 'application/json',
Authorization: `Bearer <YOUR TOKEN HERE>`,
},
},
);

RESPONSE

{
"data": {
"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": "ONLINE",
"type": "CARD",
"payment_link": {
"id": "b5e1bd24-7379-4d27-b4d8-07120fefc25c",
"amount": 1000,
"customer_name": "Tom Jones",
"description": "Deposit for Bali",
"success_url": "https://pay.felloh.com/b5e1bd24-7379-4d27-b4d8-07120fefc25c/success",
"failure_url": "https://pay.felloh.com/b5e1bd24-7379-4d27-b4d8-07120fefc25c/failure",
"cancel_url": "https://pay.felloh.com/b5e1bd24-7379-4d27-b4d8-07120fefc25c/cancel",
"expires_at": "2021-12-17T15:10:37.589Z",
"created_at": "2021-11-17T15:10:37.589Z"
},
"metadata": {
"card_type": "DEBIT",
"bin_type": "PERSONAL",
"payment_brand": "MASTER",
"issuing_country": "GB",
"currency": "GBP",
"last_four_digits": "4397",
"cardholder_name": "Tom Jones",
"created_at": "2021-11-17T15:11:37.581Z"
},
"provider_reference": "vmtest-12313211413-ab",
"completed_at": "2021-11-17T15:11:37.581Z",
"created_at": "2021-11-17T15:11:37.581Z"
},
"errors": {},
"meta": {
"code": 200,
"reason": "OK",
"message": "The request was successful",
"request_id": "cdd40f5c-9d82-44c2-92e3-b5d2cad364f6"
}
}

This endpoint allows you to retrieve a single transactions

HTTP Method

GET

HTTP Endpoint

PRODhttps://api.felloh.com/agent/transactions/<TRANSACTION ID>

SANDBOXhttps://sandbox.felloh.com/agent/transactions/<TRANSACTION ID>

Path Parameters

ParameterRequiredTypeDescription
transaction_idtrueUUIDThe transaction id that you wish to retrieve

Response

Returns a Transaction Object