Help Center > > API Reference> Customer Management> Customer Registration> Creating a Customer

Creating a Customer

Updated at: Dec 15, 2021 GMT+08:00

Function

This API is used to create a HUAWEI CLOUD account for a customer when the customer creates an account on your sales platform, and bind the customer account on the partner sales platform to the HUAWEI CLOUD account. In addition, the HUAWEI CLOUD account is bound to the partner account.

  • After a HUAWEI CLOUD account is created for a customer, SAML authentication is required if the customer wants to switch from the partner sales platform to the HUAWEI CLOUD official website. For details, see "SAML Authentication" in Web UI Mode.
  • If you do not enter the email address when creating a customer, the customer cannot receive any email notification from HUAWEI CLOUD. The customer needs to log in to the HUAWEI CLOUD to add the email address by itself.
  • When the API for creating a customer is invoked, HUAWEI CLOUD will synchronously create a HUAWEI CLOUD customer account and send the customer ID and account name to the partner platform. Then, HUAWEI CLOUD associates the customer with the partner asynchronously. To query the association result, you can invoke the API described in Querying Customers.

Constraints

  • This API can be invoked using the partner AK/SK or token only.
  • Privacy Statement must be displayed on the page for creating a customer on the partner sales platform.
  • This API is used to replace the partner token with the customer token to allow the partner to provide or query resources as a customer. Therefore, the partner must obtain the customer authorization before invoking this API.
  • Obtain the verification code using the API in Sending a Verification Code and then invoke this API if you enter the email address when creating a customer.

URI

POST /v2/partners/sub-customers

Request

Request Parameters

Parameter

Mandatory

Type

Value Range

Description

domain_area

Yes

String

A maximum of 2 characters

Two-letter ID representing the country/region of the customer. The ID complies with the ISO 3166 standard.

Example: MX for Mexico

xaccount_id

Yes

String

A maximum of 128 characters

Unique user ID on the partner sales platform. The ID is allocated by the partner.

xaccount_type

Yes

String

A maximum of 64 characters

Platform ID assigned by Huawei to a partner.

This value is assigned by Huawei. For details about how to obtain the platform ID, see How Do I Obtain the xaccountType Value?

domain_name

No

String

[5-32]

HUAWEI CLOUD username of the customer.

If this parameter is left blank, the value is generated randomly.

The value cannot start with op_ or shadow_ and cannot contain only digits.

The verification length is 5 to 32 digits and the verification rules are ^([a-zA-Z_-]([a-zA-Z0-9_-])*)$.

email

No

String

A maximum of 64 characters

Email address.

Format: The value must contain @.

verification_code

No

String

A maximum of 10 characters

Verification code.

Invoke the API described in Sending a Verification Code to obtain the verification code.

If no email address is available, you do not need to enter the verification code.

password

No

String

[6-32]

The password must meet the following rules:

  • Contains at least two of the following character types: uppercase letters, lowercase letters, digits, and special characters.
  • Differs from the account name or the account name in reverse order.
  • Does not contain the email address.

If this parameter is left blank, a user does not have a password and cannot directly log in to HUAWEI CLOUD. In this case, the user can only switch to HUAWEI CLOUD from the partner system using SSO.

is_close_market_ms

No

String

A maximum of 10 characters

Whether to disable the marketing message sending function.

  • true: Disable this function.
  • false: Retain this function enabled (default).

include_association_result

No

Boolean

-

Whether to return the result of associating a partner and sub-customer.

  • true: Returns the association result.
  • false: Does not return the association result.

The default value is false.

Example Request

POST  https://bss-intl.myhuaweicloud.com/v2/partners/sub-customers HTTP/1.1
Content-Type: application/json
X-Auth-Token: MIIPAgYJKoZIhvcNAQcCo...ggg1BBIINPXsidG9rZ

{
  "domain_name": "test",
  "email": "***@163.com",
  "verification_code": "253***",
  "domain_area": "HK",
  "xaccount_id": "35rey****",
  "xaccount_type": "***_IDP",
  "password": "*******",
  "is_close_market_ms": "true",
  "include_association_result": "false"
}

Response

Response Parameters

Parameter

Type

Value Range

Description

error_code

String

A maximum of 16 characters

Error code. For details, see Returned Values. This parameter is returned only when a failure occurs.

error_msg

String

A maximum of 1024 characters

Error description. This parameter is returned only when a failure occurs.

domain_id

String

A maximum of 64 characters

Customer ID.

This parameter is returned only when the operation is successful or an error whose code is CBC.99000050 occurs.

domain_name

String

A maximum of 64 characters

HUAWEI CLOUD username of the customer.

  • If the request contains this parameter, the response must contain the same parameter value as the request.
  • If the request does not contain this parameter, the response contains a 32-bit character string randomly generated by the system.

This parameter is returned only when the operation is successful or an error whose code is CBC.99000050 occurs.

Example Response

HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
Content-Length: length
Date: response time  
{
  "domain_id": "06a7969058802f0c0f01c00b91846780",
  "domain_name": "a0d736359ada40aab6502d1a828c1809"
}

Returned Values

HTTP Value

Error Code

Description

400

CBC.0100

Parameter error.

Check whether the input parameters meet the requirements according to the request parameter descriptions.

400

CBC.0101

Invalid parameter.

400

CBC.99000038

The account name already exists.

400

CBC.99000028

The email address already exists.

400

CBC.99000031

Invalid account name.

400

CBC.99000032

Invalid email address format.

400

CBC.99000039

Duplicate xAccountId.

400

CBC.99000004

An exception occurred when the customer authorized rights to the partner.

400

CBC.99000036

Invalid password.

400

CBC.99000034

Currently, registration with HUAWEI CLOUD is not available for users in this country.

400

CBC.99000050

Query for the result of associating partner and its sub-customer timed out. Refer to Querying Customers to check the association result.

400

CBC.99000051

Customer creation failed because this mobile number or email address has been preregistered by Huawei.

400

CBC.99000055

Referral model not supported.

400

CBC.99004007

Invalid email address.

400

CBC.99004008

Invalid verification code.

400

CBC.99004009

The verification code is available, but the number of verification failures is greater than 3.

400

CBC.99004010

The verification code entered by the client is incorrect.

400

CBC.99005035

This API cannot be used by a sandbox account.

401

CBC.0154

Invalid or expired token.

403

CBC.0151

Access denied.

500

CBC.0999

Other errors.

Did you find this page helpful?

Submit successfully!

Thank you for your feedback. Your feedback helps make our documentation better.

Failed to submit the feedback. Please try again later.

Which of the following issues have you encountered?







Please complete at least one feedback item.

Content most length 200 character

Content is empty.

OK Cancel