Creates a member of the resource account type.

Usage notes

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

In this example, a member is created in the fd-r23M55**** folder. The display name of the member is Dev, and the prefix for the name of the Alibaba Cloud account that corresponds to the member 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
Action String Yes CreateResourceAccount

The operation that you want to perform. Set the value to CreateResourceAccount.

DisplayName String Yes Dev

The display name of the member.

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 the resource directory.

ParentFolderId String No fd-r23M55****

The ID of the parent folder.

PayerAccountId String No 12323344****

The ID of the billing account. If you leave this parameter empty, the current account is used as the billing account.

AccountNamePrefix String No alice

The prefix for the name of the Alibaba Cloud account that corresponds to the member. If you leave this parameter 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 but cannot contain consecutive special characters. The prefix must start with a letter or digit and end with a letter or digit. Valid special characters include underscores (_), periods (.), and hyphens (-).

The complete name of an Alibaba Cloud account that corresponds to a member in a resource directory is in the <AccountNamePrefix>@<ResourceDirectoryId>.aliyunid.com format, such as alice@rd-3G****.aliyunid.com.

Each name must be unique in the 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.

Status String CreateSuccess

The status of the member. The value CreateSuccess indicates that the member is created.

Type String ResourceAccount

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

DisplayName String Dev

The display name of the member.

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 joined the resource directory.

AccountId String 112730938585****

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

JoinMethod String created

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

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

The time when the member was modified.

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

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

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 configured. Configure 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 include 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 account has not been used to enable a resource directory. Use the account to enable a resource directory first.
404 EntityNotExists.Folder The resource directory folder does not exist. The error message returned because the folder does not exist. Create such a folder first.
409 LimitExceeded.Account The maximum number of member accounts in a resource directory exceeds the limit. The error message returned because the number of members in the resource directory has exceeded the upper limit.
409 InvalidParameter.Account.DisplayName.AlreadyUsed The displayname of account has been used. The error message returned because the display name of the member 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 is generated by the system 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 has failed to be created. The specified billing account is unavailable. Specify a valid billing account and try again.
409 CreateAccountDisabled The specified resource directory cannot create a new account. The error message returned because you are not authorized to create a member.
409 PaymentAccountEnterpriseVerifyError The type of the payment account is not enterprise verified. The error message returned because the specified billing account does not pass enterprise real-name verification.
409 PaymentAccountFinancialRelationshipVerifyError The payment account must not be the beneficiary account from other financial relationships. The error message returned because the billing 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 billing 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 billing 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 billing account is an account for a virtual network operator (VNO).
409 PaymentAccountCreditIdentityTypeError The identity of the payment account is not credit. The error message returned because the identity of the billing account is not a credit payment identity.
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 billing account.
409 UnknownFinancialError An unknown financial error occurred. The error message returned because an unknown financial error has occurred.
409 BusinessRestricted Business is restricted. Please contact your customer service manager. The error message returned because your business is limited. Contact your customer business manager (CBM).
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 billing account is not in the resource directory. Specify a valid billing account.
409 MemberAccountVirtualCloudOperatorVerifyError The type of the member must not be virtual operator. The error message returned because the member is an account for a VNO.
409 PaymentAccountResellerVerifyError The type of the payment account must not be reseller. The error message returned because the billing account is an account for a reseller.
409 InconsistentEnterpriseNameError The enterprise name of the payment account and the member must be consistent. The error message returned because the enterprise names of the billing account and the member are inconsistent.
409 MemberAccountResellerVerifyError The type of the member must not be reseller. The error message returned because the member is an account for a reseller.

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