Bookings

This object represents a customers booking with one of the organisations that you are partnered with. It allows you to see all bookings for a defined period, excluding any personally identifiable information.

An example of a Booking Object

{
"booking": {
"id": "226009ab-ffe9-4c80-922b-982e8e7849f8",
"agent_booking_reference": "XXX123789",
"departure_date": "2022-07-18",
"return_date": "2022-07-25",
"gross_amount": 1000000,
"currency": "GBX",
"package_type": "ATOL",
"atol_receipt_number": "233234234"
},
"transactions": [
{
"id": "fe9afbbf-0854-48af-acec-1efd1bed229a",
"amount": 56300,
"status": "COMPLETE",
"method": "ONLINE",
"type": "CARD",
"currency": "GBX",
"created_at": "2022-01-28T10:58:31.165Z",
"completed_at": "2022-01-28T10:58:31.165Z"
}
],
"meta": {
"created_at": "2022-06-23T16:05:30.100Z",
"updated_at": "2022-06-23T16:13:14.794Z"
}
}

booking.idstring

Unique identifier for the booking.

booking.agent_booking_referencestring

Your unique reference for the customers booking

booking.departure_datedate

The date that the booking commences

booking.return_datedate

The date that the booking ends

booking.gross_amountinteger

The total value of the booking (in pence).

booking.currencystring

The currency of the booking | see currency documentation

booking.package_typestring

The package type. A full list of package can be found by using the enums endpoint

booking.atol_receipt_numberstring

The ATOL receipt number for the booking.

transactionsarray

An array containing all transactions linked to the booking

transactions[].idstring

Unique identifier for the transaction.

transactions[].statusstring

The transaction status. A full list of transaction statuses can be found by using the enums endpoint

transactions[].methodstring

The transaction method. A full list of transaction methods can be found by using the enums endpoint

transactions[].typestring

The transaction type. A full list of transaction types can be found by using the enums endpoint

transactions[].amountinteger

The total value of the transaction (in pence).

transactions[].currencystring

The currency of the transaction | see currency documentation

transactions[].created_atdatetime

The datetime at which the transaction was created within our systems

transactions[].completed_atdatetime

The datetime at which the transaction was completed within our systems

meta.created_atdatetime

The datetime at which the booking was created within our systems

meta.updated_atdatetime

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


Fetch all

POST/partner/bookings

import axios from 'axios';
const response = await axios(
{
method: 'post',
url: 'https://api.felloh.com/partner/bookings',
data: {
organisation: 'X9876',
date_from: '2020-02-01',
date_to: '2021-05-10',
},
headers: {
'Content-Type': 'application/json',
Authorization: `Bearer <YOUR TOKEN HERE>`,
},
}
);
use GuzzleHttp\Client;
function createPartnerBooking($token, $data) {
$url = "https://api.felloh.com/partner/bookings";
$client = new Client();
$response = $client->post($url, [
'headers' => [
'Content-Type' => 'application/json',
'Authorization' => "Bearer $token",
],
'json' => $data,
]);
return $response->getBody();
}
$token = "<YOUR TOKEN HERE>";
$data = [
'organisation' => 'X9876',
'date_from' => '2020-02-01',
'date_to' => '2021-05-10',
];
$response = createPartnerBooking($token, $data);
import requests
import json
def create_partner_booking(token):
url = 'https://api.felloh.com/partner/bookings'
payload = {
'organisation': 'X9876',
'date_from': '2020-02-01',
'date_to': '2021-05-10'
}
headers = {
'Content-Type': 'application/json',
'Authorization': f'Bearer {token}'
}
response = requests.post(url, data=json.dumps(payload), headers=headers)
response.raise_for_status()
result = response.json()['data']
return result
result = create_partner_booking('<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 CreatePartnerBooking(token);
Console.WriteLine(response);
}
static async Task<string> CreatePartnerBooking(string token)
{
using (var httpClient = new HttpClient())
{
var url = "https://api.felloh.com/partner/bookings";
var requestData = new
{
organisation = "X9876",
date_from = "2020-02-01",
date_to = "2021-05-10"
};
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.PostAsync(url, jsonContent);
response.EnsureSuccessStatusCode();
var responseData = await response.Content.ReadAsStringAsync();
var result = Newtonsoft.Json.JsonConvert.DeserializeObject<dynamic>(responseData).data;
return result;
}
}
}

RESPONSE

{
"data": [
{
"booking": {
"id": "226009ab-ffe9-4c80-922b-982e8e7849f8",
"agent_booking_reference": "XXX123789",
"departure_date": "2022-07-18",
"return_date": "2022-07-25",
"gross_amount": 1000000,
"currency": "GBX",
"package_type": "ATOL",
"atol_receipt_number": "233234234"
},
"transactions": [
{
"id": "fe9afbbf-0854-48af-acec-1efd1bed229a",
"amount": 56300,
"status": "COMPLETE",
"method": "ONLINE",
"type": "CARD",
"currency": "GBX",
"created_at": "2022-01-28T10:58:31.165Z",
"completed_at": "2022-01-28T10:58:31.165Z"
}
],
"meta": {
"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
}
}

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/partner/bookings

SANDBOXhttps://sandbox.felloh.com/partner/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.
date_fromtruedateThe booking departure date that you want to get bookings from, in ISO 8601 format
date_totruedateThe booking departure date that you want to get bookings to, in ISO 8601 format

Response

Returns an array of Booking Objects


Fetch one

GET/partner/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/partner/bookings/${bookingID}`,
headers: {
'Content-Type': 'application/json',
Authorization: `Bearer <YOUR TOKEN HERE>`,
},
}
);
use GuzzleHttp\Client;
function getPartnerBooking($token, $bookingID) {
$url = "https://api.felloh.com/partner/bookings/$bookingID";
$client = new Client();
$response = $client->get($url, [
'headers' => [
'Content-Type' => 'application/json',
'Authorization' => "Bearer $token",
],
]);
return $response->getBody();
}
$token = "<YOUR TOKEN HERE>";
$bookingID = '226009ab-ffe9-4c80-922b-982e8e7849f8';
$response = getPartnerBooking($token, $bookingID);
import requests
def get_partner_booking(token, booking_id):
url = f'https://api.felloh.com/partner/bookings/{booking_id}'
headers = {
'Content-Type': 'application/json',
'Authorization': f'Bearer {token}'
}
response = requests.get(url, headers=headers)
response.raise_for_status()
result = response.json()['data']
return result
booking_id = '226009ab-ffe9-4c80-922b-982e8e7849f8'
result = get_partner_booking('<YOUR TOKEN HERE>', booking_id)
print(result)
using System;
using System.Net.Http;
using System.Threading.Tasks;
class Program
{
static async Task Main()
{
var token = "<YOUR TOKEN HERE>";
var bookingId = "226009ab-ffe9-4c80-922b-982e8e7849f8";
var response = await GetPartnerBooking(token, bookingId);
Console.WriteLine(response);
}
static async Task<string> GetPartnerBooking(string token, string bookingId)
{
using (var httpClient = new HttpClient())
{
var url = $"https://api.felloh.com/partner/bookings/{bookingId}";
httpClient.DefaultRequestHeaders.Add("Content-Type", "application/json");
httpClient.DefaultRequestHeaders.Add("Authorization", $"Bearer {token}");
var response = await httpClient.GetAsync(url);
response.EnsureSuccessStatusCode();
var responseData = await response.Content.ReadAsStringAsync();
var result = Newtonsoft.Json.JsonConvert.DeserializeObject<dynamic>(responseData).data;
return result;
}
}
}

RESPONSE

{
"booking": {
"id": "226009ab-ffe9-4c80-922b-982e8e7849f8",
"agent_booking_reference": "XXX123789",
"departure_date": "2022-07-18",
"return_date": "2022-07-25",
"gross_amount": 1000000,
"currency": "GBX",
"package_type": "ATOL",
"atol_receipt_number": "233234234"
},
"transactions": [
{
"id": "fe9afbbf-0854-48af-acec-1efd1bed229a",
"amount": 56300,
"status": "COMPLETE",
"method": "ONLINE",
"type": "CARD",
"currency": "GBX",
"created_at": "2022-01-28T10:58:31.165Z",
"completed_at": "2022-01-28T10:58:31.165Z"
}
],
"meta": {
"created_at": "2022-06-23T16:05:30.100Z",
"updated_at": "2022-06-23T16:13:14.794Z"
}
}

This endpoint allows you to retrieve a single booking

HTTP Method

GET

HTTP Endpoint

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

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

Path Parameters

ParameterRequiredTypeDescription
booking_idtrueUUIDThe booking id that you wish to retrieve

Response

Returns a Booking Object