Business Processes Overview
This document provides a comprehensive overview of all business processes supported by SureMSA, including customer onboarding, subscription management, order processing, and financial workflows.
Core Business Entities
SureMSA operates with interconnected business entities that form the foundation of all processes:
1. Customer Lifecycle Process
The customer lifecycle tracks the journey from prospect to active customer with subscriptions and licenses.
Customer Creation API
- Endpoint:
POST /customers - Auto-generates:
customerCodefromfullName - External Systems: Optional (Salesforce, QuickBooks)
- Channel: INTERNAL, SALESFORCE, WOO_COMMERCE, QUICKBOOKS
2. Shopping Cart & Order Flow
The Cart is the central object for creating orders, subscriptions, and handling product purchases.
Cart Stages Explained
| Stage | Description | Next Stages |
|---|---|---|
| DRAFT | Initial cart creation, adding/removing products | PLACED, CANCELED |
| PLACED | Cart submitted for processing, payment pending | PAYMENT_IN_PROGRESS, AWAITING_ACCEPT, CANCELED |
| PAYMENT_IN_PROGRESS | Payment processing via Stripe/Gateway | PAYMENT_COMPLETED, CANCELED |
| AWAITING_PAYMENT | Waiting for credit payment confirmation | PAYMENT_COMPLETED, CANCELED |
| PAYMENT_COMPLETED | Payment successful, order creation in progress | COMPLETED |
| AWAITING_ACCEPT | Waiting for manual acceptance/approval | COMPLETED, CANCELED |
| COMPLETED | Order created, licenses provisioned | - |
| CANCELED | Cart canceled or payment failed | - |
3. Financial Transaction Workflows
SureMSA supports three main financial document types: Quotes, Orders, and Invoices.
3.1 Quote → Order → Invoice Flow
3.2 Quote Workflow Statuses
3.3 Order Processing Statuses
3.4 Invoice Statuses
4. Subscription & License Management
Subscription Transaction Types
| Type | Description | Cart Stage Trigger |
|---|---|---|
| NEW | New subscription creation | COMPLETED (no existing subscription) |
| UPGRADE | Add products/users to existing subscription | COMPLETED (modify existing) |
| RENEW | Subscription renewal | COMPLETED (extend dates) |
| DOWNGRADE | Remove products/users | COMPLETED (reduce scope) |
| CANCEL | Terminate subscription | CANCELED |
5. Payment Methods & Processing
6. Credit Balance System
SureMSA supports a multi-level credit balance system for prepaid/credit-based payments.
7. External System Integrations
API Endpoints by Process
Customer Management
POST /customers- Create customerGET /customers/{id}- Get customer detailsGET /customers?code={code}- Get by customer code
Cart Management
POST /cart- Create/update cartGET /cart/{id}- Get cartPOST /cart/set/placed/{id}- Place cartPOST /cart/set/completed/{id}- Complete cartPOST /cart/set/canceled/{id}- Cancel cart
Order Processing
POST /orders- Create orderGET /orders/{id}- Get order- Orders auto-created from completed carts
Quote Management
POST /quotes- Create quotePUT /quotes/{id}/status- Update quote statusPOST /quotes/{id}/convert-to-cart- Convert to cart
Subscription Management
POST /subscriptions- Create subscriptionGET /subscriptions/{id}- Get subscriptionGET /subscriptions?billingProjectId={id}- Get by billing project ID
License Management
POST /licenses- Create licenseGET /licenses/{id}- Get licensePOST /licenses/{id}/activate- Activate license
Payment Processing
POST /payments- Create paymentGET /payments/{id}- Get payment status- Stripe webhooks handle async updates
Key Business Rules
Customer Code Generation
- Source: Customer's
fullName - Format: First 9 characters, lowercase, alphanumeric
- Uniqueness: Auto-increments if duplicate (
sterlingb1,sterlingb2)
Billing Project ID Generation
- Source:
{customerCode}-{subscriptionName} - Format: Lowercase, hyphen-separated, max 10 chars from subscription name
- Example:
sterlingb-enterpriseoracme-trial1
Payment Hierarchy
- License-level credits (if available)
- Subscription-level credits (if license insufficient)
- Customer-level credits (if subscription insufficient)
- External payment (Stripe, Invoice) if no credits
Cart to Order Conversion
- Cart COMPLETED → Order PAYMENT_COMPLETED
- Cart products → Order items
- Auto-creates subscription if needed
- Provisions licenses automatically
Summary
SureMSA's business processes are designed around a flexible Cart-based commerce system that supports:
✅ Multiple sales channels: Internal, Salesforce, WooCommerce, QuickBooks
✅ Flexible payment methods: Stripe, Credits, Invoices, External gateways
✅ Comprehensive workflow: Quote → Cart → Order → Invoice → Fulfillment
✅ Automated provisioning: Subscriptions and licenses created automatically
✅ External integrations: Seamless sync with CRM and accounting systems
All processes are exposed via REST APIs and can be automated or integrated with external systems.