Creating a Customer
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.
- 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 themselves.
- 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.
- Newly created customers are associated with their partners in the reseller model by default.
Constraints
- This API can be invoked using the partner AK/SK or token only.
- Huawei Cloud Customer Agreement and Privacy Statement must be displayed on the page for creating a customer on the partner sales platform.
- 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.
- The password must contain at least eight characters, which will take effect since August 1, 2022.
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: Ireland (IE) |
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_-])*)$. If this parameter is not included in the request parameters, is set to "", or is set to null, the value is randomly generated. |
|
No |
String |
A maximum of 64 characters |
Email address. Format: The value must contain @. If this parameter is not included in the request parameters or is set to null, no value is returned. If this parameter is set to "", "" is returned. |
verification_code |
No |
String |
[6] |
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. If this parameter is not included in the request parameters or is set to null, this parameter will not be used. It cannot be set to "". |
password |
No |
String |
The value can be a string of 8 to 32 characters. |
The password must meet the following rules:
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. If this parameter is not included in the request parameters or is set to null, the password is randomly generated. This parameter cannot be set to "". |
is_close_market_ms |
No |
String |
A maximum of 10 characters |
Whether to disable the marketing message sending function.
If this parameter is not included in the request parameters, is set to "", or is set to null, false is returned. |
indirect_partner_id |
No |
String |
A maximum of 64 characters |
Reseller ID. For details about how to obtain such IDs, see Querying the List of Huawei Cloud Resellers. This parameter is mandatory for creating a customer for a Huawei Cloud reseller. If this parameter is not included in the request parameters, is set to "", or is set to null, this parameter will not be used. |
include_association_result |
No |
Boolean |
- |
Whether to return the result of associating a partner and sub-customer.
The default value is false. If this parameter is not included in the request parameters, is set to "", or is set to null, false is returned. |
Example Request
POST https://bss.myhuaweicloud.eu/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": "IE", "xaccount_id": "35rey****", "xaccount_type": "***_IDP", "password": "*******", "is_close_market_ms": "true", "indirect_partner_id": "a0d736********aab6502d1a828c1809", "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.
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
- 4xx: This class of HTTP status code is intended for situations in which the error seems to have been caused by the client, for example, the request contains bad syntax or incorrect parameters. You must ensure the request is correct.
- 5xx: This class of HTTP status code is intended for cases in which the Huawei Cloud server is aware that it has encountered an error or is otherwise incapable of performing the request. In this case, contact Huawei Cloud customer service.
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.50010059 |
Customer association not supported for distributors. |
400 |
CBC.99000038 |
The account name already exists. |
400 |
CBC.99000028 |
The email address already exists. |
400 |
CBC.99000031 |
Invalid account name. |
400 |
CBC.5016 |
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.99000037 |
You do not have the permission to operate this Huawei Cloud reseller. |
500 |
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.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. |
400 |
CBC.50010085 |
Customer association not allowed. The account of this partner has been restricted. |
400 |
CBC.50010086 |
Customer association not allowed. This partner is a Huawei Cloud reseller, and the account of its associated distributor has been restricted. |
400 |
CBC.50010120 |
Customer development not supported. There are no credits granted for the partner. |
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.