> 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

# CreateJoinApplication

# Package: onlinePrograms

# Namespace: JoinApplicationsService

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

## Permission Scopes:
Manage Online Programs: SCOPE.CHALLENGES.MANAGE
Manage Online Programs: SCOPE.CHALLENGES.MANAGE

## Introduction

Creates a join application for a program.

Members creating their own applications can't specify `memberId`. It's automatically set to the calling member. Wix users must specify `memberId` when creating an application on a member's behalf.

For member-initiated applications, `status` is set automatically: `APPROVED` for a public program, and `APPROVAL_PENDING` for a program that requires approval. A member can't specify `status`.

A Wix user creating an application on a member's behalf can set the initial `status`, typically to `INVITED` or `APPROVED`. When a Wix user omits `status`, it defaults to `APPROVED`.

The program must be published.

To create multiple join applications in a single API call, call [Bulk Create Join Applications](https://dev.wix.com/docs/api-reference/business-management/online-programs/join-applications/bulk-create-join-applications.md).

---

## REST API

### Schema

```
 Method: createJoinApplication
 Description: Creates a join application for a program.  Members creating their own applications can't specify `memberId`. It's automatically set to the calling member. Wix users must specify `memberId` when creating an application on a member's behalf.  For member-initiated applications, `status` is set automatically: `APPROVED` for a public program, and `APPROVAL_PENDING` for a program that requires approval. A member can't specify `status`.  A Wix user creating an application on a member's behalf can set the initial `status`, typically to `INVITED` or `APPROVED`. When a Wix user omits `status`, it defaults to `APPROVED`.  The program must be published.  To create multiple join applications in a single API call, call [Bulk Create Join Applications](https://dev.wix.com/docs/api-reference/business-management/online-programs/join-applications/bulk-create-join-applications.md).
 URL: https://www.wixapis.com/online-programs/participants/v3/join-applications
 Method: POST
 # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present.
 Required parameters:  joinApplication, joinApplication.programId
 Method parameters: 
   param name: joinApplication | type: JoinApplication | description: A join application tracks a member's request or invitation to join an online program, from application through approval, payment, and enrollment.  Wix users can invite members, review applications, and manage payment-related activity. Members can apply to join a program, accept invitations, and complete payment when required. | required: true 
        - name: programId | type: string | description: GUID of the program the join application is for. | required: true | validation: format GUID, immutable
        - 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).  | validation: format map
        - 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.  | validation: maxItems 100, maxLength 5
           - name: publicTags | type: TagList | description: Tags that are exposed to anyone with access to the entity, including site members and visitors.  
 Return type: CreateJoinApplicationResponse
  - name: joinApplication | type: JoinApplication | description: Created join application.  
     - name: id | type: string | description: Join application GUID.  | read-only: true | validation: format 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.  | read-only: true | validation: format int64
     - name: createdDate | type: string | description: Date and time the join application was created.  | read-only: true | validation: format date-time
     - name: updatedDate | type: string | description: Date and time the join application was last updated.  | read-only: true | validation: format date-time
     - 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.  | read-only: true | validation: format GUID
     - name: programId | type: string | description: GUID of the program the join application is for.  | validation: format GUID, immutable
     - 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.  | read-only: true 
         - 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.  | read-only: true 
         - 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.  | read-only: true 
        - name: paymentOrderId | type: string | description: Wix Payments order GUID. Populated when the member selects one-time payment at checkout.  | read-only: true | validation: format GUID
        - name: offlineTransactionId | type: string | description: Offline transaction GUID. Populated when the member selects manual payment at checkout.  | read-only: true | validation: format GUID
        - name: paidPlanIds | type: array<string> | description: IDs of the pricing plans connected to the program. Populated when the member selects Pricing Plans at checkout.  | read-only: true | validation: maxItems 100, format GUID
        - 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).  | read-only: true | validation: format GUID
     - name: member | type: Member | description: Snapshot of the member identified by `memberId`, copied from the Members API. It isn't the authoritative member record.  | read-only: true 
        - name: firstName | type: string | description: Member contact's first name.  | read-only: true | validation: maxLength 1000
        - name: lastName | type: string | description: Member contact's last name.  | read-only: true | validation: maxLength 1000
        - name: email | type: string | description: Member's login email.  | read-only: true | validation: format EMAIL
        - name: contactId | type: string | description: Member's contact GUID.  | read-only: true | validation: format GUID
        - name: nickname | type: string | description: Member's nickname.  | read-only: true | validation: maxLength 1000
        - name: profileImageUrl | type: string | description: URL of the member's profile image.  | read-only: true | validation: format WEB_URL
     - 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`.  | read-only: true | validation: format GUID
     - 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).  | validation: format map
     - 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.  | validation: maxItems 100, maxLength 5
        - name: publicTags | type: TagList | description: Tags that are exposed to anyone with access to the entity, including site members and visitors.  

 Possible Errors:
   HTTP Code: 400 | Status Code: INVALID_ARGUMENT | Application Code: MISSING_MEMBER_ID | Description: `memberId` is required when a Wix user creates an application on a member's behalf.
   HTTP Code: 404 | Status Code: NOT_FOUND | Application Code: PROGRAM_NOT_FOUND | Description: The specified `programId` doesn't exist.
   HTTP Code: 409 | Status Code: ALREADY_EXISTS | Application Code: ALREADY_EXISTS | Description: A join application already exists for the specified `programId` and `memberId`.
   HTTP Code: 428 | Status Code: FAILED_PRECONDITION | Application Code: PARTICIPANTS_LIMIT_EXCEEDED | Description: The program's participant limit has been reached.
   HTTP Code: 428 | Status Code: FAILED_PRECONDITION | Application Code: PREMIUM_PLAN_REQUIRED | Description: The site needs a Premium plan to add more participants.
   HTTP Code: 428 | Status Code: FAILED_PRECONDITION | Application Code: PROGRAM_NOT_PUBLISHED | Description: The program exists but isn't published.


```

### Examples

### Create a join application
Creates a member-initiated application to join a fitness program

```curl
curl -X POST \
'https://www.wixapis.com/online-programs/participants/v3/join-applications' \
-H 'Authorization: <AUTH>' \
-H 'Content-Type: application/json' \
-d '{
  "joinApplication": {
    "programId": "8d3f2b9f-2c31-4f45-8e5a-1f4b9259a6c2"
  }
}'
```

### Create a join application invitation
Creates an owner-initiated invitation for a specific member to join a fitness program

```curl
curl -X POST \
'https://www.wixapis.com/online-programs/participants/v3/join-applications' \
-H 'Authorization: <AUTH>' \
-H 'Content-Type: application/json' \
-d '{
  "joinApplication": {
    "memberId": "6c7c7b22-67a2-43c7-9d27-3b8ed07d9a45",
    "programId": "3f8e26e7-c5d1-4a12-86f8-33d64f4c2a0e",
    "status": "INVITED"
  }
}'
```

---

## JavaScript SDK

### Schema

```
 Method: wixClientAdmin.onlinePrograms.joinApplications.createJoinApplication(joinApplication)
 Description: Creates a join application for a program.  Members creating their own applications can't specify `memberId`. It's automatically set to the calling member. Wix users must specify `memberId` when creating an application on a member's behalf.  For member-initiated applications, `status` is set automatically: `APPROVED` for a public program, and `APPROVAL_PENDING` for a program that requires approval. A member can't specify `status`.  A Wix user creating an application on a member's behalf can set the initial `status`, typically to `INVITED` or `APPROVED`. When a Wix user omits `status`, it defaults to `APPROVED`.  The program must be published.  To create multiple join applications in a single API call, call [Bulk Create Join Applications](https://dev.wix.com/docs/api-reference/business-management/online-programs/join-applications/bulk-create-join-applications.md).
 # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present.
 Required parameters:  joinApplication, joinApplication.programId
 Method parameters: 
   param name: joinApplication | type: JoinApplication | description: A join application tracks a member's request or invitation to join an online program, from application through approval, payment, and enrollment.  Wix users can invite members, review applications, and manage payment-related activity. Members can apply to join a program, accept invitations, and complete payment when required. | required: true 
        - name: programId | type: string | description: GUID of the program the join application is for. | required: true | validation: format GUID, immutable
        - 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).  | validation: format map
        - 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.  | validation: maxItems 100, maxLength 5
           - name: publicTags | type: TagList | description: Tags that are exposed to anyone with access to the entity, including site members and visitors.  
 Return type: PROMISE<JoinApplication>
  - name: _id | type: string | description: Join application GUID.  | read-only: true | validation: format 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.  | read-only: true | validation: format int64
  - name: _createdDate | type: Date | description: Date and time the join application was created.  | read-only: true 
  - name: _updatedDate | type: Date | description: Date and time the join application was last updated.  | read-only: true 
  - 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.  | read-only: true | validation: format GUID
  - name: programId | type: string | description: GUID of the program the join application is for.  | validation: format GUID, immutable
  - 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.  | read-only: true 
     - 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.  | read-only: true 
     - 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.  | read-only: true 
     - name: paymentOrderId | type: string | description: Wix Payments order GUID. Populated when the member selects one-time payment at checkout.  | read-only: true | validation: format GUID
     - name: offlineTransactionId | type: string | description: Offline transaction GUID. Populated when the member selects manual payment at checkout.  | read-only: true | validation: format GUID
     - name: paidPlanIds | type: array<string> | description: IDs of the pricing plans connected to the program. Populated when the member selects Pricing Plans at checkout.  | read-only: true | validation: maxItems 100, format GUID
     - 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).  | read-only: true | validation: format GUID
  - name: member | type: Member | description: Snapshot of the member identified by `memberId`, copied from the Members API. It isn't the authoritative member record.  | read-only: true 
     - name: firstName | type: string | description: Member contact's first name.  | read-only: true | validation: maxLength 1000
     - name: lastName | type: string | description: Member contact's last name.  | read-only: true | validation: maxLength 1000
     - name: email | type: string | description: Member's login email.  | read-only: true | validation: format EMAIL
     - name: contactId | type: string | description: Member's contact GUID.  | read-only: true | validation: format GUID
     - name: nickname | type: string | description: Member's nickname.  | read-only: true | validation: maxLength 1000
     - name: profileImageUrl | type: string | description: URL of the member's profile image.  | read-only: true | validation: format WEB_URL
  - 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`.  | read-only: true | validation: format GUID
  - 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).  | validation: format map
  - 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.  | validation: maxItems 100, maxLength 5
     - name: publicTags | type: TagList | description: Tags that are exposed to anyone with access to the entity, including site members and visitors.  

 Possible Errors:
   HTTP Code: 400 | Status Code: INVALID_ARGUMENT | Application Code: MISSING_MEMBER_ID | Description: `memberId` is required when a Wix user creates an application on a member's behalf.
   HTTP Code: 404 | Status Code: NOT_FOUND | Application Code: PROGRAM_NOT_FOUND | Description: The specified `programId` doesn't exist.
   HTTP Code: 409 | Status Code: ALREADY_EXISTS | Application Code: ALREADY_EXISTS | Description: A join application already exists for the specified `programId` and `memberId`.
   HTTP Code: 428 | Status Code: FAILED_PRECONDITION | Application Code: PARTICIPANTS_LIMIT_EXCEEDED | Description: The program's participant limit has been reached.
   HTTP Code: 428 | Status Code: FAILED_PRECONDITION | Application Code: PREMIUM_PLAN_REQUIRED | Description: The site needs a Premium plan to add more participants.
   HTTP Code: 428 | Status Code: FAILED_PRECONDITION | Application Code: PROGRAM_NOT_PUBLISHED | Description: The program exists but isn't published.


```

### Examples

### Create a join application invitation
Creates an owner-initiated invitation for a specific member to join a fitness program

```javascript
import { joinApplications } from "@wix/online-programs";

async function createJoinApplication() {
  const joinApplication = await joinApplications.createJoinApplication({
    memberId: "6c7c7b22-67a2-43c7-9d27-3b8ed07d9a45",
    programId: "3f8e26e7-c5d1-4a12-86f8-33d64f4c2a0e",
    status: "INVITED",
  });
}

```

### Create a join application
Creates a member-initiated application to join a fitness program

```javascript
import { joinApplications } from "@wix/online-programs";

async function createJoinApplication() {
  const joinApplication = await joinApplications.createJoinApplication({
    programId: "8d3f2b9f-2c31-4f45-8e5a-1f4b9259a6c2",
  });
}

```

### createJoinApplication (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 { joinApplications } from '@wix/online-programs';
// Import the auth strategy for the relevant access type
// Import the relevant host module if needed

const myWixClient = createClient ({
  modules: { joinApplications },
  // Include the auth strategy and host as relevant
});


async function createJoinApplication(joinApplication) {
  const response = await myWixClient.joinApplications.createJoinApplication(joinApplication);
};
```

---