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,"currency": "GBX","email": "james.dean@gmail.com","atol_receipt_number": "233234234","user": {"id": "e8c243ff-d000-4f81-ba57-94184d44dae2","email": "tom@felloh.com"},"components": [{"id": "8224bb6e-7d70-588b-82b8-316f2d71012e","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": "packages","created_at": "2023-02-15T16:00:18.886Z"}],"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}}],"package_type": {"id": "AGENT_OF_ATOL_HOLDER","created_at": "2023-04-04T09:41:12.021Z"},"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).
currencystring
The currency of the booking | see currency documentation
emailstring
The email address of the customer
atol_receipt_numberstring
The ATOL receipt number for the booking.
userobject
The compact user object of the user that created the booking
componentsarray
An array of booking component objects attached to 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
package_typeobject
The package type of that booking.
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,"currency": "GBX","email": "james.dean@gmail.com","atol_receipt_number": "233234234","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}}],"package_type": {"id": "AGENT_OF_ATOL_HOLDER","created_at": "2023-04-04T09:41:12.021Z"},"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
Parameter | Required | Type | Description |
---|---|---|---|
organisation | true | string | The 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. |
keyword | false | string | A customer name, booking reference or email address 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 booking for any of the requested organisations child organisations |
type | fasle | string | Can be 'csv' or 'json', defaults to json |
date_from | false | date | The booking departure date that you want to get bookings from, in ISO 8601 format |
date_to | false | date | The booking departure date that you want to get bookings to, in ISO 8601 format |
booking_reference | fasle | string | Allows 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,"currency": "GBX","email": "james.dean@gmail.com","atol_receipt_number": "233234234","user": {"id": "e8c243ff-d000-4f81-ba57-94184d44dae2","email": "tom@felloh.com"},"components": [{"id": "8224bb6e-7d70-588b-82b8-316f2d71012e","supplier": {"id": "6ab41ce7-36c8-5835-b997-492adb3d66e1","name": "Felloh Travel - Packages","created_at": "2022-06-28T17:27:59.616Z"},"amount": 56300,"booking_reference": "X1232JJ","destination_air": "AMS","type": "packages","created_at": "2023-02-15T16:00:18.886Z"}],"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"}],"package_type": {"id": "AGENT_OF_ATOL_HOLDER","created_at": "2023-04-04T09:41:12.021Z"},"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
Parameter | Required | Type | Description |
---|---|---|---|
booking_ID | true | UUID | The 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,currency: 'GBX',atol_receipt_number: '233234234',package_type: "AGENT_OF_ATOL_HOLDER",}),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
Parameter | Required | Type | Description |
---|---|---|---|
organisation | true | string | The organisation ID that you want to create the booking in. |
customer_name | true | string | The customers full name. |
true | string | The customers email address | |
departure_date | false | date | The date that the booking departs |
return_date | false | date | The date that the booking returns |
gross_amount | false | Integer | The total value of the booking |
currency | false | string | The currency that booking is in, defaults to GBX, see currency documentation for more information. |
atol_receipt_number | false | Integer | The ATOL receipt number for the booking |
package_type | false | String | The package type ID that you want to create the booking in. |
Response
Parameter | Type | Description |
---|---|---|
id | UUID | The 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
Parameter | Required | Type | Description |
---|---|---|---|
booking_ID | true | UUID | The booking id that you wish to delete |
Response
Returns an empty object
Update booking
POST/agent/bookings/226009ab-ffe9-4c80-922b-982e8e7849f8
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}`,data: {gross_value: '2500',},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 booking details
HTTP Method
POST
HTTP Endpoint
PRODhttps://api.felloh.com/agent/bookings/<BOOKING ID>
SANDBOXhttps://sandbox.felloh.com/agent/bookings/<BOOKING ID>
Path Parameters
Parameter | Required | Type | Description |
---|---|---|---|
booking_ID | true | UUID | The booking id that you wish to update |
Payload
Parameter | Required | Type | Description |
---|---|---|---|
gross_value | false | string | The total value of the booking |
departure_date | false | string | The departure date of the booking |
return_date | false | string | The return date of the booking |
customer_name | false | string | The customer name for the booking |
false | string | The customer's email address for the booking | |
package_type | false | string | The package type of the booking |
atol_receipt_number | false | string | The atol receipt number of the booking |
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
Parameter | Required | Type | Description |
---|---|---|---|
booking_ID | true | UUID | The booking id that you wish to update |
Payload
Parameter | Required | Type | Description |
---|---|---|---|
booking_reference | true | string | The new booking reference for the booking |
Response
Returns an empty object