Skip to content

Book for Work API (1.0.0)

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.

Download OpenAPI description
Overview
Languages
Servers
https://api-docs.bookforwork.com/api/v1
BFW API Production server
https://bookforwork.com
BFW API Staging server
https://staging.bookforwork.com
Operations
Operations
Operations

Request

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.

Query
option_idstring(Option Id)required

Option Id needed for this price check request. Type: String, Example: '75731f0a2be62d7ffd64f4ec41a96793a918bc4003bedf17c44fcf823e80fd29'.

Headers
authorizationstring(Authorization)required

Authorization header with HMAC signature. Format: API-Key={key},Signature={hmac_signature},Timestamp={unix_timestamp}

curl -i -X GET \
  'https://api-docs.bookforwork.com/api/v1/price-check?option_id=string' \
  -H 'authorization: API-Key=a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6q7r8s9t0,Signature=d8e3f4a5b6c7d8e9f0a1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6e7f8a9b0c1d2e3,Timestamp=1234567890'

Responses

Successful Price Check for bookings

Bodyapplication/json
statusstring(PriceCheckStatus)required

Status after the price check.

Enum"AVAILABLE""NOT AVAILABLE""PRICE CHANGE""POLICY CHANGE"
pricePrice (object) or null

In case of price change the new pricing information.

Any of:

In case of price change the new pricing information.

booking_idBooking Id (string) or Booking Id (null)(Booking Id)

Booking id which is used as option id to make booking request.

Any of:

Booking id which is used as option id to make booking request.

string(Booking Id)
Response
application/json
{ "status": "AVAILABLE", "price": { "currency": "EUR", "net": "358.25", "sales_taxes": "0.00", "taxes": "57.10", "without_tax": "301.15" }, "booking_id": "41db9a7889ffac6b771de3141f2f923c9f655bbab0e415ead9a464e519edf5c0" }

Request

Creates a new booking for a specific availability search. This endpoint requires the Option ID returned by the price check endpoint.

Query
option_idstring(Option Id)required

Option Id returned by the price check endpoint needed for the booking request. Type: String, Example: '75731f0a2be62d7ffd64f4ec41a96793a918bc4003bedf17c44fcf823e80fd29'.

Headers
authorizationstring(Authorization)required

Authorization header with HMAC signature. Format: API-Key={key},Signature={hmac_signature},Timestamp={unix_timestamp}

Bodyapplication/jsonrequired
room_detailArray of objects(Room Detail)required

List of rooms with guest details.

room_detail[].​lead_first_namestring(Lead First Name)required

Lead guest first name. Type - String.

room_detail[].​lead_last_namestring(Lead Last Name)required

Lead guest last name. Type - String.

room_detail[].​notesNotes (string) or Notes (null)(Notes)

Any special requests or notes for the room. Type - String.

Any of:

Any special requests or notes for the room. Type - String.

string(Notes)
phone_number_prefixstring(Phone Number Prefix)required

Phone number prefix. Type - String.

phone_numberstring(Phone Number)required

Guest phone number. Type - String.

emailEmail (string) or Email (null)(Email)

Guest email address. Type - String.

Any of:

Guest email address. Type - String.

string(email)(Email)
custom_fieldsCustomFieldCorrespondence (string) or Custom Fields (object)(Custom Fields)

Dynamic custom fields can be added up to 10 fields in type string. These fields can be added for reconciliation purposes and they will be added to the invoices (ex. Order Number: 37484).

Any of:

Dynamic custom fields can be added up to 10 fields in type string. These fields can be added for reconciliation purposes and they will be added to the invoices (ex. Order Number: 37484).

string(CustomFieldCorrespondence)
Enum"custom_field_1""custom_field_2""custom_field_3""custom_field_4""custom_field_5""custom_field_6""custom_field_7""custom_field_8""custom_field_9""custom_field_10"
curl -i -X POST \
  'https://api-docs.bookforwork.com/api/v1/booking?option_id=string' \
  -H 'Content-Type: application/json' \
  -H 'authorization: API-Key=a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6q7r8s9t0,Signature=d8e3f4a5b6c7d8e9f0a1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6e7f8a9b0c1d2e3,Timestamp=1234567890' \
  -d '{
    "room_detail": [
      {
        "lead_first_name": "Francesca",
        "lead_last_name": "Mario",
        "notes": "Top floor or away from street."
      }
    ],
    "phone_number_prefix": "0039",
    "phone_number": "3632323278",
    "email": "francesca.mario@gmail.com",
    "custom_fields": {
      "custom_field_1": "value 1",
      "custom_field_2": "value 2"
    }
  }'

Responses

Create a new booking

Bodyapplication/json
statusstring(BookStatus)required

Status of the booking

Enum"PROCESSING""WAITING_CONFIRMATION""CONFIRMED""NOT_CONFIRMED""PENDING""CANCELLED"
booking_idinteger(Booking Id)required

Booking Id

Response
application/json
{ "status": "PROCESSING", "booking_id": "626" }
Operations