Alvera Service Commerce Platform (SCP) API
Alvera SCP is a vertical operating system for service-based businesses. This documentation covers how to integrate with the SCP API using the TypeScript SDK.
How to Use These Docs
| Page | Purpose |
|---|---|
| Overview | Platform architecture, user personas, and API reference by tag group |
| Setting Up SCP Client | Detailed Docker setup and SDK configuration |
| API Reference | Interactive OpenAPI documentation with "Try it" functionality |
| Cookbook | Step-by-step guides for common tasks |
Cookbook
Interactive guides for building with the SCP API:
Getting Started
- Initialize Client - Connect and authenticate with the API
- Merchant Onboarding - Create merchant organizations
Service Manager
- Service Manager - Manage categories, services, and bundles
More cookbooks coming soon: Booking Flow, Customer Management, Payment Processing
What You Can Build
| Vertical | Examples |
|---|---|
| Beauty & Wellness | Salons, medspas, barbershops, nail studios |
| Healthcare | Medical practices, dental offices, therapy clinics |
| Fitness | Gyms, yoga studios, personal trainers |
| Professional Services | Consultants, tutors, coaches, photographers |
| Home Services | Cleaning, repairs, pet grooming |
Platform Architecture
Alvera SCP is designed as a white-label multi-tenant service commerce platform where:
- Tenant - Platform operator (your company)
- MerchantOrg - B2B holding companies that own one or more businesses
- Merchant - Individual businesses serving end customers
- EndCustomer - Consumers who book appointments
Tenant (Platform Operator)
├─> Users (platform staff with role-based permissions)
├─> Plugins (payment processors, SMS, email, integrations)
└─> MerchantOrgs (B2B holding companies)
└─> Merchants (individual businesses)
├─> Providers (service providers who deliver services)
├─> Locations (physical locations)
├─> Services (what they offer)
└─> EndCustomers (consumers)
└─> Bookings (parent container)
├─> Appointments (child calendar slots)
├─> Invoices (billing)
└─> Notifications (reminders, confirmations)
User Personas
1. EndCustomer
Consumers who book and pay for services.
API Capabilities:
- Browse services and available time slots
- Book appointments
- Manage appointments across multiple merchants
- Store payment methods on file
- Check in via QR code
- Pay and tip at checkout
- View appointment history and invoices
2. Merchant Staff
Employees managing daily business operations.
API Capabilities:
- Customer management and lead tracking
- Appointment scheduling and calendar
- Waitlist management
- Direct and group messaging
- Process payments, refunds, chargebacks
- Manage locations, services, provider schedules
3. Platform Staff (Tenant Users)
Platform operators managing the entire system.
API Capabilities:
- Onboard and manage merchant organizations/merchants
- User and role management
- Subscription and billing management
- Access audit logs across all merchants
4. AI Agents
Autonomous systems that interact with the platform programmatically via API.
API Capabilities:
- Authenticate via API tokens
- Book appointments on behalf of end customers
- Query availability and services
- Retrieve customer information and history
- Send notifications and messages
- Process payments and refunds
- Access audit trails for AI actions
Booking Flow
The complete booking and payment flow: Discovery → Booking → Deposit → Service → Balance → Tip
Key Concept: A Booking is the parent container (the "cart" or "order") that holds:
- Multiple Appointments (calendar slots with providers)
- Invoices (billing documents)
- Payment Contracts (recurring payment rules)
- Notifications (reminders, confirmations)
Quick Start
- Initialize Client - Connect and authenticate with the API
- Setting Up SCP Client - Detailed SDK setup with Docker
- API Reference - Interactive API documentation with "Try it" functionality
API Reference by Tag Group
Authentication & Authorization
| Service | Description | API |
|---|---|---|
Authentication | Sign in to obtain Bearer tokens for API access | → |
User | Platform user management and permissions | → |
Role | Role-based access control configuration | → |
Platform Operations
| Service | Description | API |
|---|---|---|
Tenant | Multi-tenant platform management | → |
MerchantOrg | B2B holding company management | → |
Platform Finance
| Service | Description | API |
|---|---|---|
Subscription | Platform subscription management | → |
Transaction | Financial transaction processing | → |
TransactionJournal | Transaction audit and reconciliation | → |
Merchant Operations
| Service | Description | API |
|---|---|---|
Merchant | Individual business location management | → |
Location | Physical location configuration | → |
Provider | Service provider (staff) management | → |
Service | Service catalog and pricing | → |
ServiceCategory | Service category organization | → |
ServicePackage | Bundle and package configuration | → |
Availability | Provider and location availability | → |
Booking | Booking container (cart/order) management | → |
BookingEnquiry | Booking inquiry and waitlist | → |
BookingPolicy | Booking rules and policies | → |
Appointment | Individual appointment slots | → |
AppointmentSearch | Appointment search and filtering | → |
Merchant Finance
| Service | Description | API |
|---|---|---|
Invoice | Invoice generation and management | → |
PaymentAccount | Stored payment methods | → |
PaymentContract | Recurring payment rules | → |
PaymentPolicy | Payment terms and policies | → |
Customer Operations
| Service | Description | API |
|---|---|---|
EndCustomer | Customer profile management | → |
EndCustomerSearch | Customer search and filtering | → |
Message | Direct and group messaging | → |
NotificationPolicy | Reminder and notification configuration | → |
FormResponse | Form and intake submissions | → |
Compliance & Branding
| Service | Description | API |
|---|---|---|
AuditLog | Security and compliance audit trail | → |
Website | Booking page customization | → |
Development & Testing
| Service | Description | API |
|---|---|---|
Sandbox | Development utilities and data reset | → |
Downloads
- Docker Compose - Run SCP locally
- OpenAPI Spec - Generate your own SDK
- Client Samples - Ready-to-use TypeScript examples
- Integration Tests - Vitest test suite
Quality Checks & Integration Tests
Running Integration Tests
The SCP platform includes a comprehensive Vitest test suite that validates all API endpoints:
# Setup and run tests
cd integration-tests
npm install
npm test
Test Coverage
Integration tests cover:
- Authentication - Login, token refresh, session management
- CRUD Operations - Create, read, update, delete for all resources
- Business Logic - Booking flows, availability checks, payment processing
- Error Handling - Validation errors, authorization failures, edge cases
Environment Variables
# Required for running tests
ADMIN_EMAIL=admin@alvera-scp-dev.local
ADMIN_PASSWORD=DevPassword123!
TENANT_NAME=alvera-scp-dev
API Coverage Report
After running tests, view the API coverage report:
npm run test:coverage
This shows which endpoints are tested and identifies gaps in test coverage.