Booking Component

This object represents a component of a booking.

An example of a Booking Object

{
"id": "8224bb6e-1d70-588b-82b8-226f2d71012e",
"supplier": {
"id": "6ab41ce7-36c8-5835-b997-492adb3d66e1",
"name": "Felloh Travel - Packages",
"created_at": "2022-06-28T17:27:59.616Z"
},
"amount": 56300,
"currency": "GBX",
"booking_reference": "X1232JJ",
"destination_air": "AMS",
"type": "flight",
"created_at": "2023-02-15T16:00:18.886Z"
}

idstring

Unique identifier for the object.

supplierobject

The supplier object that the booking component is booked with

amountinteger

The amount that the component is for, in the lowest denomination for the currency (for GBP, this would be pence)

currencystring

The currency of the component | see currency documentation

booking_referencestring

The supplier booking reference for the component

destination_airdate

If the component is a flight component, this represents the destination airport code

typedate

A reference type for component (flight, package, transfer, etc...)

created_atdatetime

The datetime at which the object was created within our systems


Create one

PUT/agent/booking/8224bb6e-1d70-588b-82b8-226f2d71012e/component

import axios from 'axios';
const response = await axios(
{
method: 'put',
url: `https://api.felloh.com/agent/booking/8224bb6e-1d70-588b-82b8-226f2d71012e/component`,
data : JSON.stringify({
"supplier": "ab6f8eb9-1c07-4ca4-888b-ae1a11b4463c",
"amount": 56300,
"currency": "GBX",
"booking_reference": "X1232JJ",
"destination_air": "AMS",
"type": "flight",
}),
headers: {
'Content-Type': 'application/json',
Authorization: `Bearer <YOUR TOKEN HERE>`,
},
}
);
use GuzzleHttp\Client;
function updateBookingComponent($token, $bookingComponentID) {
$url = 'https://api.felloh.com/agent/booking/' . $bookingComponentID . '/component';
$client = new Client();
$response = $client->put($url, [
'headers' => [
'Content-Type' => 'application/json',
'Authorization' => 'Bearer ' . $token,
],
'json' => [
'supplier' => 'ab6f8eb9-1c07-4ca4-888b-ae1a11b4463c',
'amount' => 56300,
'currency' => 'GBX',
'booking_reference' => 'X1232JJ',
'destination_air' => 'AMS',
'type' => 'flight',
],
]);
$data = json_decode($response->getBody(), true);
return $data;
}
$token = 'YOUR_TOKEN_HERE'; // Replace with the actual token
$bookingComponentID = '8224bb6e-1d70-588b-82b8-226f2d71012e'; // Replace with the actual booking component ID
$response = updateBookingComponent($token, $bookingComponentID);
import requests
import json
def put_agent_booking_component(component_id, access_token):
api_url = f'https://api.felloh.com/agent/booking/{component_id}/component'
headers = {
'Content-Type': 'application/json',
'Authorization': f'Bearer {access_token}'
}
data = {
"supplier": "ab6f8eb9-1c07-4ca4-888b-ae1a11b4463c",
"amount": 56300,
"currency": "GBX",
"booking_reference": "X1232JJ",
"destination_air": "AMS",
"type": "flight"
}
response = requests.put(api_url, headers=headers, data=json.dumps(data))
response.raise_for_status()
return response.text
component_id = '8224bb6e-1d70-588b-82b8-226f2d71012e'
response_data = put_agent_booking_component(component_id, '<YOUR TOKEN HERE>')
print(response_data)
using System;
using System.Net.Http;
using System.Text;
using System.Threading.Tasks;
class Program
{
static async Task Main()
{
var response = await PutAgentBookingComponent("8224bb6e-1d70-588b-82b8-226f2d71012e", "<YOUR TOKEN HERE>");
Console.WriteLine(response);
}
static async Task<string> PutAgentBookingComponent(string componentId, string accessToken)
{
using (HttpClient client = new HttpClient())
{
string apiUrl = $"https://api.felloh.com/agent/booking/{componentId}/component";
client.DefaultRequestHeaders.Add("Content-Type", "application/json");
client.DefaultRequestHeaders.Add("Authorization", $"Bearer {accessToken}");
var requestData = new
{
supplier = "ab6f8eb9-1c07-4ca4-888b-ae1a11b4463c",
amount = 56300,
currency = "GBX",
booking_reference = "X1232JJ",
destination_air = "AMS",
type = "flight"
};
var content = new StringContent(Newtonsoft.Json.JsonConvert.SerializeObject(requestData), Encoding.UTF8, "application/json");
var httpResponse = await client.PutAsync(apiUrl, content);
httpResponse.EnsureSuccessStatusCode();
return await httpResponse.Content.ReadAsStringAsync();
}
}
}

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 component

HTTP Method

PUT

HTTP Endpoint

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

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

Path Parameters

ParameterRequiredTypeDescription
booking_IDtrueUUIDThe booking id that you wish to add a component to

Payload

ParameterRequiredTypeDescription
suppliertrueuuidThe supplier object that the booking component is booked with
amounttrueintThe amount that the component is for, in the lowest denomination for the currency (for GBP, this would be pence)
currencytruestringThe currency of the component
booking_referencetruestringThe supplier booking reference for the component
destination_airfalsestringThe date that the booking returns
typefalsestringA reference type for component (flight, package, transfer, etc...)

Response

ParameterTypeDescription
idUUIDThe ID of the component that you have created

Delete one

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

import axios from 'axios';
const bookingID = '226009ab-ffe9-4c80-922b-982e8e7849f8';
const componentID = '226009ab-ffe9-4c80-922b-982e8e7849f8';
const response = await axios(
{
method: 'delete',
url: `https://api.felloh.com/agent/bookings/${bookingID}/component/${componentID}`,
headers: {
'Content-Type': 'application/json',
Authorization: `Bearer <YOUR TOKEN HERE>`,
},
}
);
use GuzzleHttp\Client;
function deleteBookingComponent($token, $bookingID, $componentID) {
$url = 'https://api.felloh.com/agent/bookings/' . $bookingID . '/component/' . $componentID;
$client = new Client();
$response = $client->delete($url, [
'headers' => [
'Content-Type' => 'application/json',
'Authorization' => 'Bearer ' . $token,
],
]);
$data = json_decode($response->getBody(), true);
return $data;
}
$token = 'YOUR_TOKEN_HERE'; // Replace with the actual token
$bookingID = '226009ab-ffe9-4c80-922b-982e8e7849f8'; // Replace with the actual booking ID
$componentID = '226009ab-ffe9-4c80-922b-982e8e7849f8'; // Replace with the actual component ID
$response = deleteBookingComponent($token, $bookingID, $componentID);
import requests
def delete_agent_booking_component(booking_id, component_id, access_token):
api_url = f'https://api.felloh.com/agent/bookings/{booking_id}/component/{component_id}'
headers = {
'Content-Type': 'application/json',
'Authorization': f'Bearer {access_token}'
}
response = requests.delete(api_url, headers=headers)
response.raise_for_status()
return response.text
booking_id = '226009ab-ffe9-4c80-922b-982e8e7849f8'
component_id = '226009ab-ffe9-4c80-922b-982e8e7849f8'
response_data = delete_agent_booking_component(booking_id, component_id, '<YOUR TOKEN HERE>')
print(response_data)
using System;
using System.Net.Http;
using System.Threading.Tasks;
class Program
{
static async Task Main()
{
string bookingId = "226009ab-ffe9-4c80-922b-982e8e7849f8";
string componentId = "226009ab-ffe9-4c80-922b-982e8e7849f8";
var response = await DeleteAgentBookingComponent(bookingId, componentId, "<YOUR TOKEN HERE>");
Console.WriteLine(response);
}
static async Task<string> DeleteAgentBookingComponent(string bookingId, string componentId, string accessToken)
{
using (HttpClient client = new HttpClient())
{
string apiUrl = $"https://api.felloh.com/agent/bookings/{bookingId}/component/{componentId}";
client.DefaultRequestHeaders.Add("Content-Type", "application/json");
client.DefaultRequestHeaders.Add("Authorization", $"Bearer {accessToken}");
var httpResponse = await client.DeleteAsync(apiUrl);
httpResponse.EnsureSuccessStatusCode();
return await httpResponse.Content.ReadAsStringAsync();
}
}
}

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 component

HTTP Method

DELETE

HTTP Endpoint

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

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

Path Parameters

ParameterRequiredTypeDescription
booking_IDtrueUUIDThe booking id that you wish to delete the component for
component IDtrueUUIDThe component id that you wish to delete

Response

Returns an empty object