Updated on 2024-10-29 GMT+08:00

Paying Yearly/Monthly Product Orders (Old)

Function

This API will be brought offline soon. For details about the new API for paying yearly/monthly product orders, see Paying Yearly/Monthly Product Orders.

A customer can invoke this API to pay yearly/monthly product orders in the pending payment status.

Customers can follow the instructions described in Payment to pay yearly/monthly product orders in the pending payment status in Billing Center.

  • This API supports both monthly settlement and balance payment. Monthly settlement is preferred.
  • Balance payment includes cash account payment and credit account payment. If both accounts have balance, the cash account payment is preferred.
  • Restrictions for using a discount and coupon at the same time:
    • If the restriction attribute of a coupon contains field simultaneousUseWithEmpowerDiscount with a value of 0, the discount and coupon cannot be used at the same time.
    • If the restriction attribute of a coupon contains field simultaneousUseWithContractDiscount with a value of 0, the discount and coupon cannot be used at the same time.
    • If the restriction attribute of a coupon contains field minConsumeDiscount and the values of discount_ratio for all the order items are less than the value of minConsumeDiscount, the discount and coupon cannot be used at the same time.
    • If the restriction attribute of a coupon contains field simultaneousUseWithPromotionDiscount with a value of 0, the discount and coupon cannot be used at the same time.
  • When this API is invoked by a unified accounting member, if their enterprise master account has coupons available for the orders, the coupons are automatically applied without the need to include coupon IDs in a request.

Constraints

This API can be invoked only by the customer AK/SK or token.

URI

POST /v2/orders/customer-orders/pay

Request

Request Parameters

Parameter

Mandatory

Type

Maximum Length of Characters

Description

order_id

Yes

String

A maximum of 64 characters

Order ID.

The value is the same as the order_id value in the response message of invoking the API described in Querying Orders or the order_ids value in the response message of API described in Renewing Subscription to Yearly/Monthly Resources.

coupon_infos

No

List<CouponSimpleInfoOrderPay>

[0-3]

This parameter is reserved.

For details, see Table 1.

If this parameter is not included in request parameters, is set to null, or is set to an empty array, no coupons are used in payment.

CAUTION:

When this API is invoked by a unified accounting member, if their enterprise master account has coupons available for the orders, the coupons are automatically applied without the need to include coupon IDs in a request.

discount_infos

No

List<DiscountSimpleInfo>

[0-1]

Discount ID list.

For details, see Table 2.

If this parameter is not included in request parameters, is set to null, or is set to an empty array, no discount is used in payment.

Table 1 CouponSimpleInfoOrderPay

Parameter

Mandatory

Type

Maximum Length of Characters

Description

id

Yes

String

A maximum of 64 characters

Coupon ID.

type

Yes

Integer

[300-303]

Coupon type.

  • 300: Discount coupon (reserved)
  • 301: Promotion coupon
  • 302: Promotion flexi-purchase coupon (reserved)
  • 303: Promotion stored-value card (reserved)
Table 2 DiscountSimpleInfo

Parameter

Mandatory

Type

Maximum Length of Characters

Description

id

Yes

String

A maximum of 64 characters

Discount ID.

type

Yes

Integer

[0,2,3,609]

Discount type.

  • 0: promotion discount
  • 2: commercial discount
  • 3: discount granted by a partner
  • 609: discount for adjusting an order price
    NOTE:

    Once the discount 609 (discount for adjusting an order price) is used during order payment, the discount must be used and the discount type cannot be changed.

Example Request

POST https://bss-intl.myhuaweicloud.com/v2/orders/customer-orders/pay HTTP/1.1
Content-Type: application/json
X-Auth-Token: MIIPAgYJKoZIhvcNAQcCo...ggg1BBIINPXsidG9rZ
{
    "coupon_infos": [
        {
            "id": "CP200527025610NGSC",
            "type": 301
        }
    ],
   "discount_infos": [
        {
            "id": "PDP2011260815047721TYT48G0BA02EI",
            "type": 1
        }
    ],
    "order_id": "CS20052715001E4CR"
}

Response

Response Parameters

Status code: 204

Success is returned by default.

Status code: 400

Parameter

Type

Maximum Length of Characters

Description

error_code

String

A maximum of 10 characters

Error code.

For details, see Status Codes.

error_msg

String

A maximum of 256 characters

Error description.

quota_infos

List<QuotaInfo>

-

List of the resources whose quota or capacity is insufficient.

For details, see Table 3.

This parameter is valid only when error_code is set to CBC.99003141.

  • If the quota is insufficient, notify the customer to submit a service ticket on the HUAWEI CLOUD official website to increase the quota and then pay the order.
  • If the capacity is insufficient, notify the customer to place an order again.
  • If the specifications have changed, notify the customer to place an order again.

enterprise_project_auth_result

List<EnterpriseProject>

-

Information about the enterprise project whose fund is insufficient.

For details, see Table 4.

This parameter is valid only when error_code is set to CBC.99003155.

Table 3 QuotaInfo

Parameter

Type

Description

region

String

Cloud service region code, for example, ap-southeast-1. Obtain the value from the Region column in Regions and Endpoints.

service_type_code

String

Cloud service type code. For example, the cloud service type code of OBS is hws.service.type.obs.

resource_type_code

String

Resource type code. For example, the resource type code of VM is hws.resource.type.vm.

The relationship between ResourceType and CloudServiceType is as follows: A resource type represents a resource contained in the cloud service type, and the cloud service type is a combination of multiple resource types.

resource_spec_code

String

Resource specifications of the subscribed cloud service products.

For example, the resource specification of a small-scale VM is s2.small.1.linux.

service_type_name

String

Cloud service type. For example, the cloud service type of ECS is Elastic Cloud Server.

resource_type_name

String

Resource type. For example, the resource type of ECS is Cloud Host.

auth_result

Integer

Verification result of the change of the cloud service quota, capacity, or specifications.

  • 1: The quota is insufficient.
  • 2: The capacity is insufficient.
  • 3: The resource specifications are incorrect. This value is valid only when the resource specifications change between the time when a customer places an order and the time when the customer pays the order.
  • 4: The associated resource information is incorrect. This value is valid only when the resource specifications change between the time when a customer places an order and the time when the customer pays the order.
  • 99: Other errors. This value is valid only when the resource specifications change between the time when a customer places an order and the time when the customer pays the order.

available_zone

String

AZ ID.

For details, see the AZ names of regions listed on the Regions and Endpoints, for example, cn-north-1a.

Table 4 EnterpriseProject

Parameter

Type

Description

enterprise_project_id

String

ID of the enterprise project where an order belongs.

  • 0: ID of a default project
  • – 1 or null: Non-project ID

enterprise_project_name

String

Enterprise project name.

auth_status

Integer

Verification result of the enterprise project's fund quota.

10: The fund quota is insufficient or the project is invalid.

11: The organization budget quota is insufficient.

Example Response

HTTP/1.1 204 No Content
Content-Type: application/json;charset=UTF-8
Content-Length: length
Date: response time 

Status Codes

  • 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 Status Code

Error Code

Description

400

CBC.99000046

Insufficient budget.

400

CBC.30000010

Operation not allowed because the order is invalid or does not exist.

400

CBC.99003106

The order status has changed and no payment can be made.

400

CBC.99003108

This discount cannot be used for this order.

400

CBC.99003110

The order has not been paid before the expiration time. Please re-submit the order.

400

CBC.99003112

The coupon or stored-value card has been used.

400

CBC.99003116

The restriction to selected coupon regulates that the coupon cannot be used with the discount at the same time.

400

CBC.99003117

The selected discount is less than the minimum discount rate configured for the selected coupon.

Note: For example, if the minimum discount rate configured for a coupon is 90% and the selected discount is less than 90% in all order lines, the discount cannot be used.

400

CBC.99003141

The cloud service quota or capacity is insufficient, or the resource specifications have changed.

400

CBC.99003147

Discounts and cash coupons cannot be both used.

400

CBC.99003151

This discount cannot be used together with other discounts.

400

CBC.99003155

Insufficient enterprise project fund quota, or invalid project.

400

CBC.99003156

Coupons applicable to KooGallery products cannot be used together with dedicated coupons.

400

CBC.99003162

The validity period set for the bandwidth add-on package cannot be earlier than the system time.

400

CBC.99003198

Insufficient budget of the organization.

400

CBC.99005003

Insufficient balance.

400

CBC.99006093

Failed to obtain the tax rate.

400

CBC.99005036

Payment via API not allowed for this customer. (Payment by balance and monthly-settled payment are not allowed.)

400

CBC.99008040

Too many attempts.

400

CBC.7281

Renewal, unsubscription, or payment not supported. Your account has been frozen.

500

CBC.0999

Other errors.

400

CBC.99000089

Operation failed. Sub orders of a combine order cannot be processed independently.

400

CBC.99008056

The maximum number of transactions allowed today has been reached.