> For the complete documentation index, see [llms.txt](https://codevision.gitbook.io/craft/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://codevision.gitbook.io/craft/saas.md).

# Software as a service

Website monetization.

In application it is possible to sell the subscriptions and get recurring revenue from the customers. Before starting with the subscription is is required to enable them in the **/admin** area under **Settings** page.

{% hint style="info" %}
When enabling subscription in settings, fill all organisation options so it will be possible to generate full fledged invoices.
{% endhint %}

Before customers can subscribe to a plan it is required to create a plans. Plan can be created in admin. It is possible to set the price, duration and per user options for the plan. After creating the subscription from the plan it is possible to change these options in subscription for particular users if needed.

{% hint style="info" %}
In plans it is **NOT** possible to set more granular options like which modules will be enable in the current plan.
{% endhint %}

**The flow of buying a subscription for a customer looks like:**

1. Under the organisation setting customer selects a plan
2. After selecting the plan customer is asked to select the payment gateway
3. If the payment gateway is Stripe, user is redirected to Stripe checkout
4. The background cron job is scheduling new Stripe payments if they are needed
5. After successful payment invoice is created

In case of selecting **offline payment**, customer is not charged immediately but the transfer must be made in for example by using wire transfer. Then the administrator must manually check the bank account and approve the subscriptions. This must be repeated each interval which is set for subscription because the subscription will expire. For extending the subscription in admin just click on **Pay** link.

Below you can find all additional configuration settings for .env file. After setting these parameter customers will be able to use Stripe for recurring payments. Otherwise only the offline payments will be available.

{% code title=".env" %}

```
STRIPE_PUBLISHABLE_KEY=key
STRIPE_SECRET_KEY=secret
```

{% endcode %}
