Documentation

Comprehensive guides and API documentation to help you build with our platform.

Introduction

Welcome to the BookingPro API documentation. Our API is organized around REST and uses standard HTTP response codes, authentication, and verbs. The API has predictable resource-oriented URLs, accepts form-encoded request bodies, returns JSON-encoded responses, and uses standard HTTP response codes, authentication, and verbs.

Base URL

https://api.bookingpro.com/v1

Making Requests

All API requests must include your API key in the Authorization header:

                            GET /bookings HTTP/1.1
                            Host: api.bookingpro.com
                            Authorization: Bearer YOUR_API_KEY
                            Accept: application/json
                        

Authentication

Authenticate your account when using the API by including your secret API key in the request. You can manage your API keys in the API settings section of your account.

Keep your API keys secure

Your API keys carry many privileges, so be sure to keep them secure! Do not share your secret API keys in publicly accessible areas such as GitHub, client-side code, and so forth.

Rate Limiting

To prevent abuse and ensure fair usage, we implement rate limiting on our API. The current rate limits are:

  • Free plan: 100 requests per minute
  • Pro plan: 1,000 requests per minute
  • Business plan: 10,000 requests per minute

If you exceed these limits, you'll receive a 429 Too Many Requests response. We also implement a maximum request size of 1MB for API requests.

Bookings API

Create, retrieve, update, and delete bookings programmatically.

Create a Booking

                            POST /bookings HTTP/1.1
                            Content-Type: application/json
                            Authorization: Bearer YOUR_API_KEY
                            
                            {
                                "service_id": "svc_123",
                                "start_time": "2023-06-15T14:00:00Z",
                                "customer": {
                                    "name": "John Doe",
                                    "email": "john@example.com",
                                    "phone": "+1234567890"
                                },
                                "custom_fields": {
                                    "notes": "Please call on arrival"
                                }
                            }
                        

Response

                            {
                                "id": "book_xyz",
                                "status": "confirmed",
                                "start_time": "2023-06-15T14:00:00Z",
                                "end_time": "2023-06-15T15:00:00Z",
                                "service": {
                                    "id": "svc_123",
                                    "name": "Haircut & Styling",
                                    "duration": 60,
                                    "price": {
                                        "amount": 5000,
                                        "currency": "USD"
                                    }
                                },
                                "customer": {
                                    "name": "John Doe",
                                    "email": "john@example.com",
                                    "phone": "+1234567890"
                                },
                                "created_at": "2023-05-20T10:30:00Z",
                                "updated_at": "2023-05-20T10:30:00Z"
                            }
                        

Webhooks

Webhooks allow you to receive real-time notifications about events in your BookingPro account. You can configure webhook endpoints in your account settings.

Available Events

  • booking.created - A new booking was created
  • booking.updated - A booking was updated
  • booking.cancelled - A booking was cancelled
  • booking.confirmed - A booking was confirmed

Example Webhook Payload

                            {
                                "event": "booking.created",
                                "created": "2023-05-20T10:30:00Z",
                                "data": {
                                    "id": "book_xyz",
                                    "status": "confirmed",
                                    "start_time": "2023-06-15T14:00:00Z",
                                    "end_time": "2023-06-15T15:00:00Z",
                                    "service": {
                                        "id": "svc_123",
                                        "name": "Haircut & Styling"
                                    },
                                    "customer": {
                                        "name": "John Doe",
                                        "email": "john@example.com"
                                    }
                                }
                            }
                        

Embedding the Booking Widget

You can easily embed our booking widget on your website with just a few lines of code.

Basic Embed

                            <!-- Add this to your HTML -->
                            <div id="booking-widget" data-account="YOUR_ACCOUNT_ID"></div>
                            <script src="https://cdn.bookingpro.com/widget.js" async></script>
                        

Customizing the Widget

You can customize the appearance and behavior of the widget using data attributes:

                            <div 
                                id="booking-widget"
                                data-account="YOUR_ACCOUNT_ID"
                                data-service="svc_123" <!-- Pre-select a service -->
                                data-button-text="Book Now"
                                data-button-color="#4f46e5"
                                data-button-text-color="#ffffff"
                                data-locale="en"
                            ></div>