Help Center > > API Reference> Transaction Management> Managing Yearly/Monthly Orders> Paying Yearly-Monthly Product Orders

Paying Yearly-Monthly Product Orders

Updated at: Jan 11, 2022 GMT+08:00

Function

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 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.

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

Value Range

Description

order_id

Yes

String

A maximum 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<CouponSimpleInfo>

1

This parameter is reserved.

For details, see Table 1.

discount_infos

No

List<DiscountSimpleInfo>

1

Discount ID list.

For details, see Table 2.

Table 1 CouponSimpleInfo

Parameter

Mandatory

Type

Value Range

Description

id

Yes

String

A maximum of 64 characters

Coupon ID.

type

Yes

Integer

300 to 303

Discount 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

Value Range

Description

id

Yes

String

A maximum of 64 characters

Discount ID.

type

Yes

Integer

[0-3,609]

Discount type.

  • 0: promotion discount
  • 1: contract 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

Value Range

Description

error_code

String

A maximum of 10 characters

Status code.

For details, see Returned Values.

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, cn-north-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. To obtain a specific service type, call the API in Querying Cloud Service Types.

resource_type_code

String

Resource type code. For example, the VM resource type code of ECS is hws.resource.type.vm. To obtain a specific resource type, call the API in Querying Resource Types.

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.

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: 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.

Example Response

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

Returned Values

HTTP Value

Error Code

Description

400

CBC.99000046

Insufficient budget.

400

CBC.30000010

Operation now 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.99003115

An error occurred. Try again later.

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.99003151

This discount cannot be used together with other discounts.

400

CBC.99003155

The enterprise project's fund quota is insufficient, or the project is invalid.

400

CBC.99003156

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

400

CBC.99003162

The add-on package that you purchased does not meet the payment requirement.

400

CBC.99005003

Insufficient balance.

400

CBC.99005036

The customer does not support payment via interface.

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