> 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/account-level/channels/eligibility/account-code-v1/sample-flows.md

## Article Content:

# Account Code: 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.

## Invite your users to Wix and link them to your account

You can bring a group of your users to Wix and have their Wix accounts linked to your
account as sub-accounts. For example, when you onboard a new group of customers who need
Wix sites.

To invite your users to Wix and link them to your account:

1. Call [Generate Account Invite Links](https://dev.wix.com/docs/api-reference/account-level/channels/eligibility/account-code-v1/generate-account-invite-links.md).
   Specify the number of links you need in `count`. Optionally, specify how long the
   links stay redeemable in `expirationDurationInSeconds`. The response contains one invite
   link for each account code that was created:

   ```json
   {
     "inviteLinks": [
       "https://users.wix.com/signin?organizationId=6b1f9e6a-3c2d-4f0e-9a1b-7e5d2c8f4a6b&organizationInviteCode=eyJlbmMiOiJBMTI4Q0JDLUhTMjU2IiwiYWxnIjoiZGlyIn0..q3Xk9mPzT2vL8nRw4bYc1A.Hf7sK2mQ9xV4pL6tN1rW8eZ3uB5yC0dJ.Ra4Tn8Wq2Ls6Xv1Kp9Bm3g",
       "https://users.wix.com/signin?organizationId=6b1f9e6a-3c2d-4f0e-9a1b-7e5d2c8f4a6b&organizationInviteCode=eyJlbmMiOiJBMTI4Q0JDLUhTMjU2IiwiYWxnIjoiZGlyIn0..Lr7Tb2WnX5cQ8mPa1vKs3D.Mc2vR8tY5nK1wQ7pL4xZ9bH6sE3jF0gA.Uy6Pk1Rz9Nf4Wc2Lt7Hq5e"
     ],
     "bulkActionMetadata": {
       "totalSuccesses": 2,
       "totalFailures": 0
     }
   }
   ```

1. Compare `bulkActionMetadata.totalSuccesses` with the `count` you specified. If fewer
   invite links were returned than you need, call Generate Account Invite Links again for
   the difference.
1. Store each invite link with the user you plan to send it to, so you can revoke it later
   if needed.
1. Send each user their invite link without modifying it. When the user opens the link
   and signs up or logs in to Wix, their account is linked to your account.

## Revoke an invite link sent by mistake

If you sent an invite link to the wrong person, or no longer want it to be redeemable,
you can revoke it before anyone redeems it.

To revoke an invite link:

1. Take the value of the `organizationInviteCode` query parameter from the invite link.
1. Call [Delete Account Code](https://dev.wix.com/docs/api-reference/account-level/channels/eligibility/account-code-v1/delete-account-code.md)
   and specify the value in `inviteCode`. The invite link can no longer be redeemed.

## Clean up unused invite links

After a campaign ends, you can revoke all the invite links that your users haven't
redeemed, so they can't be used later.

To clean up unused invite links:

1. Collect the `organizationInviteCode` values from the invite links you want to revoke.
1. Call [Bulk Delete Account Codes](https://dev.wix.com/docs/api-reference/account-level/channels/eligibility/account-code-v1/bulk-delete-account-codes.md)
   and specify the values in `inviteCodes`. You can specify up to 5,000 invite codes in
   each call.
1. Check `results` in the response. Each item matches the invite code in the same
   position in your request. An invite code that's expired or doesn't exist is returned
   as a failed item:

   ```json
   {
     "results": [
       { "itemMetadata": { "originalIndex": 0, "success": true } },
       {
         "itemMetadata": {
           "originalIndex": 1,
           "success": false,
           "error": {
             "code": "ACCOUNT_CODE_NOT_FOUND",
             "description": "Code does not resolve to an AccountCode this caller can reach"
           }
         }
       }
     ],
     "bulkActionMetadata": {
       "totalSuccesses": 1,
       "totalFailures": 1
     }
   }
   ```