Plan management
Fatture in Cloud offers different plans, which differ by price, limits, and enabled features. The plan details are on the dedicated page.
As a developer, you may need to check the current user's plan to determine whether a certain feature is enabled for the selected company. Here, we explain how to check the current plan details and limits so you can manage our APIs properly.
☁️ Plan Details and expiration
Two of the use cases that require knowing the company's Fatture in Cloud plan and license expiration are the following:
- You want to know if the current company can use a certain Fatture in Cloud feature
- You want to avoid executing API calls after expiration
To retrieve the plan details and expiration you have two possibilities that differ by input parameters and returned information.
The first one is to use the List User Companies method. As explained in the Company-scoped methods page, this method is really useful when we don't know the Company ID of the current user, so it is probable that you are already using it then the user starts using your integration.
The List User Companies method will return two parameters for each company in the list:
- data.companies[].fic_plan: The name of the Fatture in Cloud plan associated with the Company
- data.companies[].fic_license_expire: The date of the license's expiration associated with the Company
Once you retrieved the Company ID (for example, because already used the previous method, or because you need to manage your own Company), you can also proceed using the Get Company Info method. In this case, the method is company-scoped, so you need to declare the Company ID as a URL parameter; the advantage is that the method returns additional details that can be really useful for your integration.
The Get Company Info method will return these two parameters, equivalent to the two explained above:
- data.fic_plan_name: The name of the Fatture in Cloud plan associated with the Company
- data.fic_license_expire: The date of the license's expiration associated with the Company
Additionally, the data.plan_info parameter will contain some useful details related to the current plan, such as the plan limits and the enabled functions.
⚠️ Quota Usage
Every Fatture in Cloud plan has an associated resource limit, as explained on the dedicated page.
This limit is not API-related, but is enforced also by our web page and mobile app; of course, if your API request exceeds the current limit, you'll receive an error as a result.
If you need to know the limit and the current usage for the Company you're managing, we provide the Get Company Plan Usage method.
To use this method, you need to identify the resource type you're interested in, and you must insert it in the request in the category query-string param; the accepted values are:
- clients
- suppliers
- products
- documents
When executed, the method will return the following results:
- data.limit: The current plan's limit for the resource type
- data.usage: The usage for the resource type
This means that you'll be able to create new resources until when the usage value is less than the limit, otherwise, you'll receive an error for every Create method associated with this resource type.
Please, note that the document limit is an annual limit (it means that the usage is reset every year), while the other resource type limits are global limits (it means that the usage counts every registered resource, regardless of the creation date).