> 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: Sample Flows

## Article: Sample Flows

## Article Link: https://dev.wix.com/docs/api-reference/business-management/online-programs/join-applications/sample-flows.md

## Article Content:

# Join Applications API: Sample Flows

This article presents possible use cases and corresponding sample flows that you can support. It provides a useful starting point as you plan your implementation.

## Handle member-initiated program applications

A fitness studio offers specialized training programs that require instructor approval before members can join. Members can browse available programs and submit applications, which program owners review and either approve or decline based on prerequisites and capacity.

To handle member-initiated program applications:

1. Call [Create Join Application](https://dev.wix.com/docs/api-reference/business-management/online-programs/join-applications/create-join-application.md) with only the `programId`. The system automatically creates an application with `APPROVAL_PENDING` status and uses the caller's member identity.
2. Call [Query Join Applications](https://dev.wix.com/docs/api-reference/business-management/online-programs/join-applications/query-join-applications.md) to retrieve pending applications for review by program owners.
3. Call [Approve Join Application](https://dev.wix.com/docs/api-reference/business-management/online-programs/join-applications/approve-join-application.md) to accept the member's request, transitioning the status to `APPROVED`.
4. If payment is required, call [Prepare Payment](https://dev.wix.com/docs/api-reference/business-management/online-programs/join-applications/prepare-payment.md) to initiate the payment process.
5. Handle payment completion through payment events, which automatically creates a participant when successful.

Alternatively, call [Decline Join Application](https://dev.wix.com/docs/api-reference/business-management/online-programs/join-applications/decline-join-application.md) to reject the application, or the member can call [Cancel Join Application](https://dev.wix.com/docs/api-reference/business-management/online-programs/join-applications/cancel-join-application.md) to withdraw their request.

## Manage owner-initiated program invitations

A corporate wellness program wants to invite specific employees to participate in executive coaching sessions. The program administrator can send targeted invitations to selected members, who can then accept or decline the invitation.

To manage owner-initiated program invitations:

1. Call [Create Join Application](https://dev.wix.com/docs/api-reference/business-management/online-programs/join-applications/create-join-application.md) with `memberId`, `programId`, and `status: "INVITED"`. This requires additional permissions for the owner flow.
2. Call [Bulk Create Join Applications](https://dev.wix.com/docs/api-reference/business-management/online-programs/join-applications/bulk-create-join-applications.md) to invite up to 100 members simultaneously.
3. Call [Bulk Invite Members To Program By Filter](https://dev.wix.com/docs/api-reference/business-management/online-programs/join-applications/bulk-invite-members-to-program-by-filter.md) to invite all site members matching the default member filter, optionally excluding up to 100 member IDs. This returns a job ID for async tracking.
4. The invited member calls [Accept Invite](https://dev.wix.com/docs/api-reference/business-management/online-programs/join-applications/accept-invite.md) with the `joinApplicationId`, which transitions their application from `INVITED` to `APPROVED` status.
5. If payment is required, the member calls [Prepare Payment](https://dev.wix.com/docs/api-reference/business-management/online-programs/join-applications/prepare-payment.md) to begin the checkout process.
6. Handle payment completion to automatically create the participant enrollment.

Members can also call [Cancel Join Application](https://dev.wix.com/docs/api-reference/business-management/online-programs/join-applications/cancel-join-application.md) to decline the invitation.

## Process program payments and discounts

A professional development program offers both one-time workshop fees and monthly subscription options. Members can apply discount coupons during checkout and choose their preferred payment method.

To process program payments and discounts:

1. After the join application reaches `APPROVED` status, call [Prepare Payment](https://dev.wix.com/docs/api-reference/business-management/online-programs/join-applications/prepare-payment.md) with `paymentType: "SINGLE_PAYMENT"` or `paymentType: "PAID_PLANS"`.
2. Inspect the returned `paymentStatus`. If it is `PAYMENT_SUCCESSFUL` with `paymentInfo.paidPlanIds`, an existing eligible Pricing Plans entitlement covers the program and no checkout is needed. Otherwise, continue only when it is `PAYMENT_IN_PROGRESS`.
3. For a Wix Payments order, optionally call [Apply Coupon](https://dev.wix.com/docs/api-reference/business-management/online-programs/join-applications/apply-coupon.md) with a `couponCode` to provide discounts on the order total.
4. Direct the member to complete payment through the Wix payment system using the prepared order.
5. Handle payment events to automatically update the `paymentStatus` and create the participant when payment is successful.
6. If needed, call [Remove Coupon](https://dev.wix.com/docs/api-reference/business-management/online-programs/join-applications/remove-coupon.md) to remove previously applied discounts before payment completion.
7. If the coupon covers the full payment amount, call [Complete Free Coupon Payment](https://dev.wix.com/docs/api-reference/business-management/online-programs/join-applications/complete-free-coupon-payment.md) to complete the payment and create the participant without sending the member through a paid checkout.

The system automatically transitions the `paymentStatus` from `PAYMENT_PENDING` through `PAYMENT_IN_PROGRESS` to `PAYMENT_SUCCESSFUL`, `PAYMENT_FAILED`, or `PAYMENT_CANCELED` based on payment results. Members can retry failed or canceled payments by calling `PreparePayment` again.

## Bulk manage applications and invitations

A large organization runs quarterly training programs and needs to efficiently process hundreds of applications and send mass invitations to different employee groups.

To bulk manage applications and invitations:

1. Call [Bulk Create Join Applications](https://dev.wix.com/docs/api-reference/business-management/online-programs/join-applications/bulk-create-join-applications.md) to send up to 100 invitations at once, providing `memberId`, `programId`, and `status: "INVITED"` for each.
2. Call [Search Join Applications](https://dev.wix.com/docs/api-reference/business-management/online-programs/join-applications/search-join-applications.md) with member search criteria like `member.email` or `member.firstName` to find specific applications.
3. Call [Bulk Update Join Application Tags](https://dev.wix.com/docs/api-reference/business-management/online-programs/join-applications/bulk-update-join-application-tags.md) to organize applications by department, priority, or other categories.
4. Call [Bulk Update Join Application Tags By Filter](https://dev.wix.com/docs/api-reference/business-management/online-programs/join-applications/bulk-update-join-application-tags-by-filter.md) to apply tags to all applications matching specific criteria, returning a job ID for tracking the async operation.
5. Call [Bulk Delete Join Applications](https://dev.wix.com/docs/api-reference/business-management/online-programs/join-applications/bulk-delete-join-applications.md) to remove multiple applications that are no longer needed.

Use [Query Join Applications](https://dev.wix.com/docs/api-reference/business-management/online-programs/join-applications/query-join-applications.md) with filters like `status` and `paymentStatus` to monitor the progress of bulk operations and generate reports.