Krayin SaaS Subscription lets you sell Krayin CRM access as plans (monthly/yearly), take payments via Stripe, and automatically activate/deactivate tenants based on subscription status,
and manage subscribers/invoices from the Super Admin panel.
Note: Krayin SaaS must be purchased and installed before you can use the Krayin SaaS Subscription module, since the subscription feature depends on the SaaS setup.
Recurring billing is currently allowing automatic subscription payments and seamless plan renewals.
With Krayin SaaS Subscription, you can publish subscription plans and let new tenants choose a plan, sign up, pay through Stripe Checkout,
and instantly get their own CRM tenant (subdomain/domain) without manual intervention.
Instead of creating tenants one-by-one and tracking payments manually, you configure Stripe once, create plans once,
and the rest of the flow—plan selection, tenant registration, checkout, activation, renewals, and invoices—runs automatically.
Key Benefits of Krayin SaaS Subscription
- Sell CRM as Monthly/Yearly Plans
- Stripe Checkout for Secure Payments
- Automatic Tenant Activation After Payment
- Renewals & Invoice Tracking
- Upgrade/Downgrade/Cancellation Support
- Plan Restrictions (Users/Webhooks/etc.)
Installation
Follow these steps in your Krayin SAAS root project to install and enable the subscription module.
Step 1: Register Service Provider
Go to config/app.php and add this under providers:
Webkul\SaasSubscription\Providers\SaasSubscriptionServiceProvider::class,
Step 2: Add PSR-4 Autoload
Go to composer.json and add this under autoload → psr-4:
Webkul\\SaasSubscription\\": "packages/Webkul/SaasSubscription/src
Step 3: Add Daily Expiry Scheduler
Go to app/Console/Kernel.php and add this line in the schedule method:
$schedule->exec('php artisan subscribers:expiry')->daily();
Step 4: Add Global Middleware
Go to app/Http/Kernel.php and add this in the $middleware array:
\Webkul\SaasSubscription\Http\Middleware\AllowOnlySpecificUri::class,
Step 5: Exclude Stripe Webhook from CSRF
Go to app/Http/Middleware/VerifyCsrfToken.php and add this under the $except array:
'subscription/stripe/webhook',
Step 6: Install Stripe SDK + Rebuild Autoload
Run these commands from the project root:
composer require stripe/stripe-php
composer dump-autoload
Step 7: Publish Assets & Configurations
Run:
php artisan vendor:publish
When prompted, press 0 and then press enter to publish all assets and configurations.
Step 8: Run Migrations
Run:
php artisan migrate
Step 9: Create Jobs Table (Database Queue)
Run:
php artisan queue:table
Update .env and set:
QUEUE_CONNECTION=database
Step-by-Step: Configure SaaS Subscription with Stripe to Support Recurring Payments and Tenant Plan Purchases
Integrating Krayin SaaS Subscription with Stripe makes managing subscription payments much easier and more reliable. Stripe handles the entire recurring billing process automatically,
So you do not need to manually track tenant payments every month or year.
Step 1: Enable Subscription in Super Admin
Go to Super Admin ⇾ Dashboard ⇾ Settings ⇾ Configuration ⇾ General ⇾ Subscription ⇾ Subscription Settings and enable the Subscription toggle.
(Optional) Enable notification settings and add emails for subscription-related notifications.
Step 2: Add Stripe Credentials (Publishable Key, Secret Key, Webhook Secret)
Go to Super Admin ⇾ Dashboard ⇾ Settings ⇾ Configuration ⇾ General ⇾ Subscription ⇾ Stripe and enable Stripe. Then fill:
- Stripe Publishable Key (starts with
pk_...) - Stripe Secret Key (starts with
sk_...) - Stripe Webhook Secret (starts with
whsec_...) - Mode: choose Sandbox/Test while testing, then switch to Production/Live when going live
Where to find Stripe Keys:
In your Stripe Dashboard, open Developers ⇾ API keys. Copy the Publishable key and the Secret key and paste them into Krayin’s Stripe configuration fields.
How to fill Webhook Secret:
In Stripe Dashboard, go to Developers ⇾ Webhooks and create an endpoint with this URL:https://YOUR_DOMAIN/subscription/stripe/webhook
After creating the endpoint, click it and copy the Signing secret (looks like whsec_...) and paste it into Stripe Webhook Secret in Krayin.
Step 3: Create Subscription Plans (Super Admin)
Go to Super Admin ⇾ Subscription ⇾ Plans ⇾ Create and create your plans (example: Starter/Pro/Enterprise).
Fill plan details like name, billing validity (monthly/yearly), amount/discount, recommended flag, permissions, and restrictions (for example: max users, max webhooks, etc.)
After creating a plan in the SaaS admin panel, the plan is automatically created and visible in the Stripe dashboard as well.
Step 4: Tenant Chooses a Plan (Public Plans Page)
Click Register Tenant, which will redirect you to the plan selection page.
Then click Select on the desired plan to begin the tenant signup process with that plan.
Step 5: Create Tenant (Company Signup)
Complete the tenant registration steps (email/password, profile details, and username). The username becomes the tenant subdomain (for example acme.yourdomain.com).
After submitting, Krayin creates the tenant and then redirects you to payment (when subscription is enabled).
Step 6: Purchase the Plan (Stripe Checkout)
After signup, you’ll be redirected to Payment Gateways. Click Subscribe under Stripe to open Stripe Checkout and complete the payment.
Once the payment is successful, Stripe sends updates via webhook to Krayin at /subscription/stripe/webhook.
Krayin uses these events to renew subscriptions, handle failed payments, and process cancellations.
Step 7: Verify Tenant Access + Manage Subscription
After payment confirmation, the tenant can log in to their CRM domain. From the tenant admin panel, upgrade/downgrade, or cancel.
Go to Admin ⇾ Company ⇾ Plans to view the active plan
Invoices can be found under Admin ⇾ Company ⇾ Invoice.
Super Admin Monitoring:
Super Admin can monitor everything from Super Admin ⇾ Subscription menus (Plans, Subscribers, Invoices). This helps you track subscribers, plan usage, and payments centrally.
plans
Contact Us Section
After clicking Register Tenant on the plans page, users are redirected to the plan selection page on the storefront.
If they scroll down on this page, they will find a Contact Us section.
This section allows potential customers to send inquiries if they do not find a suitable plan or want more information about the CRM.
When a user submits the contact form, the message is stored in the SaaS admin panel.
The Super Admin can view these inquiries by navigating to Dashboard → Subscription → Contact Us.
From this section, the Super Admin can review customer messages, view contact details such as name, email, phone, and message, and respond to inquiries accordingly.
Conclusion
Krayin SaaS Subscription turns tenant onboarding into a complete self-serve flow: publish plans, accept
payments through Stripe, and automatically provision and control tenant access based on subscription state.
After configuring Stripe credentials and webhook secret, you can reliably handle renewals, failed payments, and cancellations—while tenants can manage upgrades and invoices from their own admin panel.
Hope this is helpful for you. If you have any issues, feel free to raise a ticket at https://webkul.uvdesk.com/en/.