> Portal Navigation:
>
> - Append `.md` to any URL under `https://dev.wix.com/docs/` to get its markdown version.
> - Pages are either content pages (article or reference text) or menu pages (a list of links to child pages).
> - To get a menu page, truncate any URL to a parent path and append `.md` (e.g. `https://dev.wix.com/docs/sdk.md`, `https://dev.wix.com/docs/sdk/core-modules.md`).
> - Top-level index of all portals: https://dev.wix.com/docs/llms.txt
> - Full concatenated docs: https://dev.wix.com/docs/llms-full.txt
## Resource: Displaying Action Quotas
## Article: Displaying Action Quotas
## Article Link: https://dev.wix.com/docs/api-reference/business-management/automations/actions/action-provider-service-plugin/displaying-action-quotas.md
## Article Content:
# Displaying Action Quotas
As an action provider, you can enforce limits on the number of times a Wix user uses an action. For example, you can limit the number of messages a user can send per billing cycle.
You can enforce different quotas on specific features of the app, depending on the user. For example, your app might have a basic plan that allows a Wix user to send 500 emails a month, and a premium plan that lets a Wix user send unlimited emails.
## Terminology
+ **Quota**: A limit on the number of times a Wix user can perform an action.
+ **Plan**: Allows you to set different quotas for different users.
## Creating and enforcing quotas
You are responsible for enforcing quotas for features used by your actions. If the features provided by your service have quotas you can implement the [Get Quota Info](https://dev.wix.com/docs/rest/business-management/automations/actions/action-provider-service-plugin/get-quota-info.md) method so that Wix can display your quotas in the user's site dashboard.
Wix displays the quotas in the **Manage your automations quotas** modal. This modal opens when Wix users click the **Manage Your Quotas** button on the Automations page in the dashboard.
The modal lists the quotas for all the features used by the site's automations. The list is organized by the apps providing the features.
You can define the different elements of each quota display in the responses from your Get Quota Info method. In general, each quota display includes a plan, and the plan features associated with it. The current usage and limit for each feature is displayed.
### One plan with one feature
To display one plan with a single feature quota, include the plan and quota data in the same `quotaInfo` object in your method’s response.
Sample response body:
```json
{
"enforced": true,
"quotaInfo":[
{
"plans": [
{
"id": "fdc7fe4b-523f-4d8c-b6e1-5faf3850d01e",
"name": "Reminder emails"
}
],
"quotas":
[
{
"featureName": "Reminders sent",
"currentUsage": "10",
"limit": "40"
},
{
"featureName": "Tasks created",
"renewalDate": "2022-01-12T01:20:00.000Z",
"currentUsage": "346",
"limit": "500"
}
],
"upgradeCta": {
"url": "https://www.example.com/upgrade",
"label": "Upgrade For More"
}
}
]
}
```
The resulting quota display looks like this:
### One plan with two features
To display one plan with a single feature quota, include the plan and quota data in the same `quotaInfo` object in your method’s response.
Sample response body:
```json
{
"enforced": true,
"quotaInfo":[
{
"plans": [
{
"id": "f32c650f-ecc4-4818-a81c-8fa681e325a6",
"name": "Email Marketing"
}
],
"quotas":[
{
"featureName":"Emails sent",
"currentUsage":"346",
"limit":"500",
"renewalDate":"2023-01-12T01:20:00.000Z"
}
],
"upgradeCta": {
"url": "https://www.example.com/upgrade",
"label": "Upgrade Email Plan"
}
}
]
}
```
The resulting quota display should look something like this:
### Two plans with different features
To display two different plans with different features that are both being used by your action service, include two `quotaInfo` objects in your response body.
Sample response body:
```json
{
"enforced": true,
"quotaInfo": [
{
"plans": [
{
"id": "94e55e1f-b845-47a5-afad-4b8fc977d545",
"name": "Forms on your site"
}
],
"quotas": [
{
"featureName": "Forms on your site",
"currentUsage": "6",
"limit": "40"
}
],
"upgradeCta": {
"url": "https://www.example.com/upgrade",
"label": "Upgrade For More",
"planId": "fd9830b5-ce89-495f-87e8-30893168afd9"
}
},
{
"plans": [
{
"id": "c7f255a5-0aa2-47ad-9607-8f87ea56df5b",
"name": "Code Forms on your site"
}
],
"quotas": [
{
"featureName": "Code Forms on your site",
"currentUsage": "1",
"limit": "20"
}
],
"upgradeCta": {
"url": "https://www.example.com/upgrade",
"label": "Upgrade For More",
"planId": "b19345c1-380c-4fc6-8e45-9f7f72b3de5f"
}
}
]
}
```
The resulting quota display looks like this:
### Unlimited plans
If your service supports a plan where features are unlimited, you can still display the Wix user’s current usage. To do this, provide a `quotaInfo` object with the relevant plan details. Include the feature’s name and current usage, but not a usage limit.
Sample response body:
```json
{
"enforced": true,
"quotaInfo": [
{
"plans": [
{
"id": "1ccaa3a5-4994-4e17-b1d4-2fa3f76418e7",
"name": "Marketing Emails"
}
],
"quotas": [
{
"featureName": "Emails",
"currentUsage": "150"
}
]
}
]
}
```
The resulting quota display should look like this:
### User hasn't purchased a plan
If your service enforces a quota on a feature that a Wix user hasn’t paid for, you can display this in the dashboard. This lets the user know that your action isn’t running when their automation is triggered. To display this, set both the current usage and limit for the feature to `0` in the relevant `quotaInfo` object in your response body.
Sample response body:
```json
{
"enforced": true,
"quotaInfo": [
{
"plans": [
{
"id": "d0a9fa93-f2a7-426a-89d6-a15d2e7c0d78",
"name": "Marketing Emails"
}
],
"quotas":[
{
"featureName": "Monthly Emails",
"renewalDate": "",
"currentUsage": "0",
"limit": "0"
}
],
"upgradeCta": {
"url": "https://www.example.com/upgrade",
"label": "Upgrade",
"planId": "28d52c9c-7c59-4a14-bbc1-a7d9103e1038"
}
}
]
}
```
## Quota descriptions
You can define a tooltip that provides more details about a feature quota. To display the tooltip, add an `additionalInfo` object together with the feature details.
Sample response body:
```json
{
"enforced": true,
"quotaInfo": [
{
"plans": [
{
"id": "fa9bbb78-286f-46b4-83fe-4aa81d94c715",
"name": "Marketing Messages"
}
],
"quotas": [
{
"featureName": "SMS sent",
"renewalDate": "",
"currentUsage": "400",
"limit": "1200",
"additionalInfo": {
"description": "Your SMS quota will renew each month. Any remaining messages won't roll over to the next month.",
"cta": {
"url": "/home",
"label": "Go to SMS Settings"
}
}
}
],
"upgradeCta": {
"planId": "e15d2206-4226-4815-8684-41b101c7dcad",
"url": "https://www.example.com/upgrade",
"label": "Upgrade"
}
}
]
}
```
You should now see a message when you hover over the tooltip icon: