Updated on 2024-04-30 GMT+08:00

Renewing Subscription to Yearly/Monthly Resources

Function

A customer can renew subscription to yearly/monthly resources on the partner sales platform.

When subscription to yearly/monthly resources of a customer is about to expire, the customer can renew the subscription to the resources.

Customers can follow the instructions described in Manually Renewing a Resource to renew the subscription to the yearly/monthly resources in Billing Center.

  • If a primary resource has resources attached, the system renews the subscription to both the primary resource and its attached ones after this API is invoked. You can invoke Querying Customer's Yearly/Monthly Resources to obtain the details of the attached resources.
  • If a newly purchased EVS disk is attached to an ECS, but this disk is not the attached to any of the ECS primary resources, you must invoke Querying Customer's Yearly/Monthly Resources to obtain the details of the ECS primary resources and its attached ones.
  • This API supports automatic payment. For details about how to use discounts or coupons during payment, see Support for Discounts or Coupons.

Constraints

This API can be invoked only by the customer AK/SK or token. This is because that partners cannot buy products by themselves.

Debugging

You can debug the API in API Explorer which supports automatic authentication. API Explorer can automatically generate and debug example SDK code.

URI

POST /v2/orders/subscriptions/resources/renew

Request

Request Parameters

Parameter

Mandatory

Type

Value Range

Description

resource_ids

Yes

List<String>

[1-10]

Resource IDs.

Only the primary resource ID is supported. A maximum of 10 resource IDs can be configured.

To determine the primary resources, query is_main_resource in the response of the API described in Querying Customer's Yearly/Monthly Resources.

period_type

Yes

Integer

2, 3

Period type. The value can be:

  • 2: month
  • 3: year

period_num

Yes

Integer

1 to 11

Number of periods.

  • Month: 1 to 11
  • Year: 1 to 3

expire_policy

Yes

Integer

0 to 3

Expiration policy. This field has been discarded. Do not use this field. This parameter cannot be left empty and needs to be carried. The carried enumeration does not take effect.

  • 0: Entering a grace or retention period
  • 1: Yearly/monthly to pay-per-use
  • 2: Automatic unsubscription
  • 3: Automatic renewal

is_auto_pay

No

Integer

0, 1

Whether enable automatic payment.

  • 0: No
  • 1: Yes

If this parameter is not included in the request parameters or is set to null, the default value is 0 indicating not to enable the automatic payment.

Example Request
POST https://bss-intl.myhuaweicloud.com/v2/orders/subscriptions/resources/renew HTTP/1.1
Content-Type: application/json
X-Auth-Token: MIIPAgYJKoZIhvcNAQcCo...ggg1BBIINPXsidG9rZ
{
    "resource_ids": [
        "96308d5efd7841b9a4dac673d84d0e14"
    ],
    "period_type": 2,
    "period_num": 1,
    "expire_policy": 1,
    "is_auto_pay": 0
}

Response

Response Parameters

Status code: 200

Table 1 Response body parameters

Parameter

Type

Description

order_ids

List<String>

List of order IDs generated when resource subscription is renewed.

fail_resource_infos

List<FailResourceInfo>

List of resources that failed to be renewed. This parameter has a value only when there are resources that fail to be renewed. For details, see Table 2.

This parameter is reserved.

Table 2 FailResourceInfo

Parameter

Type

Description

error_code

String

Error code.

For details, see Error Codes.

This parameter is reserved.

error_msg

String

Error description.

This parameter is reserved.

resource_id

String

Resource ID.

This parameter is reserved.

Status code: 400

Table 3 Response body parameters

Parameter

Type

Description

error_code

String

Status code.

For details, see Returned Values.

error_msg

String

Error description.

order_ids

List<String>

List of order IDs generated when resource subscription is renewed.

expiredResourceIds

List<String>

List of expired or non-existent resources.

This parameter has a value only when the error code is CBC.99003016.

Example Response
HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
Content-Length: length
Date: response time  
{
  "order_ids": [
    "CS19040119281JMYC"
  ],
  "fail_resource_infos":[]
}

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.

400

CBC.30010036

Renewal is only supported for primary resources.

400

CBC.30050006

Automatic order payment failed.

400

CBC.99000092

Incorrect subscription period.

400

CBC.99003100

This operation is not allowed because some resources are included in your orders to be paid.

400

CBC.7281

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

400

CBC.99003016

The resources have expired and been deleted or do not exist.

400

CBC.99003144

Resources have being unsubscribed from or changed.

400

CBC.99003154

The sum of the existing and renewal durations has exceeded the maximum allowed. Select another renewal duration.

400

CBC.99003634

Resources in discount packages must be renewed as a whole and cannot be renewed together with other resources.

403

CBC.0151

Access denied.

500

CBC.0999

Other errors.