Booking Components

A Booking Component object represents an individual component of a booking, such as a flight or package, and includes details like the supplier, amount, and more.


Booking Component Model

Properties

  • Name
    id
    Type
    string
    Description

    Unique identifier for the object.

  • Name
    supplier
    Type
    object
    Description

    The supplier model that the booking component is booked with.

  • Name
    amount
    Type
    integer
    Description

    The amount that the component is for, in the lowest denomination for the currency (e.g., pence for GBP).

  • Name
    currency
    Type
    string
    Description

    The currency of the component. See the currency documentation.

  • Name
    booking_reference
    Type
    string
    Description

    The supplier booking reference for the component.

  • Name
    destination_air
    Type
    string
    Description

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

  • Name
    type
    Type
    string
    Description

    A reference type for the component (e.g., flight, package, transfer).

  • Name
    created_at
    Type
    datetime
    Description

    The datetime at which the object was created within our systems.

{
  "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"
}

PUT/agent/booking/:booking_id/component

Create One

This endpoint allows you to create a new booking component.

Path Parameters

  • Name
    booking_id
    Type
    UUID
    Description

    The booking ID to which you wish to add a component.

Parameters

  • Name
    supplierrequired
    Type
    uuid
    Description

    The supplier object that the booking component is booked with.

  • Name
    amountrequired
    Type
    integer
    Description

    The amount that the component is for, in the lowest denomination for the currency.

  • Name
    currencyrequired
    Type
    string
    Description

    The currency of the component.

  • Name
    booking_referencerequired
    Type
    string
    Description

    The supplier booking reference for the component.

  • Name
    destination_airrequired
    Type
    string
    Description

    (Optional) The destination airport code if the component is a flight.

  • Name
    typerequired
    Type
    string
    Description

    (Optional) A reference type for the component (e.g., flight, package, transfer).

Returns

  • Name
    id
    Type
    string
    Description

    Unique identifier for the object.

Request

PUT
/agent/booking/:booking_id/component
import axios from 'axios';

const response = await axios.put(
  `https://api.felloh.com/agent/booking/8224bb6e-1d70-588b-82b8-226f2d71012e/component`,
  {
    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>` }
  }
);

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"
  }
}

DELETE/agent/bookings/:booking_id/component/:component_id

Delete One

This endpoint allows you to delete a booking component.

Path Parameters

  • Name
    booking_id
    Type
    UUID
    Description

    The booking ID from which you wish to delete a component.

  • Name
    component_id
    Type
    UUID
    Description

    The component ID that you wish to delete.

Request

DELETE
/agent/bookings/:booking_id/component/:component_id
import axios from 'axios';

const bookingID = '226009ab-ffe9-4c80-922b-982e8e7849f8';
const componentID = '226009ab-ffe9-4c80-922b-982e8e7849f8';

const response = await axios.delete(
  `https://api.felloh.com/agent/bookings/${bookingID}/component/${componentID}`,
  {
    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"
  }
}