# Book for Work API


Welcome to Book for Work API! Before reading the documentation please
make sure you read the tab Getting Started.

## Authentication

All endpoints require HMAC-SHA256 signature authentication via
the `Authorization` header:

**Format**: `Authorization: API-Key={key},Signature={hmac_signature},
Timestamp={unix_timestamp}`

**Steps to generate signature**:
1. Generate the current Unix timestamp (UTC, seconds).
2. Create the signing message by concatenating the following values
   **in this exact order with no separators**:
   ```
   {api_key}{secret}{timestamp}
   ```
3. Generate an HMAC-SHA256 signature using the API secret as the HMAC key.
4. Encode the signature as a hexadecimal string.
5. Include the API key, signature, and timestamp in the `Authorization` header.

Requests are rejected if the timestamp differs from the server time
by more than 5 minutes.



Version: 1.0.0

## Servers

```
/api/v1
```

BFW API Production server
```
https://bookforwork.com
```

BFW API Staging server
```
https://staging.bookforwork.com
```

## Download OpenAPI description

[Book for Work API](https://api-docs.bookforwork.com/_bundle/openapi.yaml)

## Availability

### Search Property Availability

 - [GET /properties/availability](https://api-docs.bookforwork.com/openapi/availability/get_availability_properties_availability_get.md): Search for available rooms across multiple properties.

## Content

### Get Properties List by Country

 - [GET /properties/content/](https://api-docs.bookforwork.com/openapi/content/get_hotels_properties_content__get.md): Retrieve paginated list of active properties filtered by country code. 

Pagination: Page size is fixed at 200 items per page. The total field in response represents the total number of properties (not pages). To calculate the number of pages, use: total_pages = total / page_size.

### Get Property Details by ID

 - [GET /properties/content/{hotel_id}](https://api-docs.bookforwork.com/openapi/content/get_hotel_detail_properties_content__hotel_id__get.md): Retrieve complete property information by ID. Returns all hotel details including descriptions, images, themes, attributes, amenities, and rooms.

### Static Content Reference List

 - [GET /static_content_reference_list](https://api-docs.bookforwork.com/openapi/content/static_content_endpoint_static_content_reference_list_get.md): Retrieves the list of static content reference in English or Italian language.

## Booking

### Price Check for bookings

 - [GET /price-check](https://api-docs.bookforwork.com/openapi/booking/get_price_check_price_check_get.md): Price check for a specific availability search by its Option ID. Option ID should be chosen among Room IDs returned by the search endpoint inside Room objects. If there is a price change status you will see the change in the pricing and null otherwise.

### Create a new booking

 - [POST /booking](https://api-docs.bookforwork.com/openapi/booking/booking_endpoint_booking_post.md): Creates a new booking for a specific availability search. This endpoint requires the Option ID returned by the price check endpoint.

## Manage Booking

### Cancel Booking

 - [DELETE /cancel](https://api-docs.bookforwork.com/openapi/manage-booking/booking_cancelation_endpoint_cancel_delete.md): Cancels a specific booking by its Booking Id.

### Retrieve Booking Details

 - [GET /retrieve](https://api-docs.bookforwork.com/openapi/manage-booking/booking_retrieval_endpoint_retrieve_get.md): Retrieves the details of a specific booking by its Booking Id.

