🔌 Cannabrands API Reference
🎯 Overview
The Cannabrands API provides endpoints for business management, user authentication, notifications, and setup workflows. All business routes are prefixed with /b/ following the Marketplace Platform-style URL structure.
🔐 Authentication
Session-Based Authentication
All API endpoints require Laravel session authentication. Users must be logged in through the web interface.
CSRF Protection
All POST/PUT/DELETE requests require CSRF token in headers:
🏢 Business Authentication Routes
Registration
| Method |
Endpoint |
Purpose |
Middleware |
GET |
/b/register |
Show registration form |
guest |
POST |
/b/register |
Process registration |
guest |
GET |
/b/registration/success |
Registration success page |
guest |
Login/Logout
| Method |
Endpoint |
Purpose |
Middleware |
GET |
/b/login |
Show login form |
guest |
POST |
/b/login |
Process login |
guest |
POST |
/b/logout |
Logout user |
auth |
Profile Management
| Method |
Endpoint |
Purpose |
Middleware |
GET |
/b/profile |
User profile (no business) |
auth, verified |
🎛 Dashboard Routes
Main Dashboard
| Method |
Endpoint |
Purpose |
Middleware |
GET |
/b/dashboard |
Business dashboard |
auth, verified, approved |
GET |
/dashboard |
Legacy redirect to /b/dashboard |
auth, verified, approved |
🛠 Business Setup Routes
Multi-Step Setup Wizard
| Method |
Endpoint |
Purpose |
Middleware |
GET |
/b/setup |
Setup wizard (step 1) |
auth, verified, approved |
GET |
/b/setup/{step} |
Specific setup step (1-5) |
auth, verified, approved |
POST |
/b/setup/{step} |
Submit setup step |
auth, verified, approved |
Setup Step Breakdown
- Step 1: Business Information (name, type, address)
- Step 2: Contact & Billing Information
- Step 3: License Information
- Step 4: Banking & Tax Information
- Step 5: Review & Submit
🔔 Notification API
Notification Endpoints
| Method |
Endpoint |
Purpose |
Response |
GET |
/b/notifications |
Notifications center page |
HTML |
GET |
/b/notifications/dropdown |
Dropdown data |
JSON |
GET |
/b/notifications/count |
Unread count |
JSON |
POST |
/b/notifications/{id}/read |
Mark as read |
JSON |
POST |
/b/notifications/{id}/unread |
Mark as unread |
JSON |
POST |
/b/notifications/read-all |
Mark all as read |
JSON |
Notification API Responses
Dropdown Data (/b/notifications/dropdown)
Unread Count (/b/notifications/count)
Mark as Read (/b/notifications/{id}/read)
👥 User Management (Filament Admin)
Admin Panel Routes
| Endpoint |
Purpose |
Access |
/admin |
Filament admin dashboard |
Admin only |
/admin/users |
User management |
Admin only |
/admin/businesses |
Business management |
Admin only |
User Approval Actions
- View/Modify: Edit user details
- Approve: Grant business access
- Deny: Reject business access
🔄 Special Routes
Approval System
| Method |
Endpoint |
Purpose |
Middleware |
GET |
/approval/login/{user} |
Signed URL login |
signed |
GET |
/pending-approval |
Pending approval page |
auth |
System Routes
| Method |
Endpoint |
Purpose |
GET |
/version |
Application version |
GET |
/status |
System status check |
📊 Data Formats
User Registration Data
Business Setup Data
🚨 Error Handling
Common HTTP Status Codes
- 200: Success
- 302: Redirect (often to login or dashboard)
- 401: Unauthenticated
- 403: Forbidden (not approved or wrong user type)
- 404: Not found
- 422: Validation error
- 500: Server error
Error Response Format
📈 Rate Limiting
Default Limits
- Web routes: 60 requests per minute per IP
- API routes: 60 requests per minute per user
- Login attempts: 5 attempts per minute per email
🔒 Security
CSRF Protection
All state-changing requests require CSRF token.
Route Model Binding
User notifications automatically scope to authenticated user.
Middleware Stack
web: Session, CSRF, cookie encryption
auth: Requires authentication
verified: Requires email verification
approved: Requires admin approval
guest: Unauthenticated users only
🧪 Testing Endpoints
Development Only
Last Updated: August 2025
Base URL: http://localhost:8000 (development)
Authentication: Laravel session-based