Menu

Bedful Bookings

Bookings represent the record of a guest unit hire or holiday. Each booking is associated with one site, and one or more units. They may also be associated with extras the customer chose on booking. Bookings record how many people are staying, how long for, the ages of children, and various other details required in order to specify completely the holiday. They may be updated or cancelled after creation but never deleted.

Booking Status

The possible public values for booking status are detailed below:

  • 0 – None
  • 1 – Incomplete (does not block availability)
  • 10 – Provisional (blocks availability, but not confirmed)
  • 11 – Cancelled (does not block availability)
  • 12 – Unavailable (blocks availability)
  • 13 – Failed (does not block availability)
  • 100 - Confirmed (blocks availability)

Get Booking

Use GET /bookings/:id to fetch information on one site.

curl https://devapi.bedful.com/bookings/1 \
-u BEDFUL_KEY: 

Parameters available

  • id : specified in the url

This will return JSON like this for the matched record, or a 404 error if no record is found for the given id.

{
  "id": 3175464,
  "parent_id": 0,
  "group_kind": 0,
  "unit_parent_kind": 566,
  "child_count": 0,
  "site_id": 127,
  "user_id": 3,
  "channel_id": 0,
  "status": 100,
  "created_at": "2019-09-11T13:49:32Z",
  "updated_at": "2020-01-15T13:13:47Z",
  "starts_at": "2019-09-16T00:00:00Z",
  "ends_at": "2019-09-19T00:00:00Z",
  "expires_at": "0001-01-01T00:00:00Z",
  "name": "Test Dev",
  "email": "devs@bedful.com",
  "telephone": "07333963369",
  "address": "20a beehive road",
  "postal_code": "DEV D3L",
  "country": "United Kingdom",
  "adults":  2,
  "children":  0,
  "ages":  "40, 40",
  "paid":  0,
  "price":  2700,
  "units_price":  2700,
  "extras_price":  0,
  "discount_amount":  0,
  "security_deposit_amount": 0,
  "booking_guarantee": 0,
  "summary": "Filly Fields Glamping - 2 Adults  Sep 22, 2019-Sep 25, 2019",
  "campsite_reference": "",
  "marketing_subscribe":  0,
  "currency_id": 1,
  "currency_rate": 1,
  "currency": {
     "id":  1,
     "rate": 1
  },
  "site": {
     "id":  127
  },
  "items": [
  ],
  "units": [
  ],
  "extras": [
  ],
  "user": {
     "id":  3
  },
  "channel": {
     "id":  0
  },
  "integration": {
     "id":  0
  }
}

Booking Fields

  • ID: The unique id of the booking
  • ParentID: The id of the parent booking (if any)
  • GroupKind: Internal use
  • UnitParentKind: Internal use
  • ChildCount: The count of children on the booking
  • SiteID: The site
  • UserID: The user
  • ChannelID: The channel booked
  • Status: The status of the booking – see Booking Status
  • CreatedAt: Creation Date/Confirmed Date
  • UpdatedAt: Last Updated at date
  • StartsAt: Arrival date (0 hours on arrival day)
  • EndsAt: Departure date (0 hours on departure day)
  • ExpiresAt: Internal Use
  • Name: The name of the guest
  • Email: The email of the guest
  • Telephone: The telephone of the ugest
  • Address: The address of the guest (optional)
  • PostalCode: The postal code of the guest (optional)
  • Country: The
  • Adults: The number of adults
  • Children: The number of children
  • Ages: Ages of all children
  • Paid: The price paid at this time in cents
  • Price: The total price in cents
  • UnitsPrice: The price of units in cents
  • ExtrasPrice: The price of extras in cents
  • DiscountAmount: The discount in cents (if any)
  • SecurityDepositAmount: The security deposit in cents (if any)
  • BookingGuarantee: Internal Use
  • Summary: A text description of the booking
  • Currency: The currency for prices
  • CurrencyRate: The rate for conversion of prices to GBP
  • Site, Units, Extras etc: The associated records of the booking (may be expanded)

Get Bookings

Use GET /bookings to fetch information on more than one site.

curl https://devapi.bedful.com/bookings \
-u BEDFUL_KEY: 
Parameters available
  • id: restrict on booking id
  • user_id: restrict on user
  • site_id: restrict on site
  • status: restrict on status
  • limit: limit results defaults to 500

This will return JSON like this for the matched records, or an empty list if no records are found.

 {
  "bookings": [{
  "id": 3175464,
  "parent_id": 0,
  "group_kind": 0,
  "unit_parent_kind": 566,
  "child_count": 0,
  "site_id": 127,
  "user_id": 3,
  "channel_id": 1,
  "status": 100,
  "created_at": "2019-09-11T13:49:32Z",
  "updated_at": "2020-01-15T13:13:47Z",
  "starts_at": "2019-09-16T00:00:00Z",
  "ends_at": "2019-09-19T00:00:00Z",
  "expires_at": "0001-01-01T00:00:00Z",
  "name": "Test Dev",
  "email": "devs@bedful.com",
  "telephone": "07333963369",
  "address": "20a beehive road",
  "postal_code": "DEV D3L",
  "country": "United Kingdom",
  "adults":  2,
  "children":  0,
  "ages":  "40, 40",
  "paid":  0,
  "price":  2700,
  "units_price":  2700,
  "extras_price":  0,
  "discount_amount":  0,
  "commission":  0,
  "commission_net":  0,
  "fees":  0,
  "security_deposit_amount": 0,
  "booking_guarantee": 0,
  "summary": "Filly Fields Glamping - 2 Adults  Sep 22, 2019-Sep 25, 2019",
  "campsite_reference": "",
  "marketing_subscribe":  0,
  "currency_id": 1,
  "currency_rate": 1,
  "currency": {
     "id":  1,
     "rate": 1
  },
  "site": {
     "id":  127
  },
  "items": [{
    "id":  4276051,
    "unit_id":  13,
    "booking_id":  3175464,
    "accommodation_price":  0,
    "people_price":  0,
    "rates":  "",
    "ages": "40, 40"}
  ],
  "units": [{
    "id":  13,
    "name": "Bell Tent"}
  ],
  "extras": [
  ],
  "user": {
     "id":  3
  },
  "channel": {
     "id":  1
  },
  "integration": {
     "id":  0
  }
 }]
}

Updating Bookings

Use POST /bookings/:id/update to post changes to bookings.
curl https://devapi.bedful.com/bookings/BOOKING_ID/update \
-u API_KEY: \
--data '{"name": "User Name"}'

This will return the full bookings json as in the show action above.

Cancelling Bookings

To cancel a booking, post an update with status 11. You can see a full list of acceptable statuses for bookings below.

Creating a Booking

Use POST /bookings to create a new booking on your channel.

curl https://devapi.bedful.com/bookings/create \
-u API_KEY: \
-H "Content-Type: application/json" \
--data '{"name": "User Name","site_id": 133,"starts_at": "2018-10-25T00:00:00Z", "ends_at": "2018-10-29T00:00:00Z", "units": [1579]}'

On success, this will return the full booking json as in GET booking above.

Unavailable Periods

Unavailable periods are represented on Bedful as bookings with status 12. If you have a separate concept of unavailable periods you should create them as bookings on the bedful side using Booking Events.