SimplyBook Company Creation API Documentation


Get Auth Token

This API endpoint is used to generate an authentication token and refresh token for accessing Simplybook API endpoints. The token is valid for a specific period of time and can be used to make authenticated API requests.

POST /simplybook/auth/token

HEADER

  • Content-Type: application/json

BODY



Get Auth Token by Refresh Token

This API endpoint is used to refresh an existing authentication token. A refresh token is a long-lived token that can be used to obtain a new access token when the current one expires.

POST /simplybook/auth/refresh-token

HEADER

  • Content-Type: application/json



Register a Company

This API endpoint is used to create a new company in Simplybook. The company will be associated with the user who makes the request and will have the specified details.

categories is an array or int value of the category ID of the company. The category ID is used to group companies by type. If you don't pass categories "Other category" wil be applied. The following category IDs are available:

Category ID Category Name
3 Beauty and wellness
43 Sport and fitness
5 Personal meetings and services
1 Medical
4 Events and entertainment
6 Education
75 Retailers
7 Officials
8 Other category

callback_url*: This is the URL where the company creation status will be sent. The status will be sent as a POST request with the following parameters:
  • success: true if the company was created successfully, false otherwise
  • company_id: The ID of the company that was created
  • company_login: The login of the company that was created
  • error: object containing the error details if the company creation failed
  • error[message] The error message if the company creation failed

Lang is the language of the company. If you don't pass English will be applied. Allowed values are:
  • en - English
  • zh - Chinese
  • fr - French
  • cn - Chinese (Simplified)
  • es - Spanish
  • ko - Korean
  • de - German
  • ja - Japanese
  • ru - Russian
  • pt - Portuguese
  • br - Portuguese (Brazil)
  • it - Italian
  • nl - Dutch
  • uk - Ukrainian

company_login* is the login of the company. It`s unique and will be used to access the company's booking page and widget.
name is the name of the company. This will be displayed on the company's booking page and in the widget.
email* are the email address of the company and admin user. The admin user will have full access to the company's settings and resources.
phone is the phone number of the company. Please note that the phone number should be in the international format (e.g. +1234567890).
country_id is the ISO 3166-1 alpha-2 country code of the company's location.
description is the description of the company. This will be displayed on the company's booking page.
city is the city where the company is located.
address1 is the address of the company.
zip is the ZIP code of the company's location.
lat and lng are the latitude and longitude coordinates of the company's location.
timezone is the timezone of the company. This will be used to display the correct time in the booking page and widget.
password and retype_password are the password and confirmation password for the admin user.
widget_notification_url is the URL where the notification URLs will come to in emails (for cancel booking, edit bookings, etc).
journey_type is the type of the journey (welcome tour). Optional.
marketing_consent is a boolean indicating if the company consents to marketing communications. Default value is false.

Required fields are marked with *

POST /simplybook/company

HEADER

  • Content-Type: application/json
  • X-Token: {{token}}


Confirm Company Registration

This API endpoint is used to confirm the registration of a company. The company will be created in Simplybook and the user will receive a confirmation email with the login details.



company_login* is the login of the company from the registration request.
confirmation_code* is the confirmation code sent to the user's email.
recaptcha* is the reCAPTCHA token generated by the reCAPTCHA widget.
To get the reCAPTCHA token, you need to add the reCAPTCHA widget to your page.

<script src="https://www.google.com/recaptcha/api.js?onload=onloadRecaptchaCallback&render=explicit" async defer> </script>

<div id="recaptcha_container"></div>

<script>
    function onloadRecaptchaCallback() {
        grecaptcha.render('recaptcha_container', {
            'sitekey': 'site_key_received_from_company_creation_response',
            'callback': function (token) {
                console.log(token); //here is your token
            }
        });
    }
</script>
                    

POST /simplybook/company/confirm

HEADER

  • Content-Type: application/json


Get Company Categories

This API endpoint returns a list of categories available for the company.

GET /simplybook/company/categories

HEADER

  • X-Token: {{token}}


Get Countries

This API endpoint returns a list of countries available for the company.

GET /simplybook/company/countries

HEADER

  • X-Token: {{token}}


Enable Plugin

This API endpoint enables a plugin for the company.

POST /simplybook/company/{{company}}/plugin/{{plugin}}/enable

HEADER

  • X-Token: {{token}}


Disable Plugin

This API endpoint disables a plugin for the company.

POST /simplybook/company/{{company}}/plugin/{{plugin}}/disable

HEADER

  • X-Token: {{token}}