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"},"surcharge": {"amount": 21,"currency": "GBX"},"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
surcharge.amountnumber
The total value of surcharges on the transaction (this will only be available if you have surcharging enabled)
surcharge.currencystring
The currency of surcharges on the transaction, (this will only be available if you have surcharging enabled)
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"},"surcharge": {"amount": 21,"currency": "GBX"},"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
Parameter | Required | Type | Description |
---|---|---|---|
organisation | true | string | The 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. |
keyword | false | string | A customer name booking reference that you want to filter by. |
skip | false | Integer | See pagination section for details |
take | false | Integer | See pagination section for details |
show-child-organisations | fasle | Boolean | Whether to also show transactions for any of the requested organisations child organisations |
type | fasle | string | Can be 'csv' or 'json', defaults to json |
date_from | false | date | The date that you want to get transactions from, in ISO 8601 format |
date_to | false | date | The date that you want to get transactions to, in ISO 8601 format |
statuses | false | array | An 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"},"surcharge": {"amount": 21,"currency": "GBX"},"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
Parameter | Required | Type | Description |
---|---|---|---|
transaction_id | true | UUID | The transaction id that you wish to retrieve |
Response
Returns a Transaction Object
Generate a refund
POST/agent/transactions/226009ab-ffe9-4c80-922b-982e8e7849f8/refund
import axios from 'axios';const transactionID = '226009ab-ffe9-4c80-922b-982e8e7849f8';const amount = 90;const response = await axios({method: 'post',url: `https://api.felloh.com/agent/transactions/${transactionID}/refund`,data: { amount },headers: {'Content-Type': 'application/json',Authorization: `Bearer <YOUR TOKEN HERE>`,},},);
RESPONSE
{"data": {},"errors": {},"meta": {"code": 200,"reason": "OK","message": "The request was successful","request_id": "cdd40f5c-9d82-44c2-92e3-b5d2cad364f6","count": 1}}
This endpoint generates a refund request, this will then need to be authorised by a member of your organisation that has the sufficent roles to authorise it.
HTTP Method
POST
HTTP Endpoint
PRODhttps://api.felloh.com/agent/transactions/<TRANSACTION ID>/refund
SANDBOXhttps://sandbox.felloh.com/agent/transactions/<TRANSACTION ID>/refund
Payload
Parameter | Required | Type | Description |
---|---|---|---|
amount | true | string | The amount of the transaction that you wish to refund in the lowest denomination of the currency (for GBX it is pence, for USX it is cents) |
Response
Returns a Refund Object
Complete a pre-authorised transaction
GET/agent/transactions/226009ab-ffe9-4c80-922b-982e8e7849f8/complete
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}/complete`,headers: {'Content-Type': 'application/json',Authorization: `Bearer <YOUR TOKEN HERE>`,},},);
RESPONSE
{"data": {},"errors": {},"meta": {"code": 200,"reason": "OK","message": "The request was successful","request_id": "cdd40f5c-9d82-44c2-92e3-b5d2cad364f6","count": 1}}
This endpoint allows you to complete a pre-authorised transaction
HTTP Method
GET
HTTP Endpoint
PRODhttps://api.felloh.com/agent/transactions/<TRANSACTION ID>/complete
SANDBOXhttps://sandbox.felloh.com/agent/transactions/<TRANSACTION ID>/complete
Response
Returns an empty 200 response if successful
Reverse a pre-authorised transaction
GET/agent/transactions/226009ab-ffe9-4c80-922b-982e8e7849f8/reverse
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}/reverse`,headers: {'Content-Type': 'application/json',Authorization: `Bearer <YOUR TOKEN HERE>`,},},);
RESPONSE
{"data": {},"errors": {},"meta": {"code": 200,"reason": "OK","message": "The request was successful","request_id": "cdd40f5c-9d82-44c2-92e3-b5d2cad364f6","count": 1}}
This endpoint allows you to reverse a pre-authorised transaction
HTTP Method
GET
HTTP Endpoint
PRODhttps://api.felloh.com/agent/transactions/<TRANSACTION ID>/reverse
SANDBOXhttps://sandbox.felloh.com/agent/transactions/<TRANSACTION ID>/reverse
Response
Returns an empty 200 response if successful
Re-assign a transaction
POST/agent/transactions/226009ab-ffe9-4c80-922b-982e8e7849f8/re-assign
import axios from 'axios';const transactionID = '226009ab-ffe9-4c80-922b-982e8e7849f8';const newBookingID = 'b7c259ba-d356-4263-912f-c6c4e29155ec';const response = await axios({method: 'post',url: `https://api.felloh.com/agent/transactions/${transactionID}/re-assign`,data: {booking_id: newBookingID,},headers: {'Content-Type': 'application/json',Authorization: `Bearer <YOUR TOKEN HERE>`,},},);
RESPONSE
{"data": {"booking": {"id": "b7c259ba-d356-4263-912f-c6c4e29155ec","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"},"transaction": {"id": "226009ab-ffe9-4c80-922b-982e8e7849f8","amount": 1000,"currency": "GBX","status": "COMPLETE","method": "ONLINE","type": "CARD","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}}
This endpoint allows you to re-assign a transaction from one booking to another
HTTP Method
POST
HTTP Endpoint
PRODhttps://api.felloh.com/agent/transactions/<TRANSACTION ID>/re-assign
SANDBOXhttps://sandbox.felloh.com/agent/transactions/<TRANSACTION ID>/re-assign
Response
Returns an array containing the Transaction Object and the new booking object