This API is subject to change. Bug fixes and new features will be released based on developer feedback throughout the preview period.
Creates a new Wix account, and creates a new Wix user as the account owner. The newly created account is a child account of the account used to create it, making that account its parent.
Important: This call requires an account level API key and cannot be authenticated with the standard authorization header. API keys are currently available to selected beta users only.
function createAccount(
user: User,
options: CreateAccountOptions,
): Promise<CreateAccountResponse>;
The user to create under the new account, with the roles defined in roles
.
Filter options.
import { createClient, ApiKeyStrategy } from "@wix/sdk";
import { accounts } from "@wix/user-management";
const wixClient = createClient({
modules: { accounts },
auth: ApiKeyStrategy({
apiKey: "MY-API-KEY",
}),
});
async function createAccount(user, options) {
const response = await accounts.createAccount(user, options);
}
This method doesn’t return any custom errors, but may return standard errors. Learn more about standard Wix errors.