RESOURCES > UNITS
Bedful Units
Units represent places to stay or drive on the Bedful system - for example pitches, rooms, campervans. Each booking will have at least one unit. Units belong to one site, and a site may have many units. Units also belong to one group - this is used to group units together in sets with similar attributes.
Get Unit
Use GET /unit/:id
to fetch information on one unit.
curl https://devapi.bedful.com/units/1 \
-u BEDFUL_KEY:
Parameters available
- id : specified in the url
- expand: set to true to see subsidiary records
This will return JSON like this for the matched record, or a 404 error if no record is found for the given id.
{
"id": 60,
"status": 100,
"site_id": 127,
"group_id": 1981,
"name": "Riverside Tipi",
"number": 1,
"kind": 47,
"kind_parent": 566,
"summary": "A tipi sleeping a maximum of 6",
"text": "<p>The tipi comes complete with a double bed",
"min_people": 1,
"max_people": 6,
"min_adults": 1,
"max_adults": 6,
"min_children": 0,
"max_children": 5,
"min_age": 3,
"max_age": 0,
"inc_people": 2,
"group": {
"id": 1981,
"status": 100,
"name": "Tipis",
"availability": 2,
"site_id": 127,
"summary": "Tipis for two"
},
"price": 0,
"from_price": 0,
"currency_id": 1,
"currency_rate": 1,
"security_deposit_amount": 0,
"unit_type": "Tipi",
"canonical_url": "/campsites/uk/england/127-filly-fields/units/60-riverside-tipi",
"extra_nights": 0,
"images": [{
"id": 294885,
"hash": "bfac439400a6289dc20a321e93e99a74985d525a"
}],
"extras": []
}
Unit Fields
- ID: The unique id of the unit
- Status: The status of the unit (0 is draft, 11 Suspended, 100 Live)
- SiteID: The site for this unit
- GroupID: The group for this unit
- Name: The name of this unit
- Number: The public number of this unit
- Kind: The kind of this unit (e.g. tipi - based on tags)
- KindParent: The parent kind of this unit (e.g. glamping - based on tags)
- Summary: A one-sentence description of the unit
- Text: The full description of the unit (may contain HTML)
- MinPeople: The minimum people allowed for this unit (0 means none)
- MaxPeople: The maximum people allowed for this unit (0 means none)
- MinAdults: The maximum adults allowed for this unit (0 means none)
- MaxAdults: The maximum adults allowed for this unit (0 means none)
- MinChildren: The maximum children allowed for this unit (0 means none)
- MaxChildren: The maximum children allowed for this unit (0 means none)
- MinAge: The minimum age for people staying in this unit (0 means none)
- MaxAge: The maximum age for people staying in this unit (0 means none)
- IncludedPeople: The people included in the price of this unit
- Group: The group associated with this unit
- Price: The price for the given stay (avail searches only)
- FromPrice: The price for 2 adults (avail searches only)
- CurrencyID: The currency this unit is priced in
- CurrencyRate: The rate converting from GBP for this currency
- SecurityDepositAmount: The amount for the security deposit on this unit (if any)
- UnitType: A string representation of Kind
- CanonicalURL: The URL used to address this units on sales channels like Cool Camping
- ExtraNights: Internal (avail searches only)
- Images: Images associated with this unit
- Extras: Extras associated with this unit option (avail searches only)
Get Units
Use GET /units
to fetch information on more than one unit.
curl https://devapi.bedful.com/units \
-u BEDFUL_KEY:
Parameters available
All dates are UTC. Acceptable formats for date params are either in RFC3339 (JSON date format) or 2020-01-01.
- site_id: units available for a site REQUIRED
- starts_at: the UTC start date for an avail search
- ends_at: the UTC end date for an avail search
This will return JSON like this for the matched records, or an empty list if no records are found.
{
"units": [{
"id": 18078,
"status": 100,
"site_id": 127,
"group_id": 1996,
"name": "Country Farm Cottage",
"number": 20,
"kind": 579,
"kind_parent": 9,
"summary": "Stunning 17th century farmhouse sleeping up to 10 guests",
"text": "This historic house comes complete with all mod-cons including a wood-fired hut tub",
"min_people": 1,
"max_people": 10,
"min_adults": 0,
"max_adults": 8,
"min_children": 0,
"max_children": 7,
"min_age": 0,
"max_age": 0,
"inc_people": 10,
"group": {
"id": 1996,
"status": 0,
"name": "Cottages",
"availability": 2,
"site_id": 127,
"summary": ""
},
"price": 0,
"from_price": 0,
"currency_id": 1,
"currency_rate": 1,
"security_deposit_amount": 10000,
"unit_type": "Cottage",
"canonical_url": "/campsites/uk/england/127-filly-fields/units/18078-country-farm-cottage",
"extra_nights": 0,
"images": [{
"id": 297144,
"hash": "979b12a596cef639dae0996a9589f6549f6ca2cf"
},{
"id": 297145,
"hash": "33313c05bb9347e8680a02607db4771760ea9320"
}
], "extras": []
}]
}