Create Business Category (v1)
Create a new business category.
Method & Path
POST /v1/admin/business-categories
Description
Creates a new business category with localized names and descriptions.
Authentication
Required: Admin authentication with businesses.manage permission.
Request Body
{
"slug": "beauty-salon",
"isActive": true,
"sortOrder": 0,
"translations": [
{
"locale": "en",
"name": "Beauty Salon",
"description": "Beauty and wellness services"
},
{
"locale": "ar",
"name": "صالون تجميل",
"description": "خدمات التجميل والعافية"
}
],
"allowedMenuSections": [
"overview",
"sessions",
"clients",
"referrals"
]
}
Request Body Schema
| Field | Type | Required | Description |
|---|---|---|---|
slug | string | Yes | Unique category slug |
isActive | boolean | No | Whether the category is active (default: true) |
sortOrder | number | No | Sort order for display (default: 0) |
translations | array | Yes | Array of translations (min: 1) |
allowedMenuSections | array | No | Array of allowed dashboard sections for this category |
Allowed Menu Sections
The allowedMenuSections field specifies which dashboard sections are available for workspaces in this business category. Valid values:
overviewteam-boardstaff-directoryclientssessionsstorefrontvcardlabspayments-expensessms-trackingai-trackingstorage-trackingsettingsreferrals
Response 201 Created
{
"category": {
"id": "507f1f77bcf86cd799439011",
"slug": "beauty-salon",
"isActive": true,
"sortOrder": 0,
"translations": [
{
"locale": "en",
"name": "Beauty Salon",
"description": "Beauty and wellness services",
"image": null
},
{
"locale": "ar",
"name": "صالون تجميل",
"description": "خدمات التجميل والعافية",
"image": null
}
],
"allowedMenuSections": [
"overview",
"sessions",
"clients",
"referrals"
],
"createdAt": "2024-01-15T10:00:00Z",
"updatedAt": "2024-01-15T10:00:00Z"
}
}
Common Errors
- 401 Unauthorized: Missing or invalid admin authentication token
- 403 Forbidden: Insufficient permissions
- 400 Bad Request: Invalid request body
- 409 Conflict: Category with same slug already exists
- 500 Internal Server Error: Server error