Choose a language javascript

Bookings

This object represents a customers booking with you. It allows you to collect customer payments and group them into one entity.

An example of a Booking Object

{
"id": "226009ab-ffe9-4c80-922b-982e8e7849f8",
"gross_amount": 1000000,
"email": "james.dean@gmail.com",
"user": {
"id": "e8c243ff-d000-4f81-ba57-94184d44dae2",
"email": "tom@felloh.com"
},
"transactions": [
{
"id": "fe9afbbf-0854-48af-acec-1efd1bed229a",
"amount": 56300,
"status": "COMPLETE",
"method": "ONLINE",
"type": "CARD",
"created_at": "2022-01-28T10:58:31.165Z",
"completed_at": "2022-01-28T10:58:31.165Z"
}
],
"payment_links": [
{
"id": "b5e1bd24-7379-4d27-b4d8-07120fefc25c",
"amount": 1000,
"description": "Deposit for Bali",
"expires_at": "2021-12-17T15:10:37.589Z",
"created_at": "2021-11-17T15:10:37.589Z",
"email": "tom@felloh.com",
"currency": "GBX",
"methods": {
"open_banking": true,
"card": true
}
}
],
"customer_name": "James Dean",
"booking_reference": "XXX123789",
"departure_date": "2022-07-18",
"return_date": "2022-07-25",
"created_at": "2022-06-23T16:05:30.100Z",
"updated_at": "2022-06-23T16:13:14.794Z"
}

idstring

Unique identifier for the object.

gross_amountinteger

The total value of the booking (in pence).

emailstring

The email address of the customer

userobject

The compact user object of the user that created the booking

transactionsarray

An array containing all compact transaction objects linked to the booking

payment_linkobject

An array containing all companct payment link object that are associated with the booking.

customer_namestring

The name of the customer that the booking is for

booking_referencestring

Your unique reference for the customers booking

departure_datedate

The date that the booking commences

return_datedate

The date that the booking ends

created_atdatetime

The datetime at which the object was created within our systems

updated_atdatetime

The datetime at which the object was last updated within our systems


Fetch all

POST/agent/bookings

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

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

{
"data": [
{
"id": "226009ab-ffe9-4c80-922b-982e8e7849f8",
"gross_amount": 1000000,
"email": "james.dean@gmail.com",
"user": {
"id": "e8c243ff-d000-4f81-ba57-94184d44dae2",
"email": "tom@felloh.com"
},
"transactions": [
{
"id": "fe9afbbf-0854-48af-acec-1efd1bed229a",
"amount": 56300,
"status": "COMPLETE",
"method": "ONLINE",
"type": "CARD",
"created_at": "2022-01-28T10:58:31.165Z",
"completed_at": "2022-01-28T10:58:31.165Z"
}
],
"payment_links": [
{
"id": "b5e1bd24-7379-4d27-b4d8-07120fefc25c",
"amount": 1000,
"description": "Deposit for Bali",
"expires_at": "2021-12-17T15:10:37.589Z",
"created_at": "2021-11-17T15:10:37.589Z",
"email": "tom@felloh.com",
"currency": "GBX",
"methods": {
"open_banking": true,
"card": true
}
}
],
"customer_name": "James Dean",
"booking_reference": "XXX123789",
"departure_date": "2022-07-18",
"return_date": "2022-07-25",
"created_at": "2022-06-23T16:05:30.100Z",
"updated_at": "2022-06-23T16:13:14.794Z"
}
],
"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 bookings. Bookings are sorted by creation date, with the most recent bookings coming first.

HTTP Method

POST

HTTP Endpoint

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

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

Payload

ParameterRequiredTypeDescription
organisationtruestringThe organisation ID that you want to fetch bookings 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
show-child-organisationsfasleBooleanWhether to also show booking for any of the requested organisations child organisations
typefaslestringCan be 'csv' or 'json', defaults to json
date_fromfalsedateThe booking departure date that you want to get bookings from, in ISO 8601 format
date_tofalsedateThe booking departure date that you want to get bookings to, in ISO 8601 format
booking_referencefaslestringAllows you to find a booking by exact booking reference (not case sensitive)

Response

Returns an array of Booking Objects


Fetch one

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

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

RESPONSE

{
"data": {
"id": "226009ab-ffe9-4c80-922b-982e8e7849f8",
"gross_amount": 1000000,
"email": "james.dean@gmail.com",
"user": {
"id": "e8c243ff-d000-4f81-ba57-94184d44dae2",
"email": "tom@felloh.com"
},
"transactions": [
{
"id": "fe9afbbf-0854-48af-acec-1efd1bed229a",
"amount": 56300,
"status": "COMPLETE",
"method": "ONLINE",
"type": "CARD",
"created_at": "2022-01-28T10:58:31.165Z",
"completed_at": "2022-01-28T10:58:31.165Z"
}
],
"customer_name": "James Dean",
"booking_reference": "XXX123789",
"departure_date": "2022-07-18",
"return_date": "2022-07-25",
"created_at": "2022-06-23T16:05:30.100Z",
"updated_at": "2022-06-23T16:13:14.794Z"
},
"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 booking

HTTP Method

GET

HTTP Endpoint

PRODhttps://api.felloh.com/agent/bookings/<BOOKING ID>

SANDBOXhttps://sandbox.felloh.com/agent/bookings/<BOOKING ID>

Path Parameters

ParameterRequiredTypeDescription
booking_IDtrueUUIDThe booking id that you wish to retrieve

Response

Returns a Booking Object


Create one

PUT/agent/bookings/

import axios from 'axios';
const response = await axios(
{
method: 'put',
url: `https://api.felloh.com/agent/bookings`,
data : JSON.stringify({
organisation: 'X9876',
customer_name: 'James Dean',
email: 'james@felloh.org',
booking_reference: 'XXX123789',
departure_date: '2022-07-18',
return_date: '2022-07-25',
gross_amount: 1000000,
}),
headers: {
'Content-Type': 'application/json',
Authorization: `Bearer <YOUR TOKEN HERE>`,
},
}
);

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 new booking

HTTP Method

PUT

HTTP Endpoint

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

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

Payload

ParameterRequiredTypeDescription
organisationtruestringThe organisation ID that you want to create the booking in.
customer_nametruestringThe customers full name.
emailtruestringThe customers email address
departure_datefalsedateThe date that the booking departs
return_datefalsedateThe date that the booking returns
gross_amountfalseIntegerThe total value of the booking

Response

ParameterTypeDescription
idUUIDThe ID of the booking that you have created

Delete one

DELETE/agent/bookings/226009ab-ffe9-4c80-922b-982e8e7849f8

import axios from 'axios';
const bookingID = '226009ab-ffe9-4c80-922b-982e8e7849f8';
const response = await axios(
{
method: 'delete',
url: `https://api.felloh.com/agent/bookings/${bookingID}`,
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"
}
}

This endpoint allows you to delete a booking if it has no transactions on it.

HTTP Method

DELETE

HTTP Endpoint

PRODhttps://api.felloh.com/agent/bookings/<BOOKING ID>

SANDBOXhttps://sandbox.felloh.com/agent/bookings/<BOOKING ID>

Path Parameters

ParameterRequiredTypeDescription
booking_IDtrueUUIDThe booking id that you wish to delete

Response

Returns an empty object


Update booking reference

POST/agent/bookings/226009ab-ffe9-4c80-922b-982e8e7849f8/update-reference

import axios from 'axios';
const bookingID = '226009ab-ffe9-4c80-922b-982e8e7849f8';
const response = await axios(
{
method: 'post',
url: `https://api.felloh.com/agent/bookings/${bookingID}/update-reference`,
data: {
booking_reference: 'test-1234',
},
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"
}
}

This endpoint allows you to update the booking reference for a booking

HTTP Method

POST

HTTP Endpoint

PRODhttps://api.felloh.com/agent/bookings/<BOOKING ID>/update-reference

SANDBOXhttps://sandbox.felloh.com/agent/bookings/<BOOKING ID>/update-reference

Path Parameters

ParameterRequiredTypeDescription
booking_IDtrueUUIDThe booking id that you wish to update

Payload

ParameterRequiredTypeDescription
booking_referencetruestringThe new booking reference for the booking

Response

Returns an empty object