Creates a member account.

A member account serves as a container for resources and is also an organizational unit in a resource directory. A member account indicates a project or application. The resources of different member accounts are isolated.

In this example, a member account is created in the fd-r23M55**** folder. The name of the member account is Dev, and the prefix for the name of the Alibaba Cloud account that corresponds to the member account is alice.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request parameters

Parameter Type Required Example Description
DisplayName String Yes Dev

The name of the member account.

The name must be 2 to 50 characters in length.

The name can contain letters, digits, underscores (_), periods (.),and hyphens (-).

The name must be unique in your resource directory.

ParentFolderId String No fd-r23M55****

The ID of the parent folder.

PayerAccountId String No 12323344****

The ID of the settlement account. If this parameter is left empty, the current account is used for settlement.

AccountNamePrefix String No alice

The prefix for the name of the Alibaba Cloud account that corresponds to the member account. If this parameter is left empty, the system randomly generates a prefix.

The prefix must be 2 to 50 characters in length.

The prefix can contain letters, digits, and special characters, such as underscores (_), periods (.), and hyphens (-). It must start and end with letters or digits and cannot contain consecutive special characters.

Specify the name of the Alibaba Cloud account that corresponds to the member account in the <AccountNamePrefix>@<ResourceDirectoryId>.aliyunid.com format, such as alice@rd-3G****.aliyunid.com.

The name must be unique in your resource directory.

For more information about common request parameters, see Common parameters.

Response parameters

Parameter Type Example Description
Account object

The information of the member account.

Status String CreateSuccess

The status of the member account. Valid values:

  • CreateSuccess: The member account is created.
  • CreateVerifying: The creation of the member account is under confirmation.
  • CreateFailed: The member account failed to be created.
  • CreateExpired: The creation of the member account expired.
  • CreateCancelled: The creation of the member account is canceled.
  • PromoteVerifying: The upgrade of the member account is under confirmation.
  • PromoteFailed: The member account failed to be upgraded.
  • PromoteExpired: The upgrade of the member account expired.
  • PromoteCancelled: The upgrade of the member account is canceled.
  • PromoteSuccess: The member account is upgraded.
  • InviteSuccess: The owner of the member account accepted the invitation.
  • Removed: The member account is removed from the resource directory.
Type String ResourceAccount

The type of the member account. The value ResourceAccount indicates that the member account is a resource account.

DisplayName String Dev

The name of the member account.

FolderId String fd-r23M55****

The ID of the folder.

ResourceDirectoryId String rd-3G****

The ID of the resource directory.

JoinTime String 2020-12-31T03:37:39.456Z

The time when the member account joined the resource directory.

AccountId String 112730938585****

The ID of the Alibaba Cloud account that corresponds to the member account.

JoinMethod String created

The way in which the member account joins the resource directory. Valid values:

  • invited: The member account is invited to join the resource directory.
  • created: The member account is directly created in the resource directory.
ModifyTime String 2020-12-31T03:37:39.456Z

The time when the member account was modified.

AccountName String alice@rd-3g****.aliyunid.com

The name of the Alibaba Cloud account that corresponds to the member account.

RequestId String B356A415-D860-43E5-865A-E2193D62BBD6

The ID of the request.

Examples

Sample requests

https://resourcemanager.aliyuncs.com/?Action=CreateResourceAccount
&DisplayName=Dev
&ParentFolderId=fd-r23M55****
&AccountNamePrefix=alice
&<Common request parameters>

Sample success responses

XML format

HTTP/1.1 200 OK
Content-Type:application/xml

<?xml version="1.0" encoding="UTF-8" ?>
<CreateResourceAccountResponse>
	<Account>
		<Status>CreateSuccess</Status>
		<ModifyTime>2020-12-31T03:37:39.456Z</ModifyTime>
		<JoinMethod>created</JoinMethod>
		<ResourceDirectoryId>rd-3G****</ResourceDirectoryId>
		<Type>ResourceAccount</Type>
		<AccountId>112730938585****</AccountId>
		<DisplayName>Dev</DisplayName>
		<JoinTime>2020-12-31T03:37:39.456Z</JoinTime>
		<FolderId>fd-r23M55****</FolderId>
		<AccountName>alice@rd-3g****.aliyunid.com</AccountName>
	</Account>
	<RequestId>B356A415-D860-43E5-865A-E2193D62BBD6</RequestId>
</CreateResourceAccountResponse>

JSON format

HTTP/1.1 200 OK
Content-Type:application/json

{
  "Account" : {
    "Status" : "CreateSuccess",
    "ModifyTime" : "2020-12-31T03:37:39.456Z",
    "JoinMethod" : "created",
    "ResourceDirectoryId" : "rd-3G****",
    "Type" : "ResourceAccount",
    "AccountId" : "112730938585****",
    "DisplayName" : "Dev",
    "JoinTime" : "2020-12-31T03:37:39.456Z",
    "FolderId" : "fd-r23M55****",
    "AccountName" : "alice@rd-3g****.aliyunid.com"
  },
  "RequestId" : "B356A415-D860-43E5-865A-E2193D62BBD6"
}

Error codes

HTTP status code Error code Error message Description
400 MissingParameter.Account.DisplayName You must specify DisplayName. The error message returned because the DisplayName parameter is not specified. Specify this parameter.
400 InvalidParameter.Account.DisplayName The DisplayName of account is invalid. The error message returned because the value of the DisplayName parameter is invalid. The value can contain only letters, digits, underscores (_), periods (.),and hyphens (-).
400 InvalidParameter.Account.DisplayName.Length The DisplayName of the account exceeds the length limit. The error message returned because the length of the value specified for the DisplayName parameter has exceeded the upper limit. The value must be 2 to 50 characters in length.
400 InvalidParameter.ParentFolderId The ParentFolderId is invalid. The error message returned because the value of the ParentFolderId parameter is invalid. The value must start with r- followed by 6 characters or start with fd- followed by 10 characters. Valid characters are letters and digits.
400 InvalidParameter.Account.AccountNamePrefix The account name prefix is invalid. The error message returned because the value of the AccountNamePrefix parameter is invalid. Specify a valid value.
400 InvalidParameter.Account.AccountNamePrefix.Length The account name prefix exceeds the length limit. The limit is 2 to 50 characters. The error message returned because the length of the value specified for the AccountNamePrefix parameter has exceeded the upper limit. The value must be 2 to 50 characters in length.
404 EntityNotExists.ResourceDirectory The resource directory for the account is not enabled. We recommend that you first enable the resource directory for the account. The error message returned because the resource directory for the account is not enabled. Enable the resource directory for the account.
404 EntityNotExists.Folder The resource directory folder does not exist. The error message returned because the folder does not exist. Create the folder first.
409 LimitExceeded.Account The maximum number of member accounts in a resource directory exceeds the limit. The error message returned because the maximum number of member accounts in the resource directory has been reached.
409 InvalidParameter.Account.DisplayName.AlreadyUsed The displayname of account has been used. The error message returned because the name specified for the member account already exists. Change the name.
409 EntityAlreadyExists.ResourceDirectory.Account The email address that the system generates when you create a member account already exists. Try again later. The error message returned because the email address that the system generated already exists. Try again later.
409 Invalid.PayRelation Failed to create a member. The specified billing account is unavailable. Please change to another billing account and try again. The error message returned because the member account has failed to be created. The specified settlement account is unavailable. Specify a valid settlement account and try again later.
409 PaymentAccountEnterpriseVerifyError The type of the payment account is not enterprise verified. The error message returned because the real name of the settlement account is not your enterprise name.
409 PaymentAccountFinancialRelationshipVerifyError The payment account must not be the beneficiary account from other financial relationships. The error message returned because the settlement account cannot be a beneficiary account from other financial relationships.
409 PaymentAccountEnterpriseTypeError The type of the payment account is not enterprise. The error message returned because the settlement account is not an enterprise account.
409 PaymentAccountFinancialRelationshipsChangeFrequencyVerifyError The financial relationship of payment account changes too frequently. Please try again later. The error message returned because the financial relationship of the settlement account frequently changes. Try again later.
409 PaymentAccountVirtualCloudOperatorVerifyError The type of the payment account must not be virtual operator. The error message returned because the settlement account is an account for a virtual network operator (VNO).
409 PaymentAccountResellerVerifyError The type of the payment account must not be reseller. The error message returned because the settlement account is an account for a reseller.
409 PaymentAccountCreditIdentityTypeError The identity of the payment account is not credit. The error message returned because the payment method used by the settlement account is not a credit card.
409 InconsistentEnterpriseNameError The enterprise name of the payment account and the member account must be consistent. The error message returned because the enterprise name of the settlement account is inconsistent with that of the member account.
409 PaymentAccountEnterpriseInvoiceError No enterprise invoice header information is set for the payment account. The error message returned because the invoice title information is not specified for the settlement account.
409 UnknownFinancialError An unknown financial error occurred. The error message returned because an unknown financial error has occurred.
409 NotSupport.PayerAccountInAnotherResourceDirectory The specified payment account does not exist in the resource directory. You must specify a valid payment account. The error message returned because the settlement account is not in the resource directory. Specify a valid settlement account.

For a list of error codes, visit the API Error Center.