> 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

# Package: pricingPlans

# Namespace: plansV3

# Webhook link: https://dev.wix.com/docs/api-reference/business-solutions/pricing-plans/plans-v3/plan-tags-modified.md

# Webhook Permissions Scopes IDs:
Read Pricing Plans: SCOPE.DC-PAIDPLANS.READ-PLANS

## Introduction

Triggered when tags are assigned to or unassigned from a plan.

---

## REST API

### Schema

```
Webhook: Plan Tags Modified
Description: Triggered when tags are assigned to or unassigned from a plan.
Event body:
 - name: id | type: string | description: Unique event ID. Allows clients to ignore duplicate events.
 - name: entityFqdn | type: string | description: Fully qualified domain name of the entity associated with the event.
 - name: slug | type: string | description: Event name.
 - name: entityId | type: string | description: ID of the entity associated with the event.
 - name: eventTime | type: string (date-time) | description: Event timestamp.
 - name: triggeredByAnonymizeRequest | type: boolean | description: Whether the event was triggered as a result of a privacy regulation application such as GDPR.
 - name: originatedFrom | type: string | description: If present, indicates the action that triggered the event.
 - name: actionEvent | type: object | description: Custom action event details.
    - name: body | type: PlanTagsModified | description: The event body.
        - name: plan | type: Plan | description: The plan whose tags were modified.
           - name: id | type: string | description: Plan GUID.
           - name: revision | type: string | description: Revision number, which increments by 1 each time the plan is updated.
           - name: createdDate | type: string | description: Date and time the plan was created.
           - name: updatedDate | type: string | description: Date and time the plan was last updated.
           - name: name | type: string | description: Plan name displayed to customers.
           - name: description | type: string | description: Plan description that explains what customers get with this plan.
           - name: image | type: Image | description: Plan image displayed during checkout and on the site's **Plans & Pricing** page.
              - name: id | type: string | description: WixMedia image GUID.
              - name: height | type: integer | description: Original image height.
              - name: width | type: integer | description: Original image width.
              - name: altText | type: string | description: Image alt text.
           - name: slug | type: string | description: Unique identifier for this plan within the Wix site. If not provided, generated automatically from the plan name.
           - name: termsAndConditions | type: string | description: Terms and conditions text that customers must agree to when purchasing this plan.
           - name: pricingVariants | type: array<PricingVariant> | description: Pricing variants that define different billing and pricing options for this plan. Currently limited to 1 variant per plan.
              - name: id | type: string | description: Pricing variant GUID.
              - name: name | type: string | description: Name for this pricing variant, such as "Monthly" or "Yearly".
              - name: freeTrialDays | type: integer | description: Number of days customers can use the plan for free before the first charge. Set to `0` for no free trial.
              - name: fees | type: array<Fee> | description: Additional fees applied to this pricing variant.
                 - ONE-OF:
                    - name: fixedAmountOptions | type: FixedAmountOption | description: Fixed monetary amount for the fee.
                       - name: amount | type: string | description: Fixed monetary amount.
                 - name: id | type: string | description: 
                 - name: priceType | type: PriceType | description: Pricing type used for this fee.
                       - enum:
                       -     FIXED_AMOUNT: Fee is charged as a fixed monetary amount.
                 - name: name | type: string | description: Fee name displayed to customers, such as "Setup Fee" or "Processing Fee".
                 - name: appliedAt | type: AppliedAt | description: When this fee is charged during the customer's plan lifecycle.
                       - enum:
                       -     FIRST_PAYMENT: Fee is added to the first payment.
              - name: billingTerms | type: BillingTerms | description: Billing configuration that defines when and how often customers are charged.
                 - ONE-OF:
                    - name: cyclesCompletedDetails | type: CyclesCompletedDetails | description: How many billing cycles the plan lasts.
                       - name: billingCycleCount | type: string | description: Number of billing cycles before the plan automatically ends. For example, if `billingCycle` is 3 months and `billingCycleCount` is 4, the customer will be charged 4 times over 12 months before the plan expires. Only applicable if `endType` is `CYCLES_COMPLETED`.
                 - name: billingCycle | type: Duration | description: Duration of each billing cycle, such as 1 month or 2 weeks. Can't be less than 7 days. Only applicable for recurring plans.
                    - name: period | type: Period | description: Duration of period.
                           - enum: DAY, WEEK, MONTH, YEAR
                    - name: count | type: string | description: Number of periods.
                 - name: startType | type: StartType | description: When the billing starts.
                       - enum:
                       -     ON_PURCHASE: Billing starts immediately after purchase.
                       -     CUSTOM: Customer can choose when billing starts.
                 - name: endType | type: EndType | description: How long the plan remains active. Plans can run until canceled or for a specific number of billing cycles. Plan duration can't exceed 10 years.
                       - enum:
                       -     UNTIL_CANCELLED: Plan continues until customer cancels.
                       -     CYCLES_COMPLETED: Plan ends after a specified number of billing cycles.
              - name: promotion | type: string | description: Promotional message displayed with this pricing variant.
              - name: pricingStrategies | type: array<PricingStrategy> | description: Pricing strategies that determine how much customers pay. Currently limited to 1 strategy per variant.
                 - ONE-OF:
                    - name: flatRate | type: FlatRate | description: Single fixed cost charged regardless of usage.
                       - name: amount | type: string | description: Fixed monetary amount.
           - name: perks | type: array<Perk> | description: List of text snippets describing what the plan offers. For display purposes only.
              - name: id | type: string | description: Perk GUID.
              - name: description | type: string | description: Perk description.
           - name: visibility | type: Visibility | description: Plan visibility.
               - enum:
               -     PUBLIC: Plan is visible and available for purchase by all customers.
               -     PRIVATE: Plan isn't visible to new customers unless they get a specific link to the plan. Existing buyers can continue using it.
           - name: buyable | type: boolean | description: Whether customers can currently purchase this plan. If set to `false`, customer won't be able to buy a plan themselves. In this case a Wix user has to assign the plan through the [dashboard](https://support.wix.com/en/article/pricing-plans-selling-plans-offline).
           - name: formId | type: string | description: GUID of the form associated with the plan at checkout.
           - name: buyerCanCancel | type: boolean | description: Whether buyers can cancel their subscription to this plan.
           - name: currency | type: string | description: Three-letter currency code in [ISO-4217 alphabetic](https://en.wikipedia.org/wiki/ISO_4217#Active_codes) format. When the site currency changes, monetary amounts stored on the plan (prices, fees, and override amounts) are automatically rounded to the number of decimal places supported by the new currency.
           - name: purchaseLimits | type: array<PurchaseLimit> | description: Caps how many subscriptions buyers can have or the site can sell for this plan. When multiple types are present, all must pass (AND logic). Duplicate types are rejected by the server.
              - name: type | type: PurchaseLimitType | description: The type of purchase limit.
                   - enum:
                   -     PER_MEMBER_LIFETIME: Limits the total number of subscriptions (any status) a single member can have over their lifetime.
                   -     PER_MEMBER_ACTIVE: Limits the number of ongoing (ACTIVE, PENDING, PAUSED) subscriptions a single member can have at any time.
                   -     TOTAL_ACTIVE: Limits the total number of ongoing (ACTIVE, PENDING, PAUSED) subscriptions across all members at any time.
                   -     TOTAL_SOLD: Limits the total number of subscriptions ever created (any status) across all members.
              - name: maxCount | type: integer | description: The maximum number of subscriptions allowed.
           - name: tags | type: Tags | description: Tags that can be assigned to this plan for classification and filtering.
              - name: privateTags | type: TagList | description: Tags that require an additional permission in order to access them, normally not given to site members or visitors.
                 - name: tagIds | type: array<string> | description: List of tag GUIDs
              - name: publicTags | type: TagList | description: Tags that are exposed to anyone who has access to the labeled entity itself, including site members and visitors.
           - name: extendedFields | type: ExtendedFields | description: Data extensions. Learn more about [extended fields](https://dev.wix.com/docs/build-apps/develop-your-app/extensions/backend-extensions/schema-plugins/about-schema-plugin-extensions.md).
              - name: namespaces | type: object | description: Extended field data. Each key corresponds to the namespace of the app that created the extended fields. The value of each key is structured according to the schema defined when the extended fields were configured.  You can only access fields for which you have the appropriate permissions.  Learn more about [extended fields](https://dev.wix.com/docs/rest/articles/getting-started/extended-fields.md).
        - name: assignedTags | type: Tags | description: Tags assigned to the plan.
        - name: unassignedTags | type: Tags | description: Tags unassigned from the plan.

```

### Examples


```curl
{
  "id": "01989a45-eff0-4c17-8039-869890743a64",
  "entityFqdn": "wix.pricing_plans.v3.plan",
  "slug": "tags_modified",
  "entityId": "5d1c47f5-0ec7-4c9c-9f9c-a87be388e3f9",
  "actionEvent": {
    "bodyAsJson": {
      "plan": {
        "id": "5d1c47f5-0ec7-4c9c-9f9c-a87be388e3f9",
        "revision": "2",
        "createdDate": "2024-09-17T10:38:38.609Z",
        "updatedDate": "2024-09-18T08:12:04.318Z",
        "name": "Professional Studio",
        "slug": "professional-studio",
        "maxPurchasesPerBuyer": 0,
        "pricingVariants": [
          {
            "id": "6304bd66-128e-454e-8c95-e389b78cc7e1",
            "name": "Monthly",
            "freeTrialDays": 0,
            "fees": [],
            "billingTerms": {
              "billingCycle": {
                "period": "MONTH",
                "count": "1"
              },
              "startType": "ON_PURCHASE",
              "endType": "UNTIL_CANCELLED"
            },
            "pricingStrategies": [
              {
                "flatRate": {
                  "amount": "5.99"
                }
              }
            ]
          }
        ],
        "perks": [
          {
            "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
            "description": "24/7 priority customer support"
          }
        ],
        "visibility": "PUBLIC",
        "buyable": true,
        "status": "ACTIVE",
        "buyerCanCancel": true,
        "archived": false,
        "primary": false,
        "currency": "EUR",
        "tags": {
          "publicTags": {
            "tagIds": [
              "vN3xQ"
            ]
          }
        }
      },
      "assignedTags": {
        "publicTags": {
          "tagIds": [
            "vN3xQ"
          ]
        }
      },
      "unassignedTags": {
        "publicTags": {
          "tagIds": [
            "gY7dW"
          ]
        }
      }
    }
  },
  "eventTime": "2024-09-18T08:12:04.318234Z",
  "triggeredByAnonymizeRequest": false,
  "entityEventSequence": "2"
}

```

---

## JavaScript SDK

### Schema

```
Webhook: onPlanTagsModified
Description: Triggered when tags are assigned to or unassigned from a plan.
Payload: PlanTagsModifiedEnvelope
  - name: data | type: PlanTagsModified | description: none
     - name: plan | type: Plan | description: The plan whose tags were modified.
        - name: _id | type: string | description: Plan GUID.
        - name: revision | type: string | description: Revision number, which increments by 1 each time the plan is updated.
        - name: _createdDate | type: Date | description: Date and time the plan was created.
        - name: _updatedDate | type: Date | description: Date and time the plan was last updated.
        - name: name | type: string | description: Plan name displayed to customers.
        - name: description | type: string | description: Plan description that explains what customers get with this plan.
        - name: image | type: string | description: Plan image displayed during checkout and on the site's **Plans & Pricing** page.
        - name: slug | type: string | description: Unique identifier for this plan within the Wix site. If not provided, generated automatically from the plan name.
        - name: termsAndConditions | type: string | description: Terms and conditions text that customers must agree to when purchasing this plan.
        - name: pricingVariants | type: array<PricingVariant> | description: Pricing variants that define different billing and pricing options for this plan. Currently limited to 1 variant per plan.
           - name: _id | type: string | description: Pricing variant GUID.
           - name: name | type: string | description: Name for this pricing variant, such as "Monthly" or "Yearly".
           - name: freeTrialDays | type: integer | description: Number of days customers can use the plan for free before the first charge. Set to `0` for no free trial.
           - name: fees | type: array<Fee> | description: Additional fees applied to this pricing variant.
              - ONE-OF:
                 - name: fixedAmountOptions | type: FixedAmountOption | description: Fixed monetary amount for the fee.
                    - name: amount | type: string | description: Fixed monetary amount.
              - name: _id | type: string | description: 
              - name: priceType | type: PriceType | description: Pricing type used for this fee.
                     - enum:
                     -     FIXED_AMOUNT: Fee is charged as a fixed monetary amount.
              - name: name | type: string | description: Fee name displayed to customers, such as "Setup Fee" or "Processing Fee".
              - name: appliedAt | type: AppliedAt | description: When this fee is charged during the customer's plan lifecycle.
                     - enum:
                     -     FIRST_PAYMENT: Fee is added to the first payment.
           - name: billingTerms | type: BillingTerms | description: Billing configuration that defines when and how often customers are charged.
              - ONE-OF:
                 - name: cyclesCompletedDetails | type: CyclesCompletedDetails | description: How many billing cycles the plan lasts.
                    - name: billingCycleCount | type: string | description: Number of billing cycles before the plan automatically ends. For example, if `billingCycle` is 3 months and `billingCycleCount` is 4, the customer will be charged 4 times over 12 months before the plan expires. Only applicable if `endType` is `CYCLES_COMPLETED`.
              - name: billingCycle | type: Duration | description: Duration of each billing cycle, such as 1 month or 2 weeks. Can't be less than 7 days. Only applicable for recurring plans.
                 - name: period | type: Period | description: Duration of period.
                         - enum: DAY, WEEK, MONTH, YEAR
                 - name: count | type: string | description: Number of periods.
              - name: startType | type: StartType | description: When the billing starts.
                     - enum:
                     -     ON_PURCHASE: Billing starts immediately after purchase.
                     -     CUSTOM: Customer can choose when billing starts.
              - name: endType | type: EndType | description: How long the plan remains active. Plans can run until canceled or for a specific number of billing cycles. Plan duration can't exceed 10 years.
                     - enum:
                     -     UNTIL_CANCELLED: Plan continues until customer cancels.
                     -     CYCLES_COMPLETED: Plan ends after a specified number of billing cycles.
           - name: promotion | type: string | description: Promotional message displayed with this pricing variant.
           - name: pricingStrategies | type: array<PricingStrategy> | description: Pricing strategies that determine how much customers pay. Currently limited to 1 strategy per variant.
              - ONE-OF:
                 - name: flatRate | type: FlatRate | description: Single fixed cost charged regardless of usage.
                    - name: amount | type: string | description: Fixed monetary amount.
        - name: perks | type: array<Perk> | description: List of text snippets describing what the plan offers. For display purposes only.
           - name: _id | type: string | description: Perk GUID.
           - name: description | type: string | description: Perk description.
        - name: visibility | type: Visibility | description: Plan visibility.
             - enum:
             -     PUBLIC: Plan is visible and available for purchase by all customers.
             -     PRIVATE: Plan isn't visible to new customers unless they get a specific link to the plan. Existing buyers can continue using it.
        - name: buyable | type: boolean | description: Whether customers can currently purchase this plan. If set to `false`, customer won't be able to buy a plan themselves. In this case a Wix user has to assign the plan through the [dashboard](https://support.wix.com/en/article/pricing-plans-selling-plans-offline).
        - name: formId | type: string | description: GUID of the form associated with the plan at checkout.
        - name: buyerCanCancel | type: boolean | description: Whether buyers can cancel their subscription to this plan.
        - name: currency | type: string | description: Three-letter currency code in [ISO-4217 alphabetic](https://en.wikipedia.org/wiki/ISO_4217#Active_codes) format. When the site currency changes, monetary amounts stored on the plan (prices, fees, and override amounts) are automatically rounded to the number of decimal places supported by the new currency.
        - name: purchaseLimits | type: array<PurchaseLimit> | description: Caps how many subscriptions buyers can have or the site can sell for this plan. When multiple types are present, all must pass (AND logic). Duplicate types are rejected by the server.
           - name: type | type: PurchaseLimitType | description: The type of purchase limit.
                 - enum:
                 -     PER_MEMBER_LIFETIME: Limits the total number of subscriptions (any status) a single member can have over their lifetime.
                 -     PER_MEMBER_ACTIVE: Limits the number of ongoing (ACTIVE, PENDING, PAUSED) subscriptions a single member can have at any time.
                 -     TOTAL_ACTIVE: Limits the total number of ongoing (ACTIVE, PENDING, PAUSED) subscriptions across all members at any time.
                 -     TOTAL_SOLD: Limits the total number of subscriptions ever created (any status) across all members.
           - name: maxCount | type: integer | description: The maximum number of subscriptions allowed.
        - name: tags | type: Tags | description: Tags that can be assigned to this plan for classification and filtering.
           - name: privateTags | type: TagList | description: Tags that require an additional permission in order to access them, normally not given to site members or visitors.
              - name: tagIds | type: array<string> | description: List of tag GUIDs
           - name: publicTags | type: TagList | description: Tags that are exposed to anyone who has access to the labeled entity itself, including site members and visitors.
        - name: extendedFields | type: ExtendedFields | description: Data extensions. Learn more about [extended fields](https://dev.wix.com/docs/build-apps/develop-your-app/extensions/backend-extensions/schema-plugins/about-schema-plugin-extensions.md).
           - name: namespaces | type: object | description: Extended field data. Each key corresponds to the namespace of the app that created the extended fields. The value of each key is structured according to the schema defined when the extended fields were configured.  You can only access fields for which you have the appropriate permissions.  Learn more about [extended fields](https://dev.wix.com/docs/rest/articles/getting-started/extended-fields.md).
     - name: assignedTags | type: Tags | description: Tags assigned to the plan.
     - name: unassignedTags | type: Tags | description: Tags unassigned from the plan.
  - name: metadata | type: EventMetadata | description: none
     - name: instanceId | type: string | description: App instance GUID.
     - name: eventType | type: string | description: Event type.
     - name: identity | type: IdentificationData | description: The identification type and identity data.
        - 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: identityType | type: WebhookIdentityType | description: 
             - enum: UNKNOWN, ANONYMOUS_VISITOR, MEMBER, WIX_USER, APP
     - name: accountInfo | type: AccountInfo | description: Details related to the account
        - name: accountId | type: string | description: GUID of the Wix account associated with the event.
        - name: parentAccountId | type: string | description: GUID of the parent Wix account. Only included when accountId belongs to a child account.
        - name: siteId | type: string | description: GUID of the Wix site associated with the event. Only included when the event is tied to a specific site.
     - name: _id | type: string | description: Event GUID. With this GUID you can easily spot duplicated events and ignore them.
     - name: entityFqdn | type: string | description: Fully Qualified Domain Name of an entity. This is a unique identifier assigned to the API main business entities. For example, `wix.stores.catalog.product`, `wix.bookings.session`, `wix.payments.transaction`.
     - name: slug | type: string | description: Event action name, placed at the top level to make it easier for users to dispatch messages. For example: `created`/`updated`/`deleted`/`started`/`completed`/`email_opened`.
     - name: entityId | type: string | description: GUID of the entity associated with the event.
     - name: eventTime | type: Date | description: Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example, `2020-04-26T13:57:50.699Z`.
     - name: triggeredByAnonymizeRequest | type: boolean | description: Whether the event was triggered as a result of a privacy regulation application (for example, GDPR).
     - name: originatedFrom | type: string | description: If present, indicates the action that triggered the event.
     - name: entityEventSequence | type: string | description: A sequence number that indicates the order of updates to an entity. For example, if an entity was updated at `16:00` and then again at `16:01`, the second update will always have a higher sequence number. You can use this number to make sure you're handling updates in the right order. Just save the latest sequence number on your end and compare it to the one in each new message. If the new message has an older (lower) number, you can safely ignore it.

```

### Examples


```javascript
import { plansV3 } from '@wix/pricing-plans';

plansV3.onPlanTagsModified((event) => {
    // handle your event here
});
```


```javascript
import { createClient, AppStrategy } from '@wix/sdk';
import { plansV3 } from '@wix/pricing-plans';

const wixClient = createClient({
  auth: AppStrategy({
    appId: 'MY-APP-ID',
    publicKey: 'YOUR_APP_PUBLIC_KEY',
  }),
  modules: {
      plansV3,
    },
});

wixClient.plansV3.onPlanTagsModified((event) => {
    // handle your event here
});
```

---