The Account Code API lets a Channel invite its users to Wix with one-time-use sign-in
invite links. When a user opens their link and signs up or logs in to Wix, their account
is linked to the Channel's account as a sub-account.
With the Account Code API, you can:
- Generate batches of ready-to-use sign-in invite links for your users.
- Delete account codes, so their invite links can no longer be redeemed.
Each invite link contains an account code. An account code goes through these stages:
- Generated: Generate Account Invite Links
creates the account code and returns its invite link. By default, the account code
stays redeemable for 182 days. You can request a lifetime between 60 seconds and 1 year.
- Redeemed: A user opens the invite link and signs up or logs in to Wix. Their
account is linked to your account as a sub-account. Each account code can be redeemed
once, and each email address can redeem a single account code from your account.
- Deleted or expired: An account code that's deleted or past its expiration date
can't be redeemed. Deleting an account code that was already redeemed removes only
the code. The user who redeemed it stays linked to your account.
It's important to note the following points before starting to code:
- Your account must be set up by Wix as a Channel organization account. To get set up,
contact your Wix partner manager. Otherwise, generating invite links fails with
ORGANIZATION_NOT_ELIGIBLE.
- Call these methods with an account-level
API key that has the
Manage Channels Account Codes permission scope. The account that the API key belongs to
is always the account the codes are generated for or deleted from. You can't act on
another account's codes.
- An account can have up to 5,000,000 active account codes, meaning codes that haven't
been redeemed and haven't expired. If generating a batch would exceed this limit, the
call fails and no account codes are created.
- If some account codes in a batch can't be created, for example due to a temporary
storage issue, the call still succeeds and returns fewer invite links than you
requested. The response reports how many account codes were created and how many failed.
- An invite code that belongs to a different account returns the same error as an invite
code that doesn't exist.
- Channel: A partner integration that's set up by Wix as an organization account.
A Channel refers its users to Wix and has those users linked to its own account.
- Organization account: The Wix account that represents a Channel. It appears as
organizationId in invite links.
- Sub-account: A user's Wix account that's linked to a Channel's organization account.
- Account code: A signed, one-time-use code that links the account of the user who
redeems it to a Channel's account.
- Invite link: A full sign-in URL that contains an account code. For example,
https://users.wix.com/signin?organizationId=<accountId>&organizationInviteCode=<code>.
- Invite code: The value of the
organizationInviteCode query parameter in an invite
link. Use it to identify an account code when you delete it.