API Documentation

Overview

The Business Profile Management API provides endpoints for managing business information, settings, and configuration within the Bee O'clock platform. This API allows businesses to create, update, and retrieve their complete business profile including basic information, media assets, settings configurations, and operational parameters.

Base URL

/api/v1/business-profile

Authentication

All endpoints require:

  • Bearer Token: JWT authentication token

  • Business-Tenant-Id: Header specifying the business tenant ID

API Endpoints

1. Get Business Profile

Endpoint: GET /

Description: Retrieves the complete business profile for the authenticated tenant.

Response: BusinessProfileDto

Permissions Required: READ_BUSINESS_PROFILE

Response Structure:


2. Update Business Profile

Endpoint: PUT /

Description: Updates the complete business profile with the provided data.

Request Body: BusinessProfileDto (complete object)

Response: BusinessProfileDto (updated profile)

Permissions Required: EDIT_BUSINESS_PROFILE

Validation Rules:

  • name: Required for business identification

  • published: Must be ActiveEnum value (YES/NO)

  • Nested objects must pass their respective validation rules

  • Media references must exist in the system


3. Update Payment Settings

Endpoint: PATCH /payment-settings

Description: Updates only the payment settings portion of the business profile.

Request Body: PaymentSettingsDto

Response: PaymentSettingsDto (updated payment settings)

Permissions Required: EDIT_BUSINESS_PROFILE

Payment Settings Structure:


Business Profile Media API

Base URL for Media Operations

Endpoint: PATCH /logo

Description: Updates the business logo image.

Request: Multipart form data with image file

Response: void

Permissions Required: EDIT_BUSINESS_PROFILE

Content Type: multipart/form-data

File Requirements:

  • Supported formats: JPEG, PNG, WebP

  • Maximum file size: 5MB

  • Recommended dimensions: 200x200px (square)


Endpoint: DELETE /logo

Description: Removes the current business logo.

Response: void

Permissions Required: EDIT_BUSINESS_PROFILE


6. Update Banner Item

Endpoint: PATCH /banner/:bannerItemId

Description: Updates a specific banner image.

Path Parameters:

  • bannerItemId (string): The ID of the banner item to update

Request: Multipart form data with image file

Response: void

Permissions Required: EDIT_BUSINESS_PROFILE

File Requirements:

  • Supported formats: JPEG, PNG, WebP

  • Maximum file size: 10MB

  • Recommended dimensions: 1200x400px (landscape)


7. Delete Banner Item

Endpoint: DELETE /banner/:bannerItemId

Description: Removes a specific banner image.

Path Parameters:

  • bannerItemId (string): The ID of the banner item to delete

Response: void

Permissions Required: EDIT_BUSINESS_PROFILE


Endpoint: PATCH /gallery/:galleryItemId

Description: Updates a specific gallery image.

Path Parameters:

  • galleryItemId (string): The ID of the gallery item to update

Request: Multipart form data with image file

Response: void

Permissions Required: EDIT_BUSINESS_PROFILE

File Requirements:

  • Supported formats: JPEG, PNG, WebP

  • Maximum file size: 8MB

  • Recommended dimensions: Variable (maintains aspect ratio)


Endpoint: DELETE /gallery/:galleryItemId

Description: Removes a specific gallery image.

Path Parameters:

  • galleryItemId (string): The ID of the gallery item to delete

Response: void

Permissions Required: EDIT_BUSINESS_PROFILE


Data Transfer Objects

BusinessProfileDto

The main DTO containing all business profile information:

Key Nested DTOs

AddressDto

ContactDto

ScheduleDto

ActiveEnum

FacilityEnum

Error Responses

Common HTTP Status Codes

  • 400 Bad Request: Invalid request data or validation errors

  • 401 Unauthorized: Missing or invalid authentication token

  • 403 Forbidden: Insufficient permissions

  • 404 Not Found: Business profile not found

  • 413 Payload Too Large: File upload exceeds size limits

  • 415 Unsupported Media Type: Invalid file format for media uploads

  • 500 Internal Server Error: Server-side processing error

Error Response Format

Permission System

The business profile management system uses a role-based permission system:

  • READ_BUSINESS_PROFILE: View business profile information

  • EDIT_BUSINESS_PROFILE: Modify business profile information

Permission Enforcement

  • All endpoints require appropriate permissions

  • Media upload/delete operations require EDIT permissions

  • Profile visibility is controlled by the published field

Business Rules

πŸ“ Profile Validation

  1. Name Requirement: Business name is required for profile creation

  2. Publication Control: Only published profiles are visible to clients

  3. Media Limits: Maximum file sizes enforced for different media types

  4. Format Restrictions: Only supported image formats allowed for media

πŸ–ΌοΈ Media Management

  1. Logo Requirements: Square format recommended, single logo per business

  2. Banner Specifications: Landscape format for promotional banners

  3. Gallery Flexibility: Multiple images with preserved aspect ratios

  4. Automatic Cleanup: Orphaned media files are cleaned up periodically

βš™οΈ Settings Hierarchy

  1. Business Settings: Core operational parameters

  2. Booking Settings: Customer booking configuration

  3. Payment Settings: Financial transaction setup

  4. Notification Settings: Communication preferences

  5. Panel Settings: Administrative interface customization

Integration Points

  • Media Service: File upload and management

  • Identity Service: User authentication and authorization

  • Notification Service: Settings synchronization

  • Payment Service: Payment gateway configuration

  • Cache Service: Performance optimization

Rate Limiting

Standard API rate limiting applies to all endpoints:

  • GET requests: 100 requests per minute

  • PUT/PATCH requests: 20 requests per minute

  • Media uploads: 10 requests per minute

Examples

Get Business Profile

Update Business Profile

Update Payment Settings

Last updated

Was this helpful?