Appearance
Subscription ​
Overview ​
Billing runs on Stripe (stripe/stripe-php, Stripe\StripeClient built from dam.STRIPE_SECRET). Plans are Subscriptions rows; each has a stripe_reference_id (the Stripe price) and a features JSON. When a workspace subscribes, a SubscriptionUsers row stores the workspace's copy of features plus Stripe ids (stripe_customer_id, stripe_subscription_id), status, billing_cycle, trial fields (is_trial_account, trial_end_date, trial_expire), is_suspended, payment_pause and the AI image token balance openai_image_count.
Plans, add-ons, coupons, inquiries and customer accounts are managed by Collage staff in the Blade super-admin under /admin/subscription/* (web guard, Web\Subscription\* controllers); PlanController creates the matching Stripe plans through Subscriptions::createStripePlan(). Workspace owners use the Admin API (/api/v1/digital-assets/subscription/*). Signup and checkout callbacks use public routes under /api/v1/subscription/*. There is no Stripe webhook route; state changes come from these callbacks and the scheduled commands below.
Plan limits ​
Limits are enforced in code through DamInstance::checkFeatureRestriction($userId, $workspaceId, $feature), which reads SubscriptionUsers.features and returns ['enable' => false, 'message' => 'Please upgrade your plan to access this feature.'] when blocked, or Your subscription is not found. when the workspace has no subscription row.
| Feature key | Rule | Checked by |
|---|---|---|
storage | Sum of assets_versions.file_size (not final deleted) must not exceed default_value GB (1000^3 bytes) unless unlimited | Upload, move, copy |
users / admin_users | Active plus pending seats below users / admin | Portal user invite, workspace user invite |
image_generation | Off for lite-monthly / lite-yearly, or when openai_image_count is 0 | Returned in the feature map (GET /user); no controller passes this key |
asset_versioning, asset_embedding, asset_conversion, ai_based_asset_auto_tagging, public_and_private_asset_customisation, acl_wordpress_integration, manage_banner_and_tiles, per_asset_analytics, share_asset_analytics, folder_permission_customisation, dam_branding | The feature's enable flag | The matching endpoints |
The checkStorageLimit middleware (DAMStorageLimit) is registered in Kernel.php but no route uses it; storage is only enforced through checkFeatureRestriction(). GET /api/v1/user and GET /dam/v1/user return the feature map and fire UpdateSubscriptionRestrictionEvent, whose listener resets workspace branding colours when dam_branding is off and turns branding off when email_branding is off.
Endpoints ​
Public (/api/v1/subscription) ​
| Method | Path | Controller@method | Purpose |
|---|---|---|---|
| GET | /{subscription_name}/detail | SubscriptionController@subscriptionDetail | Plan group detail with current usage |
| POST | /inquiry/{id}/activation | SubscriptionController@subscriptionActivation | After checkout: create the owner user and SubscriptionUsers |
| POST | /inquiry/payment-intent | SubscriptionController@updateInquiry | Record payment status from checkout |
| POST | /change-user-plan | SubscriptionController@changeUserPlan | Upgrade now or schedule a downgrade |
| POST | /downgrade-plan | SubscriptionController@downgradePlan | Apply a downgrade |
| POST | /update-event-sent | SubscriptionController@updateEventSentFalse | Reset the event-sent flag |
| POST | /update-subscription-date | SubscriptionController@updateSubscriptionDate | Route exists, but the controller has no such method in this snapshot |
| POST | /add-payment-method | SubscriptionController@addPaymentMethod | Attach a payment method, resume collection |
| POST | /buy | SubscriptionController@buyAddon | Buy an add-on (image tokens) |
Admin API (/api/v1/digital-assets/subscription) ​
| Method | Path | Controller@method | Purpose |
|---|---|---|---|
| GET | /get | SubscriptionController@userActiveSubscription | Current subscription |
| POST | /make-default-card, /delete-card | SubscriptionController@makeDefaultCard, @deleteCard | Stripe customer cards |
| POST | /cancel | SubscriptionController@cancelSubscription | Cancel at period end |
| POST | /re-activate | SubscriptionController@reActivateSubscription | Undo cancellation |
| POST | /cancel-trial | SubscriptionController@cancelTrial | End a trial |
| POST | /delete-all-data | SubscriptionController@deleteAllData | Queue full workspace data removal |
| POST | /activity-log | SubscriptionController@activityLog | Write a subscription activity row |
| GET | /storage-analytics, /send-storage-analytics-email | AnalyticsController@storageAnalytics, @sendStorageAnalyticsEmail | Storage usage |
Workflows ​
Signup activation ​
The owner then sets a password through POST /api/v1/generate-common-password, which activates the user and the SubscriptionUsers row and queues UserWelcomeEmailJob. inquiry/payment-intent updates payment_status on the inquiry and subscription user and sends the activation link once a payment succeeds. These routes have no auth middleware.
Change plan ​
Downgrades take effect at the end of the current period through a Stripe subscription schedule; downgrade-plan applies the stored downgrade to the database. cancel sets cancel_at_period_end (and cancels open schedules) and queues SubscriptionCancelEmailJob; re-activate reverses it.
Daily subscription commands ​
dam:trial-expire picks trial accounts whose trial_end_date has passed. The branch meant for customers with a saved card compares the string 'trial_expire' with false, which is never true, so every expired trial goes to the pause branch: collection is paused in Stripe and payment_pause = 1. dam:SuspendAccount only acts on rows with is_suspended = 1 and delete_all_data = 0. Suspension is also checked at login (This account is suspended...). delete-all-data from the owner queues DAMRemoveWorkspaceData on the high queue.
Data ​
| Model / table | Use |
|---|---|
Subscriptions / subscriptions | Plans, features, stripe_reference_id, slug, group_name |
SubscriptionUsers / subscription_users | Workspace subscription and feature copy |
DamInquiry | Checkout inquiries |
SubscriptionAddon, SubscriptionUserAddon, Addon | Add-ons |
Coupons | Coupons |
SubscriptionUserActivity | Subscription activity log |
AssetsVersion.file_size | Storage usage |
Related ​
- Services, Jobs, Events for
UpdateSubscriptionRestrictionEvent - Middleware for
checkStorageLimit - Frontend: Subscription & Plans