### Example Webhook Payload - JSON Source: https://external.api.portal.bokadirekt.se/swagger/v1/swagger This is an example JSON payload for a webhook notification from the BokaDirekt API. It includes details about the booking, location, staff, customer, and the event that triggered the notification. This payload structure is sent to the configured callback URL upon event occurrence. ```json { "Id": "00000000-0000-0000-0000-000000000000", "LocationId": "00000000-0000-0000-0000-000000000000", "LocationName": "Test salon", "PersonId": "00000000-0000-0000-0000-000000000000", "PersonName": "Test person", "ServiceId": "00000000-0000-0000-0000-000000000000", "ServiceName": "Test service", "BookingPrice": 100.0, "BookingStartDate": "2025-01-01T09:00:00+01:00", "BookingEndDate": "2025-01-01T10:00:00+01:00", "Customer": { "Id": "00000000-0000-0000-0000-000000000000", "MobilePhoneNumber": "+46000000000", "PhoneNumber": "+46000000000", "FirstName": "Test", "LastName": "Customer", "EmailAdress": "test@test.se", "NewCustomer": false }, "EventCreated": "2025-01-01T08:00:00+00:00", "BookedOnline": true, "Cancelled": false, "NewCustomer": false, "GclId": null, "Referer": "bokadirekt.se" } ``` -------------------------------- ### GET /api/v1/products Source: https://external.api.portal.bokadirekt.se/swagger/v1/swagger Retrieves a list of all products associated with a salon. This endpoint provides comprehensive product details, including IDs, names, and supplier information. ```APIDOC ## GET /api/v1/products ### Description The GetProducts endpoint retrieves all products associated with a salon. It returns detailed product information, including product ID, product name, supplier ID, and supplier name. ### Method GET ### Endpoint /api/v1/products ### Parameters #### Query Parameters (No query parameters defined) #### Request Body (No request body defined) ### Request Example (No request example provided) ### Response #### Success Response (200) - **array of ProductViewModel** - An array containing product details. #### Response Example ```json [ { "productId": "string", "productName": "string", "supplierId": "string", "supplierName": "string" } ] ``` #### Error Response (429) - **string** - Indicates too many requests. #### Error Response Example ``` Too Many Requests ``` ``` -------------------------------- ### GET /api/v1/customers Source: https://external.api.portal.bokadirekt.se/swagger/v1/swagger Retrieves all customers associated with a salon, returning detailed customer information. ```APIDOC ## GET /api/v1/customers ### Description Retrieves all customers associated with a salon. It returns detailed customer information, including contact details, preferences, categories, and address data. ### Method GET ### Endpoint /api/v1/customers ### Parameters *No parameters are documented for this endpoint.* ### Response #### Success Response (200) - **customers** (array) - An array of customer objects. #### Response Example ```json [ { "customerId": "string", "firstName": "string", "lastName": "string", "email": "string", "phone": "string", "address": { "street": "string", "city": "string", "postalCode": "string", "country": "string" }, "preferences": { "notes": "string", "preferredContactMethod": "string" }, "categories": [ "string" ] } ] ``` #### Error Response (429) - **message** (string) - Error message indicating too many requests. ``` -------------------------------- ### GET /api/v1/resources Source: https://external.api.portal.bokadirekt.se/swagger/v1/swagger Retrieves a list of all resources (staff) associated with a salon. The endpoint allows filtering by a date range and returns details about availability, occupancy, and booking status. ```APIDOC ## GET /api/v1/resources ### Description The GetResources endpoint retrieves all resources (staff) associated with a salon within a specified date range, defaulting to the last 30 days if no range is provided. It returns detailed resource information, including availability, occupancy, nicknames, online booking status, and pricing details. ### Method GET ### Endpoint /api/v1/resources ### Parameters #### Query Parameters - **StartDate** (string) - Optional - Start date to filter bookings (format: date-time). - **EndDate** (string) - Optional - End date to filter bookings (format: date-time). #### Request Body (No request body defined) ### Request Example (No request example provided) ### Response #### Success Response (200) - **array of ResourceViewModel** - An array containing resource details. #### Response Example ```json [ { "resourceId": "string", "resourceName": "string", "resourceNickname": "string", "availability": { "availableDates": [ { "date": "string", "availableSlots": [ { "startTime": "string", "endTime": "string" } ] } ] }, "isOnlineBookingEnabled": true, "price": 0.0 } ] ``` #### Error Response (429) - **string** - Indicates too many requests. #### Error Response Example ``` Too Many Requests ``` ``` -------------------------------- ### GET /api/v1/bookings Source: https://external.api.portal.bokadirekt.se/swagger/v1/swagger Retrieves all bookings associated with a salon within a specified date range. Defaults to the past 30 days if no range is provided. ```APIDOC ## GET /api/v1/bookings ### Description Retrieves all bookings associated with a salon within a specified date range. If no date range is provided, the endpoint defaults to returning bookings from the past 30 days. ### Method GET ### Endpoint /api/v1/bookings ### Parameters #### Query Parameters - **FilterOnStartDate** (boolean) - Optional - Indicates whether bookings should be filtered based on their scheduled start date instead of their creation date. Defaults to **false**. - **StartDate** (string) - Optional - Start date to filter bookings (format: date-time). - **EndDate** (string) - Optional - End date to filter bookings (format: date-time). ### Response #### Success Response (200) - **bookings** (array) - An array of booking objects. #### Response Example ```json [ { "bookingId": "string", "salonId": "string", "customerId": "string", "staffId": "string", "serviceId": "string", "resourceId": "string", "bookingStatus": "string", "creationDate": "string", "startDate": "string", "endDate": "string", "notes": "string", "price": 0.0, "currency": "string", "customer": { "customerId": "string", "firstName": "string", "lastName": "string", "email": "string", "phone": "string" }, "staff": { "staffId": "string", "firstName": "string", "lastName": "string", "email": "string", "phone": "string" }, "service": { "serviceId": "string", "name": "string", "durationMinutes": 0, "price": 0.0, "currency": "string" } } ] ``` #### Error Response (429) - **message** (string) - Error message indicating too many requests. ``` -------------------------------- ### ProductViewModel Schema Source: https://external.api.portal.bokadirekt.se/swagger/v1/swagger Defines the structure for product information. ```APIDOC ## ProductViewModel Schema ### Description This schema represents a product available in the system, including its identifier, name, and supplier details. ### Parameters #### Request Body - **productId** (string) - Required - Unique identifier of the product. (format: uuid) - **productName** (string) - Optional - Name of the product. - **supplierId** (string) - Required - Unique identifier of the product's supplier. (format: uuid) - **supplierName** (string) - Optional - Name of the supplier providing the product. ### Request Example ```json { "productId": "a1b2c3d4-e5f6-7890-1234-567890abcdef", "productName": "Standard Haircut", "supplierId": "f0e9d8c7-b6a5-4321-fedc-ba9876543210", "supplierName": "Stylish Salon" } ``` ### Response #### Success Response (200) This schema does not define a success response, it's part of a larger request body. #### Response Example N/A ``` -------------------------------- ### GetServices Source: https://external.api.portal.bokadirekt.se/swagger/v1/swagger Retrieves all services associated with a salon. Returns detailed service information, including service ID, add-on status, and service name, grouped and ordered by service name. ```APIDOC ## GET /api/v1/services ### Description Retrieves all services associated with a salon. It returns detailed service information, including service ID, add-on status, and service name, grouped and ordered by service name. ### Method GET ### Endpoint /api/v1/services ### Response #### Success Response (200) - **ServiceViewModel** (array) - Detailed information for each service. #### Response Example ```json [ { "serviceId": "string", "isAddon": true, "serviceName": "string" } ] ``` #### Error Response (429) - **string** - Indicates too many requests. ``` -------------------------------- ### ResourceViewModel Schema Source: https://external.api.portal.bokadirekt.se/swagger/v1/swagger Defines the structure for resource information, including salon details, booking availability, and associated prices. ```APIDOC ## ResourceViewModel Schema ### Description This schema represents a resource within a salon, detailing its identification, availability status for online booking, and pricing information. ### Parameters #### Request Body - **salonId** (string) - Required - Unique identifier of the salon the resource is associated with. (format: uuid) - **salonName** (string) - Optional - Name of the salon. - **resourceId** (string) - Required - Unique identifier of the resource. (format: uuid) - **resourceName** (string) - Optional - Full name of the resource. - **resourceNickName** (string) - Optional - Optional nickname of the resource. - **finishDate** (string) - Optional - The date when the resource stopped being available, if applicable. (format: date-time) - **bookableOnline** (boolean) - Required - Indicates whether the resource is available for online booking. - **onlineTitle** (string) - Optional - Title or label shown to customers during online booking. - **availabilities** (array) - Optional - List of availability details for the resource within the specified date range. (items: ResourceAvailabilityViewModel) - **priceListName** (string) - Optional - Name of the price list associated with the resource. ### Request Example ```json { "salonId": "a1b2c3d4-e5f6-7890-1234-567890abcdef", "salonName": "Cool Cuts", "resourceId": "f0e9d8c7-b6a5-4321-fedc-ba9876543210", "resourceName": "Alice Smith", "resourceNickName": "Alice", "finishDate": null, "bookableOnline": true, "onlineTitle": "Haircut with Alice", "availabilities": [ { "date": "2023-10-27T10:00:00Z", "bookableMinutes": 480, "bookedMinutes": 120, "absenceMinutes": 0, "lunchMinutes": 30, "attendanceMinutes": 450 } ], "priceListName": "Standard Prices" } ``` ### Response #### Success Response (200) This schema does not define a success response, it's part of a larger request body. #### Response Example N/A ``` -------------------------------- ### Authentication Source: https://external.api.portal.bokadirekt.se/swagger/v1/swagger All requests to the Bokadirekt API must be authenticated using an API key. Include your API key in the `X-API-KEY` header for every request. ```APIDOC ## Authentication ### Description Access to this API requires authentication using an API key. Include your API key in all requests by setting the `X-API-KEY` header. ### Method N/A (Applies to all requests) ### Endpoint N/A (Applies to all endpoints) ### Headers - **X-API-KEY** (string) - Required - Your unique API key. ``` -------------------------------- ### ServiceViewModel Source: https://external.api.portal.bokadirekt.se/swagger/v1/swagger Represents a service offered, including its ID, name, and whether it's an add-on. ```APIDOC ## ServiceViewModel ### Description Represents a service offered, including its unique identifier, name, and a flag indicating if it's an add-on. ### Properties - **serviceId** (string) - Unique identifier of the service. - **serviceName** (string) - Name of the service. - **isAddon** (boolean) - Indicates whether the service is an add-on to another service. ``` -------------------------------- ### ResourceAvailabilityViewModel Schema Source: https://external.api.portal.bokadirekt.se/swagger/v1/swagger Defines the structure for resource availability information. ```APIDOC ## ResourceAvailabilityViewModel Schema ### Description This schema provides details about the availability of a resource on a specific date, including booked and absent times. ### Parameters #### Request Body - **date** (string) - Required - The date the availability information applies to. (format: date-time) - **bookableMinutes** (integer) - Required - Total number of minutes the resource is available for booking on the given date. (format: int32) - **bookedMinutes** (integer) - Required - Total number of minutes already booked on the given date. (format: int32) - **absenceMinutes** (integer) - Required - Total number of minutes the resource is marked absent on the given date. (format: int32) - **lunchMinutes** (integer) - Required - Number of minutes reserved for lunch on the given date. (format: int32) - **attendanceMinutes** (integer) - Required - Total number of minutes the resource is scheduled to be present (working) on the given date. (format: int32) ### Request Example ```json { "date": "2023-10-27T10:00:00Z", "bookableMinutes": 480, "bookedMinutes": 120, "absenceMinutes": 0, "lunchMinutes": 30, "attendanceMinutes": 450 } ``` ### Response #### Success Response (200) This schema does not define a success response, it's part of a larger request body. #### Response Example N/A ``` -------------------------------- ### SaleViewModel Source: https://external.api.portal.bokadirekt.se/swagger/v1/swagger Represents sales data for a salon, including transaction headers. ```APIDOC ## SaleViewModel ### Description Represents sales data for a salon, including a list of sales transaction headers. ### Properties - **salonId** (string) - Unique identifier of the salon. - **salonName** (string) - Name of the salon. - **headers** (array of SaleHeaderViewModel) - List of sales transaction headers. ``` -------------------------------- ### Booking Data Model Source: https://external.api.portal.bokadirekt.se/swagger/v1/swagger Details of the BookingViewModel, which represents a booking in the system. It includes identifiers, dates, prices, and status flags. ```APIDOC ## BookingViewModel ### Description Represents a booking in the system, including details about the assigned resource, service, and booking status. ### Properties - **resourceId** (string) - Unique identifier of the resource (e.g. staff member) assigned to the booking. - **resourceName** (string) - Full name of the assigned resource. - **resourceNickName** (string) - Optional nickname of the assigned resource. - **bookingId** (string) - Unique identifier of the booking. - **bookingGroupId** (string) - Identifier used to group related bookings (e.g. recurring or linked appointments). - **created** (string) - Date and time when the booking was created (in UTC). - **serviceId** (string) - Unique identifier of the booked service. - **serviceName** (string) - Name of the booked service. - **onlineBooking** (boolean) - Indicates whether the booking was made online. - **startDate** (string) - Scheduled start date and time of the booking (in UTC). - **endDate** (string) - Scheduled end date and time of the booking (in UTC). - **bookedPrice** (number) - Total price of the booking at the time it was made. - **cancelled** (boolean) - Indicates whether the booking was cancelled. - **dropIn** (boolean) - Indicates whether the booking was made as a drop-in (walk-in) appointment. - **rebooked** (boolean) - Indicates whether the booking is a rebooking of a previous appointment. - **noShow** (boolean) - Indicates whether the customer was marked as a no-show for the appointment. - **isAddon** (boolean) - Indicates whether the booking is an add-on service to another booking. ``` -------------------------------- ### Customer Data Model Source: https://external.api.portal.bokadirekt.se/swagger/v1/swagger Details of the CustomerViewModel, which represents a customer in the system. It includes identifiers, contact information, and consent settings. ```APIDOC ## CustomerViewModel ### Description Represents a customer in the system, including their personal details, contact information, and communication preferences. ### Properties - **customerId** (string) - Unique identifier of the customer. - **name** (string) - Full name of the customer. - **email** (string) - Email address of the customer. - **phone** (string) - Phone number of the customer. - **gender** (integer) - Gender of the customer. (0 = Unknown, 1 = Female, 2 = Male, 3 = Other) - **allowEmail** (boolean) - Indicates whether the customer has consented to receive communication via email. - **allowSms** (boolean) - Indicates whether the customer has consented to receive communication via SMS. - **categories** (array) - List of categories or tags associated with the customer (e.g. VIP, Student). - **socialSecurityNumber** (string) - Social security number or personal identifier of the customer. - **postalCode** (string) - Postal code of the customer's address. - **city** (string) - City of the customer's address. ``` -------------------------------- ### SaleRowViewModel Source: https://external.api.portal.bokadirekt.se/swagger/v1/swagger Represents an individual item or service sold in a transaction, including its details and pricing. ```APIDOC ## SaleRowViewModel ### Description Represents an individual item or service sold in a transaction, including its details and pricing. ### Properties - **itemId** (string) - Nullable - Internal identifier of the sold item (product or service). - **name** (string) - Nullable - Name of the sold item. - **number** (string) - Nullable - Article or product number. - **barCode** (string) - Nullable - Barcode associated with the item. - **customerId** (string) - Nullable - Identifier of the customer associated with the sale, if applicable. - **customerName** (string) - Nullable - Name of the customer associated with the sale, if available. - **type** (integer) - Enum: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 21, 22, 24, 500] - Type of row (e.g., product, service, discount). - **priceIncVat** (number) - Unit price including VAT. - **discount** (number) - Discount applied to the item, if any. - **totalPriceIncVat** (number) - ``` -------------------------------- ### Customer Address and Birthday Schema Source: https://external.api.portal.bokadirekt.se/swagger/v1/swagger Defines the structure for customer address details and birthday. ```APIDOC ## Customer Address and Birthday Schema ### Description This schema describes the fields related to a customer's address and date of birth. ### Parameters #### Request Body - **city** (string) - Optional - City of the customer's address. - **birthday** (string) - Optional - Customer's date of birth, typically in ISO 8601 format (YYYY-MM-DD). - **addressLine1** (string) - Optional - Primary address line of the customer's address (e.g. street name and number). - **addressLine2** (string) - Optional - Secondary address line (e.g. apartment number, building, etc.). ### Request Example ```json { "city": "Stockholm", "birthday": "1990-05-15", "addressLine1": "Example Street 123", "addressLine2": "Apt 4B" } ``` ### Response #### Success Response (200) This schema does not define a success response, it's part of a larger request body. #### Response Example N/A ``` -------------------------------- ### SaleRowPaymentViewModel Source: https://external.api.portal.bokadirekt.se/swagger/v1/swagger Details of a payment made for a sales receipt, including the payment type and amount. ```APIDOC ## SaleRowPaymentViewModel ### Description Details of a payment made for a sales receipt, including the payment type and amount. ### Properties - **paymentType** (integer) - Enum: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 30, 31, 32, 33, 34, 35, 100, 101, 110, 120, 200, 201, 202, 203, 204, 205, 206, 300, 310, 320, 330, 400, 500] - Type of payment (e.g., cash, card, voucher). - **amount** (number) - Amount paid using the specified payment type. ``` -------------------------------- ### GetSales Source: https://external.api.portal.bokadirekt.se/swagger/v1/swagger Retrieves all sales transactions associated with a salon within a specified date range. Defaults to the last 30 days if no range is provided. Returns detailed sales information. ```APIDOC ## GET /api/v1/sales ### Description Retrieves all sales transactions associated with a salon within a specified date range, defaulting to the last 30 days if no range is provided. It returns detailed sales information, including transaction ID, product or service sold, quantity, price, customer, and date of sale. ### Method GET ### Endpoint /api/v1/sales ### Parameters #### Query Parameters - **StartDate** (string) - Optional - Start date to filter bookings. - **EndDate** (string) - Optional - End date to filter bookings. ### Response #### Success Response (200) - **SaleViewModel** (array) - Detailed sales information for each transaction. #### Response Example ```json [ { "transactionId": "string", "productId": "string", "productName": "string", "quantity": 0, "price": 0.0, "discount": 0.0, "totalPrice": 0.0, "customerId": "string", "customerName": "string", "bookingId": "string", "dateOfSale": "string" } ] ``` #### Error Response (429) - **string** - Indicates too many requests. ``` -------------------------------- ### SaleHeaderViewModel Source: https://external.api.portal.bokadirekt.se/swagger/v1/swagger Represents the header information for a sales receipt, including dates, types, and associated rows and payments. ```APIDOC ## SaleHeaderViewModel ### Description Represents the header information for a sales receipt, including dates, types, and associated rows and payments. ### Properties - **receiptDate** (string) - Nullable - Date and time when the receipt was issued. - **receiptType** (integer) - Enum: [0, 1, 2, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13] - Type of receipt, such as sale, refund, or correction. - **receiptNumber** (string) - Nullable - Receipt number as shown on the printed receipt. - **rows** (array) - Nullable - List of individual sale items (products/services) in this receipt. - **items** - Refer to `SaleRowViewModel`. - **payments** (array) - Nullable - List of payment methods and amounts used in the transaction. - **items** - Refer to `SaleRowPaymentViewModel`. ``` -------------------------------- ### SaleHeaderViewModel Source: https://external.api.portal.bokadirekt.se/swagger/v1/swagger Represents a single sales transaction header, including items and associated details. ```APIDOC ## SaleHeaderViewModel ### Description Represents a single sales transaction header, detailing the sale of items and associated information like VAT rates and resource IDs. ### Properties - **id** (string) - Unique identifier for the sales header. - **date** (string) - Date and time of the sale. - **totalPrice** (number) - Total price for this item row, including VAT and after discount. - **vatRate** (number) - VAT rate applied to the item. - **bookingId** (string) - ID of the booking associated with the sale, if applicable. - **resourceId** (string) - ID of the resource (e.g., staff member) involved in the sale. - **resourceName** (string) - Full name of the resource. - **resourceNickName** (string) - Optional nickname of the resource. - **quantity** (integer) - Quantity of the item sold. ``` -------------------------------- ### Rate Limiting Source: https://external.api.portal.bokadirekt.se/swagger/v1/swagger The Bokadirekt API enforces rate limiting to prevent abuse and ensure fair access. The default limit is 10 requests per minute per IP address. Exceeding this limit will result in a 429 Too Many Requests response. ```APIDOC ## Rate Limiting ### Description To prevent abuse and ensure equitable access for all users, each endpoint is subject to rate limiting. The default rate limit is **10 requests per minute** per client IP address. ### Response Codes - **429 Too Many Requests**: Returned when the rate limit is exceeded. ``` -------------------------------- ### Webhook Notifications Source: https://external.api.portal.bokadirekt.se/swagger/v1/swagger The Webhook API supports real-time notifications for events such as bookings being created, updated, or deleted. You can subscribe to these events at different levels, from portal-wide to individual staff members. Custom authentication headers can be configured for security. ```APIDOC ## Webhook API ### Description The API supports webhooks for real-time notifications to external systems when specific events occur. You can subscribe to various event types like bookings created, updated, or deleted. Subscriptions can be configured at portal-wide, specific salon, or individual staff member levels. A custom authentication header can be specified for security. Webhook deliveries are sent via HTTP POST requests to a user-defined callback URL with structured JSON payloads. ### Method POST ### Endpoint `/webhooks` (This is a conceptual endpoint as the actual subscription mechanism is likely managed via configuration or a separate API endpoint not detailed here.) ### Parameters #### Query Parameters * **callbackUrl** (string) - Required - The URL where webhook notifications will be sent. * **eventTypes** (array of strings) - Optional - Specifies which events to subscribe to (e.g., `bookings_created`, `bookings_updated`, `bookings_deleted`). Defaults to all if not specified. * **scope** (string) - Optional - Defines the granularity of the subscription (e.g., `portal`, `location:{locationId}`, `staff:{staffId}`). Defaults to portal-wide if not specified. #### Request Body * **authHeaderName** (string) - Optional - The name of the custom authentication header (e.g., `Webhook-Secret`). * **authHeaderValue** (string) - Optional - The value of the custom authentication header. ### Request Example ```json { "callbackUrl": "https://your-service.com/webhook-handler", "eventTypes": ["bookings_created", "bookings_updated"], "scope": "location:00000000-0000-0000-0000-000000000000", "authHeaderName": "Webhook-Secret", "authHeaderValue": "your-secret-token" } ``` ### Response #### Success Response (200) - **subscriptionId** (string) - The unique identifier for the created webhook subscription. - **message** (string) - A confirmation message indicating successful subscription. #### Response Example ```json { "subscriptionId": "sub-12345abc", "message": "Webhook subscription created successfully." } ``` ### Event Payload Example ```json { "Id": "00000000-0000-0000-0000-000000000000", "LocationId": "00000000-0000-0000-0000-000000000000", "LocationName": "Test salon", "PersonId": "00000000-0000-0000-0000-000000000000", "PersonName": "Test person", "ServiceId": "00000000-0000-0000-0000-000000000000", "ServiceName": "Test service", "BookingPrice": 100.0, "BookingStartDate": "2025-01-01T09:00:00+01:00", "BookingEndDate": "2025-01-01T10:00:00+01:00", "Customer": { "Id": "00000000-0000-0000-0000-000000000000", "MobilePhoneNumber": "+46000000000", "PhoneNumber": "+46000000000", "FirstName": "Test", "LastName": "Customer", "EmailAdress": "test@test.se", "NewCustomer": false }, "EventCreated": "2025-01-01T08:00:00+00:00", "BookedOnline": true, "Cancelled": false, "NewCustomer": false, "GclId": null, "Referer": "bokadirekt.se" } ``` ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.