> 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 # GetQuotaInfo # Package: actions # Namespace: ActionProviderService # Method link: https://dev.wix.com/docs/api-reference/business-management/automations/actions/action-provider-service-plugin/get-quota-info.md ## Introduction This method retrieves quota information for an action. Wix calls this method when a Wix user opens the **Manage your automations quotas** modal in the **Automations** dashboard. The response from this method is displayed in the modal. The data is displayed based on the response body format. Implementing this method is optional. To implement it, select the method under **Service plugin endpoints** when editing your action in the app dashboard. > **Note:** > Wix doesn't enforce action quota limits. It only displays them to Wix users. > Enforcing quota limits is the action provider's responsibility. --- ## REST API ### Schema ``` Method: getQuotaInfo Description: This method retrieves quota information for an action. Wix calls this method when a Wix user opens the **Manage your automations quotas** modal in the **Automations** dashboard. The response from this method is displayed in the modal. The data is displayed based on the response body format. Implementing this method is optional. To implement it, select the method under **Service plugin endpoints** when editing your action in the app dashboard. > **Note:** > Wix doesn't enforce action quota limits. It only displays them to Wix users. > Enforcing quota limits is the action provider's responsibility. URL: null Method: POST # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present. Required parameters: actionKey Method parameters: param name: actionKey | type: actionKey | description: Action key as defined in your app's action configuration in the app dashboard. For example, `send-email` or `generate-invoice`. | required: true Return type: GetQuotaInfoResponse - name: actionQuotaInfo | type: ActionQuotaInfo | description: Details about the quotas for your action. - name: enforced | type: boolean | description: Whether the quotas for your action are enforced. If you mark this as `true` in the response body, Wix displays the information in the quota object on the site dashboard. If you mark this as `false` for a user, Wix does not display any quota info on the site dashboard for your service. - name: quotaInfo | type: array | description: The plans your service provides, together with the quotas enforced by each plan. A site may be enrolled in multiple plans. Plans and quotas can be related as follows: + A single plan has a single quota. + A single plan has multiple quotas. + Multiple plans are associated with multiple quotas. Plans and quotas that are related should be grouped together in a single `quotaInfo` object. - name: plans | type: array | description: List of plans associated with the site making the request. - name: id | type: string | description: Plan GUID defined by the action provider. - name: name | type: string | description: Plan name to display in the Wix user’s site dashboard. - name: quotas | type: array | description: List of quotas associated with the plans the site is enrolled in. - name: featureName | type: string | description: Name of the feature the quota is related to. For example, "Messages sent". - name: renewalDate | type: string | description: Quota renewal date in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. For example, 10 July 2020 at 15:00 is written as `2020-07-10 15:00:00.000`. - name: currentUsage | type: string | description: The user's current quota usage. - name: limit | type: string | description: Quota limit data. - name: additionalInfo | type: AdditionalInfo | description: Additional information about the quota. Displayed as a tooltip in the Wix user’s dashboard. - name: description | type: string | description: Tooltip content. - name: cta | type: CTA | description: Details for an options call-to-action link that appears in the tooltip. - name: url | type: string | description: Call-to-action redirect URL. - name: label | type: string | description: Call-to-action label. - name: upgradeCta | type: UpgradeCTA | description: Details for an upgrade call-to-action button. Displayed in the Wix user’s site dashboard together with the quota details. - name: url | type: string | description: CTA button redirect URL. - name: label | type: string | description: CTA button label. ``` ### Examples ### Get Quota Info sent by Wix Get Quota Info request with a sample response body ```curl curl -X POST https://provider.example.com/v1/quota-info \ -H 'user-agent: Wix' \ -H 'accept-encoding: gzip, deflate' \ -H 'content-type: text/plain; charset=utf-8' \ -d '{ "actionKey": "email-client", }' ``` --- ## JavaScript SDK ### Schema ``` Method: wixClientAdmin.actions.ActionProviderService.getQuotaInfo(request, metadata) Description: This method retrieves quota information for an action. Wix calls this method when a Wix user opens the **Manage your automations quotas** modal in the **Automations** dashboard. The response from this method is displayed in the modal. The data is displayed based on the response body format. Implementing this method is optional. To implement it, select the method under **Service plugin endpoints** when editing your action in the app dashboard. > **Note:** > Wix doesn't enforce action quota limits. It only displays them to Wix users. > Enforcing quota limits is the action provider's responsibility. Method parameters: param name: metadata | type: Context | description: this message is not directly used by any service, it exists to describe the expected parameters that SHOULD be provided to invoked Velo methods as part of open-platform. e.g. SPIs, event-handlers, etc.. NOTE: this context object MUST be provided as the last argument in each Velo method signature. Example: ```typescript export function wixStores_onOrderCanceled({ event, metadata }: OrderCanceledEvent) { ... } ``` - name: requestId | type: string | description: A unique identifier of the request. You may print this GUID to your logs to help with future debugging and easier correlation with Wix's logs. - name: currency | type: string | description: [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) 3-letter currency code. - name: identity | type: IdentificationData | description: An object that describes the identity that triggered this request. - ONE-OF: - name: anonymousVisitorId | type: string | description: GUID of a site visitor that has not logged in to the site. - name: memberId | type: string | description: GUID of a site visitor that has logged in to the site. - name: wixUserId | type: string | description: GUID of a Wix user (site owner, contributor, etc.). - name: appId | type: string | description: GUID of an app. - name: languages | type: array | description: A string representing a language and region in the format of `"xx-XX"`. First 2 letters represent the language code according to ISO 639-1. This is followed by a dash "-", and then a by 2 capital letters representing the region according to ISO 3166-2. For example, `"en-US"`. - name: instanceId | type: string | description: The service provider app's instance GUID. param name: request | type: GetQuotaInfoRequest - name: actionKey | type: string | description: Action key as defined in your app's action configuration in the app dashboard. For example, `send-email` or `generate-invoice`. Return type: PROMISE - name: actionQuotaInfo | type: ActionQuotaInfo | description: Details about the quotas for your action. - name: enforced | type: boolean | description: Whether the quotas for your action are enforced. If you mark this as `true` in the response body, Wix displays the information in the quota object on the site dashboard. If you mark this as `false` for a user, Wix does not display any quota info on the site dashboard for your service. - name: quotaInfo | type: array | description: The plans your service provides, together with the quotas enforced by each plan. A site may be enrolled in multiple plans. Plans and quotas can be related as follows: + A single plan has a single quota. + A single plan has multiple quotas. + Multiple plans are associated with multiple quotas. Plans and quotas that are related should be grouped together in a single `quotaInfo` object. - name: plans | type: array | description: List of plans associated with the site making the request. - name: _id | type: string | description: Plan GUID defined by the action provider. - name: name | type: string | description: Plan name to display in the Wix user’s site dashboard. - name: quotas | type: array | description: List of quotas associated with the plans the site is enrolled in. - name: featureName | type: string | description: Name of the feature the quota is related to. For example, "Messages sent". - name: renewalDate | type: Date | description: Quota renewal date in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. For example, 10 July 2020 at 15:00 is written as `2020-07-10 15:00:00.000`. - name: currentUsage | type: string | description: The user's current quota usage. - name: limit | type: string | description: Quota limit data. - name: additionalInfo | type: AdditionalInfo | description: Additional information about the quota. Displayed as a tooltip in the Wix user’s dashboard. - name: description | type: string | description: Tooltip content. - name: cta | type: CTA | description: Details for an options call-to-action link that appears in the tooltip. - name: url | type: string | description: Call-to-action redirect URL. - name: label | type: string | description: Call-to-action label. - name: upgradeCta | type: UpgradeCTA | description: Details for an upgrade call-to-action button. Displayed in the Wix user’s site dashboard together with the quota details. - name: url | type: string | description: CTA button redirect URL. - name: label | type: string | description: CTA button label. ``` ### Examples ### getQuotaInfo ```javascript import { actionProvider } from '@wix/automations/service-plugins'; async function getQuotaInfo(request,metadata) { const response = await actionProvider.getQuotaInfo(request,metadata); }; ``` ### getQuotaInfo (with elevated permissions) ```javascript import { actionProvider } from '@wix/automations/service-plugins'; import { auth } from '@wix/essentials'; async function myGetQuotaInfoMethod(request,metadata) { const elevatedGetQuotaInfo = auth.elevate(actionProvider.getQuotaInfo); const response = await elevatedGetQuotaInfo(request,metadata); } ``` ### getQuotaInfo (self-hosted) Self-hosted SDK calls require you to [create a client](https://dev.wix.com/docs/sdk/articles/work-with-the-sdk/about-the-wix-client.md). ```javascript import { createClient } from '@wix/sdk'; import { actionProvider } from '@wix/automations/service-plugins'; // Import the auth strategy for the relevant access type // Import the relevant host module if needed const myWixClient = createClient ({ modules: { actionProvider }, // Include the auth strategy and host as relevant }); async function getQuotaInfo(request,metadata) { const response = await myWixClient.actionProvider.getQuotaInfo(request,metadata); }; ``` ---