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.

This topic provides an example on how to call the API operation to create a member in the fd-r23M55**** folder. The display name of the member is Dev, and the prefix for the Alibaba Cloud account name of 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 (.), hyphens (-), and spaces.

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 member is used as its own billing account.

AccountNamePrefix String No alice

The prefix for the Alibaba Cloud account name of the member. If you leave this parameter empty, the system randomly generates a prefix.

The prefix must be 2 to 37 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 Alibaba Cloud account name of 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.

Tag.N.Key String No k1

A tag key

Tag.N.Value String No v1

A tag value.

ResellAccountType String No resell

The identity type of the member. Valid values:

  • resell: The member is an account for a reseller. This is the default value. A relationship is automatically established between the member and the reseller. The management account of the resource directory must be used as the billing account of the member.
  • non_resell: The member is not an account for a reseller. The member is an account that is not associated with a reseller. You can directly use the account to purchase Alibaba Cloud resources. The member is used as its own billing account.
Note This parameter is available only for resellers at the international site (alibabacloud.com).

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. The time is displayed in UTC.

AccountId String 112730938585****

The Alibaba Cloud account ID of 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. The time is displayed in UTC.

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

The Alibaba Cloud account name of the member.

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

The ID of the request.

Examples

Sample requests

http(s)://[Endpoint]/?Action=CreateResourceAccount
&DisplayName=Dev
&ParentFolderId=fd-r23M55****
&PayerAccountId=12323344****
&AccountNamePrefix=alice
&Tag=[{"Key":"k1","Value":"v1"}]
&<Common request parameters>

Sample success responses

XML format

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

<CreateResourceAccountResponse>
    <Account>
        <Status>CreateSuccess</Status>
        <Type>ResourceAccount</Type>
        <DisplayName>Dev</DisplayName>
        <FolderId>fd-r23M55****</FolderId>
        <ResourceDirectoryId>rd-3G****</ResourceDirectoryId>
        <JoinTime>2020-12-31T03:37:39.456Z</JoinTime>
        <AccountId>112730938585****</AccountId>
        <JoinMethod>created</JoinMethod>
        <ModifyTime>2020-12-31T03:37:39.456Z</ModifyTime>
        <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",
    "Type" : "ResourceAccount",
    "DisplayName" : "Dev",
    "FolderId" : "fd-r23M55****",
    "ResourceDirectoryId" : "rd-3G****",
    "JoinTime" : "2020-12-31T03:37:39.456Z",
    "AccountId" : "112730938585****",
    "JoinMethod" : "created",
    "ModifyTime" : "2020-12-31T03:37:39.456Z",
    "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. Specify a value that starts with r- followed by 6 characters or starts 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 error message returned because the length of the value specified for the AccountNamePrefix parameter has exceeded the upper limit.
400 NotSupport.Site.Action Site does not allow current action. The error message returned because the operation is not supported at the current site.
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 has not been enabled. Enable the resource directory for the account 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.
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 is already associated with a financial account.
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 cannot be 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 billing account cannot be an account for a reseller.
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 PaymentAccountCreditIdentityTypeError Non-credit identity type or insufficient credit limit, cannot be used as payment account. The error message returned because the billing account is not of the credit identity type or the balance in the credit card for the billing account is insufficient.

For a list of error codes, see Service error codes.