====================== Fleio billing concepts ====================== Fleio billing combines the traditional billing seen in the web hosting industry and the new, more dynamic billing, seen mostly with cloud services providers. With a traditional billing approach, as a provider of services you assume a product has a fixed price during the entire billing period, Monthly or similar (every 3 months, or 6 months, yearly a.s.o.). The price being fixed, it's easy to issue invoices in advance, since you and the customer know what the price at the end of the month or period is at any given time. Addons and/or additional configurations allow for price modifications during the billing period, however, the price is mostly fixed and known in advance. The new way of doing billing for services doesn't make an assumption about the price related to the billing period. Instead a fixed price is added for a small amount of time, say 1 hour or even 1 second. In this way, the provider is able to charged only for the period the resources were used. As an example, let's assume a customer buys a server that costs 5 USD Monthly. With the traditional billing approach, he is charged the entire amount upfront or at the end of the month even if he terminated the server 15 days after it was bought. A provider may decide to issue partial refunds if the customer asks and as long as the number of customers is small. Imagining an entire cluster for a single large application, constantly bringing servers up and down during different periods when resources are needed more or less, it's clear that manually handling billing with a monthly fixed price is cumbersome. The above case fits perfectly with the dynamic resource billing where a price is set for a second of usage of a given resource. Of course, each billing type has it's own applications and one is not actually better than the other. As a second example, a customer having a single shared hosting account for his website, will not delete and create his account during a month. Fleio products ============== A Fleio product is any product that you wish to make available to a customer like a shared hosting account or a cloud account where different resource types can be created like servers, networks, storage and others. The product is easy to understand, it has the usual name, description, a type and how pricing and activation is handled. The product internal code is used mainly for simplifying API calls and the ordering process. It's easier to refer to a product by a code written in words than to use a generated database ID. Always try to set a human readable code. Usually letters, numbers and underscores are good candidates. Example: cpanel_starting_product The group and product type have only an organizational role. It's easier to see a group or type of product and to modify it. The product module is an important part of the product. A module decides what is created, where and how. The cPanel module knows how to connect to a WHM server and to create an account. Similarly, the OpenStack module knows how to talk to OpenStack and to create a new OpenStack Project for a customer. Fleio has 3 types of pricing models: * **Free** - the product is free, no pricing is applied * **Fixed plus dynamic** - a fixed price is charged, if grater than zero plus a dynamic price is calculated by the module The dynamic price in the case of the OpenStack module is the total price of resources used during the billing period (or cycle). As an example, creating a server that costs 0.0015 USD / Hour will have a dynamic price of 10 USD at the end of a month or 5 USD if the server is removed after 15 days. That is why an OpenStack product usually has a fixed price set to zero. * **Dynamic but at least fixed** - this is similar to *Fixed plus dynamic* except that when a fixed price is set, the total cost of the product at the end of the month is either the fixed price or the dynamic price, whichever is greater. The product status determines if a product is available for order to customers. A **Public** status means the product can be ordered at any time. A **Private** product will not appear on the order page and is only visible to staff. You can use these products if you wish to directly associate them with customers. The **Retired** status is intended to mark a product as retired. It still exists but can't be ordered anymore or upgraded/downgraded to. The auto setup option determines when and if a product is automatically created: * **Disabled** - automatic setup is disabled, staff can still create the product manually * **When order is placed** - product is created as soon as the order is placed * **On first payment** - the product is created only after the order invoice for it is paid * **When pending order is accepted** - the product is created only after a staff member reviews and accepts the order The check to apply taxes to a product is mostly used by European companies to apply taxes based on the country and/or state a customer reside in. If unchecked, no taxes will be applied, otherwise the Fleio tax rules are taken into account. Depending on the module selected, a new **MODULE CONFIGURATION** tab may appear. This tab contains settings specific to each module. In the case of cPanel, it allows the setting of the server group used to create a new account and the cPanel product for the account creation. Fleio product pricing (billing cycles) ====================================== Invoices are issued in a defined period of time, usually once a month or depending on the product, yearly for domains or a derivation of these periods. A Fleio product has one or more billing cycles (time frames for calculating prices and invoicing a customer), unless the product is free. Pricing for a product is given by the billing cycles of that product. The base billing cycles are: * **One Time** - a one time charge will take place only * **Hour** - every hour, not really a common option but this allows to charge every 2 weeks for example * **Month** - every one or more months depending on the multiplier * **Year** - every one or more years, especially useful for domain names Setting a multiplier for the billing cycles allows a custom cycle in various ways. Example: Month with a multiplier of 3 means every 3 months or commonly known as quarterly. A cycle has a fixed price which can be greater or equal to zero. Setting a price of say 5 USD with the Month cycle and a multiplier of 1 means the product is charged a fixed amount of 5 USD every month. Setting the fixed price to zero is usually useful for products which support dynamic pricing. For example, an OpenStack product with the **Fixed plus dynamic** price model set, will always have a dynamic price based on the resources used. If a fixed price is also set, that price is always charged regardless of the usage done by a customer. A cPanel product requires a fixed price since the module does not calculate any dynamic price for it. The rule is to set a fix price greater then zero when no dynamic pricing is calculated or when you wish to charge a fixed amount for a product over the dynamic price. For OpenStack, a fixed price of zero is ok, and at least a monthly cycle needs to exists, otherwise invoicing will not take place for that product and dynamic pricing will not be calculated. The **Setup fee** amount is as the name implies, a setup fee. It can be zero or greater if you wish to charge a fixed amount the first time a product is created for a customer. The *Setup fee entire quantity* check will apply the setup fee for all products only once if checked or for each product separately if unchecked. The cycle status determines if it's available when the product is ordered or not. A private or retired status does not appear on the order form. Always add a public billing cycle for a product that is not free, to make it available during the ordering process. Fleio supports multiple currencies, and as such, a similar cycle should be created for each currency since prices can differ or you wish to charge differently based on currency. After the first cycle is added to a product, customers will be able to order that product. Fleio configurable options (Config. options) ============================================ Not all products are the same and Fleio also support and sometimes require configurable options. A configurable option as the name implies is an input that appears on the order form requiring additional information. In the case of a cPanel account, the domain name is required, otherwise the account cannot be created. Consult the module documentation to see all the available and required configurable options. All configurable options have billing cycles that need to match the billing cycles of the products associated with them in order to properly calculate any price. In some cases you do not wish to charge anything, especially if a customer enters a domain name for a cPanel account. In those cases a billing cycle needs to exist for the configurable option but with a price of zero.