> 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: onlinePrograms

# Namespace: joinApplications

# Webhook link: https://dev.wix.com/docs/api-reference/business-management/online-programs/join-applications/join-application-updated.md

# Webhook Permissions Scopes IDs:
Manage Online Programs: SCOPE.CHALLENGES.MANAGE

## Introduction

Triggered when a join application is updated.

---

## REST API

### Schema

```
Webhook: Join Application Updated
Description: Triggered when a join application is updated.
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: updatedEvent | type: object | description: Updated event details.
    - name: currentEntity | type: JoinApplication | description: The entity after the update.
        - name: id | type: string | description: Join application GUID.
        - name: revision | type: string | description: Revision number, which increments by 1 each time a lifecycle, payment, or tag action changes the join application.  This API doesn't provide a generic update method, so `revision` is read-only. Don't specify it when creating or changing a join application.
        - name: createdDate | type: string | description: Date and time the join application was created.
        - name: updatedDate | type: string | description: Date and time the join application was last updated.
        - name: memberId | type: string | description: GUID of the site member applying or invited to participate in the program.  Required when a Wix user creates an application on a member's behalf. Automatically set to the caller's member GUID when a member creates their own application.
        - name: programId | type: string | description: GUID of the program the join application is for.
        - name: status | type: Status | description: Current status of the join application.  Read-only for member-initiated applications. A Wix user can set the initial status when creating an application on a member's behalf.
           - enum:
           -     INVITED: Member has been invited to join the program and has not yet accepted.
           -     APPROVAL_PENDING: Member's application is awaiting the Wix user's decision.
           -     APPROVED: Application is approved. Payment may still be required before the member is enrolled.
           -     CANCELLED: Member canceled the application. The join application is removed asynchronously.
           -     DECLINED: Wix user declined the application. The join application is removed asynchronously.
           -     SUSPENDED: Connected participant is suspended after the related Pricing Plans subscription expires. A successful new payment resumes the participation flow.
        - name: paymentStatus | type: PaymentStatus | description: Payment status of the join application.
           - enum:
           -     NO_PAYMENT_REQUIRED: Payment isn't required because the program is free or the member has an eligible Pricing Plans entitlement.
           -     PAYMENT_PENDING: Payment is required before the member can be enrolled.
           -     PAYMENT_IN_PROGRESS: Payment checkout or a Pricing Plans purchase is in progress.
           -     PENDING_OWNER_APPROVAL: Member submitted an offline payment that awaits the Wix user's decision.
           -     PAYMENT_SUCCESSFUL: Payment completed successfully.
           -     PAYMENT_FAILED: Payment was declined by the payment system or, for an offline payment, by the Wix user.
           -     PAYMENT_CANCELED: Member canceled payment.
        - name: paymentInfo | type: PaymentInfo | description: Wix Payments or Pricing Plans data associated with the join application.
           - name: paymentOrderId | type: string | description: Wix Payments order GUID. Populated when the member selects one-time payment at checkout.
           - name: offlineTransactionId | type: string | description: Offline transaction GUID. Populated when the member selects manual payment at checkout.
           - name: paidPlanIds | type: array<string> | description: IDs of the pricing plans connected to the program. Populated when the member selects Pricing Plans at checkout.
           - name: couponId | type: string | description: GUID of the coupon applied to the payment order. Populated when a coupon is applied with [Apply Coupon](https://dev.wix.com/docs/api-reference/business-management/online-programs/join-applications/apply-coupon.md).
        - name: member | type: Member | description: Snapshot of the member identified by `memberId`, copied from the Members API. It isn't the authoritative member record.
           - name: firstName | type: string | description: Member contact's first name.
           - name: lastName | type: string | description: Member contact's last name.
           - name: email | type: string | description: Member's login email.
           - name: contactId | type: string | description: Member's contact GUID.
           - name: nickname | type: string | description: Member's nickname.
           - name: profileImageUrl | type: string | description: URL of the member's profile image.
        - name: participantId | type: string | description: GUID of the participant created from the join application.  Populated when `status` is `APPROVED` and `paymentStatus` is `NO_PAYMENT_REQUIRED` or `PAYMENT_SUCCESSFUL`.
        - name: extendedFields | type: ExtendedFields | description: Custom field data for the join application object.  [Extended fields](https://dev.wix.com/docs/build-apps/develop-your-app/extensions/backend-extensions/schema-plugins/about-schema-plugin-extensions.md) must be configured in the app dashboard before they can be accessed with API calls.
           - 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: tags | type: Tags | description: Tags for categorizing and organizing join applications.
           - name: privateTags | type: TagList | description: Tags that require an additional permission in order to access them, typically restricted from site members and visitors.
              - name: tagIds | type: array<string> | description: List of tag GUIDs.
           - name: publicTags | type: TagList | description: Tags that are exposed to anyone with access to the entity, including site members and visitors.
    - name: modifiedFields | type: Map<string,Value> | description: Fields that were updated and their values before the update.

```

---

## JavaScript SDK

### Schema

```
Webhook: onJoinApplicationUpdated
Description: Triggered when a join application is updated.
Payload: JoinApplicationUpdatedEnvelope
  - name: entity | type: JoinApplication | description: none
     - name: _id | type: string | description: Join application GUID.
     - name: revision | type: string | description: Revision number, which increments by 1 each time a lifecycle, payment, or tag action changes the join application.  This API doesn't provide a generic update method, so `revision` is read-only. Don't specify it when creating or changing a join application.
     - name: _createdDate | type: Date | description: Date and time the join application was created.
     - name: _updatedDate | type: Date | description: Date and time the join application was last updated.
     - name: memberId | type: string | description: GUID of the site member applying or invited to participate in the program.  Required when a Wix user creates an application on a member's behalf. Automatically set to the caller's member GUID when a member creates their own application.
     - name: programId | type: string | description: GUID of the program the join application is for.
     - name: status | type: Status | description: Current status of the join application.  Read-only for member-initiated applications. A Wix user can set the initial status when creating an application on a member's behalf.
         - enum:
         -     INVITED: Member has been invited to join the program and has not yet accepted.
         -     APPROVAL_PENDING: Member's application is awaiting the Wix user's decision.
         -     APPROVED: Application is approved. Payment may still be required before the member is enrolled.
         -     CANCELLED: Member canceled the application. The join application is removed asynchronously.
         -     DECLINED: Wix user declined the application. The join application is removed asynchronously.
         -     SUSPENDED: Connected participant is suspended after the related Pricing Plans subscription expires. A successful new payment resumes the participation flow.
     - name: paymentStatus | type: PaymentStatus | description: Payment status of the join application.
         - enum:
         -     NO_PAYMENT_REQUIRED: Payment isn't required because the program is free or the member has an eligible Pricing Plans entitlement.
         -     PAYMENT_PENDING: Payment is required before the member can be enrolled.
         -     PAYMENT_IN_PROGRESS: Payment checkout or a Pricing Plans purchase is in progress.
         -     PENDING_OWNER_APPROVAL: Member submitted an offline payment that awaits the Wix user's decision.
         -     PAYMENT_SUCCESSFUL: Payment completed successfully.
         -     PAYMENT_FAILED: Payment was declined by the payment system or, for an offline payment, by the Wix user.
         -     PAYMENT_CANCELED: Member canceled payment.
     - name: paymentInfo | type: PaymentInfo | description: Wix Payments or Pricing Plans data associated with the join application.
        - name: paymentOrderId | type: string | description: Wix Payments order GUID. Populated when the member selects one-time payment at checkout.
        - name: offlineTransactionId | type: string | description: Offline transaction GUID. Populated when the member selects manual payment at checkout.
        - name: paidPlanIds | type: array<string> | description: IDs of the pricing plans connected to the program. Populated when the member selects Pricing Plans at checkout.
        - name: couponId | type: string | description: GUID of the coupon applied to the payment order. Populated when a coupon is applied with [Apply Coupon](https://dev.wix.com/docs/api-reference/business-management/online-programs/join-applications/apply-coupon.md).
     - name: member | type: Member | description: Snapshot of the member identified by `memberId`, copied from the Members API. It isn't the authoritative member record.
        - name: firstName | type: string | description: Member contact's first name.
        - name: lastName | type: string | description: Member contact's last name.
        - name: email | type: string | description: Member's login email.
        - name: contactId | type: string | description: Member's contact GUID.
        - name: nickname | type: string | description: Member's nickname.
        - name: profileImageUrl | type: string | description: URL of the member's profile image.
     - name: participantId | type: string | description: GUID of the participant created from the join application.  Populated when `status` is `APPROVED` and `paymentStatus` is `NO_PAYMENT_REQUIRED` or `PAYMENT_SUCCESSFUL`.
     - name: extendedFields | type: ExtendedFields | description: Custom field data for the join application object.  [Extended fields](https://dev.wix.com/docs/build-apps/develop-your-app/extensions/backend-extensions/schema-plugins/about-schema-plugin-extensions.md) must be configured in the app dashboard before they can be accessed with API calls.
        - 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: tags | type: Tags | description: Tags for categorizing and organizing join applications.
        - name: privateTags | type: TagList | description: Tags that require an additional permission in order to access them, typically restricted from site members and visitors.
           - name: tagIds | type: array<string> | description: List of tag GUIDs.
        - name: publicTags | type: TagList | description: Tags that are exposed to anyone with access to the entity, including site members and visitors.
  - name: modifiedFields | type: Map<string,Value> | description: Fields that were updated and their values before the update.
     - ONE-OF:
        - name: nullValue | type:  | description: 
        - name: numberValue | type: number | description: 
        - name: stringValue | type: string | description: 
        - name: boolValue | type: boolean | description: 
        - name: structValue | type: object | description: 
        - name: listValue | type: ListValue | description: 
           - name: values | type: array<Value> | description: 
  - 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 { joinApplications } from '@wix/online-programs';

joinApplications.onJoinApplicationUpdated((event) => {
    // handle your event here
});
```


```javascript
import { createClient, AppStrategy } from '@wix/sdk';
import { joinApplications } from '@wix/online-programs';

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

wixClient.joinApplications.onJoinApplicationUpdated((event) => {
    // handle your event here
});
```

---