# Introduction

## API

Allocate uses hypermedia as the engine of application state. Given initial availability parameters you can follow returned links in response bodies to take a booking to completion.

Every request will return a JSON payload with three top level properties:

```javascript
{
   "head": {},
   "href": "https://...",
   "body": {},
}
```

The `head` property contains related information on other resources (sometimes inlined) you can fetch.&#x20;

`href` is always the location of the fetched resource (for caching)

`body` contains the resource you have requested and can be a deeply nested JSON object.

{% hint style="info" %}
We recommend exploring the API using a tool such as [Insomnia](https://insomnia.rest/) which will let you work through a booking just by clicking the next links at each stage. Try starting with this availability url and clicking through the links you find.

<https://example.allocate.co.uk/api/v2/availability/?date_from=2023-09-03&date_to=2023-09-03&nights=2&stay_occs=3>
{% endhint %}

Explore the methods documented in the pages below

{% content-ref url="api/property-api" %}
[property-api](https://docs.allocate.co.uk/api/property-api)
{% endcontent-ref %}

{% content-ref url="api/booking" %}
[booking](https://docs.allocate.co.uk/api/booking)
{% endcontent-ref %}

## Widget

Allocate has a widget you can install on your existing website which will allow you to take bookings.

{% content-ref url="widget/widget" %}
[widget](https://docs.allocate.co.uk/widget/widget)
{% endcontent-ref %}
