> 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

# DeleteAccountCode

# Package: eligibility

# Namespace: OrganizationService

# Method link: https://dev.wix.com/docs/api-reference/account-level/channels/eligibility/account-code-v1/delete-account-code.md

## Permission Scopes:
Manage Channels Account Codes: SCOPE.CHANNELS.MANAGE_ACCOUNT_KEYS

## Introduction

Deletes an account code, so its invite link can no longer be redeemed.


Use this method to revoke an account code you issued by mistake, for example after
generating too many. Identify the account code by the `organizationInviteCode` value
from the invite link that
[Generate Account Invite Links](https://dev.wix.com/docs/api-reference/account-level/channels/eligibility/account-code-v1/generate-account-invite-links.md)
returned.

An account code can be deleted only by the account that generated it. An invite code
that belongs to a different account returns the same error as an invite code that
doesn't exist.

An expired account code can't be deleted, since it can no longer be redeemed anyway.
Deleting an account code that was already redeemed removes only the code. The user who
redeemed it stays linked to your account.

To delete multiple account codes in a single API call, call
[Bulk Delete Account Codes](https://dev.wix.com/docs/api-reference/account-level/channels/eligibility/account-code-v1/bulk-delete-account-codes.md).

---

## REST API

### Schema

```
 Method: deleteAccountCode
 Description: Deletes an account code, so its invite link can no longer be redeemed.   Use this method to revoke an account code you issued by mistake, for example after generating too many. Identify the account code by the `organizationInviteCode` value from the invite link that [Generate Account Invite Links](https://dev.wix.com/docs/api-reference/account-level/channels/eligibility/account-code-v1/generate-account-invite-links.md) returned.  An account code can be deleted only by the account that generated it. An invite code that belongs to a different account returns the same error as an invite code that doesn't exist.  An expired account code can't be deleted, since it can no longer be redeemed anyway. Deleting an account code that was already redeemed removes only the code. The user who redeemed it stays linked to your account.  To delete multiple account codes in a single API call, call [Bulk Delete Account Codes](https://dev.wix.com/docs/api-reference/account-level/channels/eligibility/account-code-v1/bulk-delete-account-codes.md).
 URL: https://www.wixapis.com/channels-eligibility/v1/channels-eligibility/account-codes/delete
 Method: POST
 # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present.
 Required parameters:  inviteCode
 Method parameters: 
   param name: inviteCode | type: inviteCode | description: Invite code to delete. This is the value of the `organizationInviteCode` query parameter in an invite link returned by [Generate Account Invite Links](https://dev.wix.com/docs/api-reference/account-level/channels/eligibility/account-code-v1/generate-account-invite-links.md). | required: true | validation: maxLength 500
 Return type: DeleteAccountCodeResponse
  EMPTY-OBJECT {}

 Possible Errors:
   HTTP Code: 404 | Status Code: NOT_FOUND | Application Code: ACCOUNT_CODE_NOT_FOUND | Description: Couldn't find the account code.


```

### Examples

### Delete an account code
```curl
curl -X POST \
'https://www.wixapis.com/channels-eligibility/v1/channels-eligibility/account-codes/delete' \
-H 'Authorization: <AUTH>' \
-H 'Content-Type: application/json' \
-d '{
  "inviteCode": "eyJlbmMiOiJBMTI4Q0JDLUhTMjU2IiwiYWxnIjoiZGlyIn0..q3Xk9mPzT2vL8nRw4bYc1A.Hf7sK2mQ9xV4pL6tN1rW8eZ3uB5yC0dJ.Ra4Tn8Wq2Ls6Xv1Kp9Bm3g"
}'
```

---

## JavaScript SDK

### Schema

```
 Method: wixClientAdmin.channels.accountCodes.deleteAccountCode(inviteCode)
 Description: Deletes an account code, so its invite link can no longer be redeemed.   Use this method to revoke an account code you issued by mistake, for example after generating too many. Identify the account code by the `organizationInviteCode` value from the invite link that [Generate Account Invite Links](https://dev.wix.com/docs/api-reference/account-level/channels/eligibility/account-code-v1/generate-account-invite-links.md) returned.  An account code can be deleted only by the account that generated it. An invite code that belongs to a different account returns the same error as an invite code that doesn't exist.  An expired account code can't be deleted, since it can no longer be redeemed anyway. Deleting an account code that was already redeemed removes only the code. The user who redeemed it stays linked to your account.  To delete multiple account codes in a single API call, call [Bulk Delete Account Codes](https://dev.wix.com/docs/api-reference/account-level/channels/eligibility/account-code-v1/bulk-delete-account-codes.md).
 # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present.
 Required parameters:  inviteCode
 Method parameters: 
   param name: inviteCode | type: string | description: Invite code to delete. This is the value of the `organizationInviteCode` query parameter in an invite link returned by [Generate Account Invite Links](https://dev.wix.com/docs/api-reference/account-level/channels/eligibility/account-code-v1/generate-account-invite-links.md). | required: true | validation: maxLength 500
 Return type: PROMISE<DeleteAccountCodeResponse>
  EMPTY-OBJECT {}

 Possible Errors:
   HTTP Code: 404 | Status Code: NOT_FOUND | Application Code: ACCOUNT_CODE_NOT_FOUND | Description: Couldn't find the account code.


```

### Examples

### Delete an account code
```javascript
import { accountCodes } from "@wix/channels";

async function deleteAccountCode() {
  await accountCodes.deleteAccountCode(
    "eyJlbmMiOiJBMTI4Q0JDLUhTMjU2IiwiYWxnIjoiZGlyIn0..q3Xk9mPzT2vL8nRw4bYc1A.Hf7sK2mQ9xV4pL6tN1rW8eZ3uB5yC0dJ.Ra4Tn8Wq2Ls6Xv1Kp9Bm3g",
  );
}

```

### deleteAccountCode (self-managed)
Self-managed 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 { accountCodes } from '@wix/channels';
// Import the auth strategy for the relevant access type
// Import the relevant host module if needed

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


async function deleteAccountCode(inviteCode) {
  const response = await myWixClient.accountCodes.deleteAccountCode(inviteCode);
};
```

---