ModifyAppInstanceGroupChargeType

Updated at:

Changes the billing method of a specified app instance group to the target billing method and returns the ID of the billing conversion task to be created.

Operation description

This operation converts the billing method, which may create an order and trigger subsequent billing changes. A successful response or a returned task ID does not indicate that the new billing method has taken effect.

Prerequisites:

  • The resources belong to the current account, and the product and business region match the request. Only one app instance group can be specified per request.

  • The target billing method must be different from the current one, and the target resource specifications must support the corresponding sales and Billable methods.

  • App instance groups that have been added to a valid collection cannot have their Billable methods converted individually.

  • Multiple app instance groups created in the same batch of orders cannot have their Billable methods converted separately.

Parameter relationships and call sequence:

  1. Query the resource details first to confirm the product, business region, and current ChargeType. You can use GetAppInstanceGroup to query cloud app instance groups.

  2. Explicitly specify the target ChargeType. If you need to purchase a subscription, specify the purchase duration by combining Period and PeriodUnit. The period combination must comply with the sales rules currently supported by the resource.

  3. Set AutoPay based on whether automatic payment is allowed. If auto-renewal is involved, explicitly set AutoRenew.

  4. After the call, save the returned AppInstanceGroupModel.TaskId. If there are unpaid orders, complete the payment first, and then query the resource details again to confirm that the billing method has been changed.

This operation does not accept an expiration time parameter. Do not pass the expiration time from other operations into this request. The task examples only illustrate the purpose of the ID and do not define a fixed prefix or length for actual task IDs.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

appstreaming:ModifyAppInstanceGroupChargeType

update

*All Resource

*

None None

Request syntax

POST  HTTP/1.1

Request parameters

Parameter

Type

Required

Description

Example

BizRegionId

string

Yes

The ID of the business region where the target app instance group is located. It must be the same as the actual region to which the resource belongs.

cn-hangzhou

ProductType

string

Yes

The product type. Set this parameter to the following fixed value when you call the operation:

  • CloudApp: Wuying Cloud App.

Valid values:

  • CloudApp :

    Wuying Cloud App.

CloudApp

AppInstanceGroupIds

array

Yes

The list of IDs of the app instance groups to be modified, in JSON array format. You must and can only specify one item at a time. The resources must belong to the current account, the specified product, and the business region.

string

Yes

The ID of a cloud app instance group to be modified. You can obtain it from the cloud app instance group list.

aig-9ciijz60n4xsv****

ChargeType

string

Yes

The target billing method after conversion. It must be different from the current billing method.

  • PrePaid: subscription.

  • PostPaid: pay-as-you-go.

Valid values:

  • PostPaid :

    Pay-as-you-go.

  • PrePaid :

    Subscription.

PrePaid

PromotionId

string

No

The ID of the promotion used for this conversion order. It takes effect only when an order is created and the promotion is applicable. If omitted, no specific coupon is specified. The availability of the promotion is subject to the order result.

17440009****

AutoPay

boolean

No

Specifies whether to allow automatic payment for this conversion order. Default value: false.

  • true: allows automatic payment for the conversion order.

  • false: does not allow automatic payment. If an unpaid order is generated, you must complete the payment separately.

Valid values:

  • true :

    Allows automatic payment.

  • false :

    Does not allow automatic payment.

false

AutoRenew

boolean

No

Specifies whether to enable auto-renewal for this order. We recommend that you explicitly specify this parameter for subscription orders to determine whether to enable auto-renewal.

  • true: enables auto-renewal.

  • false: disables auto-renewal.

Valid values:

  • true :

    Enables auto-renewal.

  • false :

    Disables auto-renewal.

false

Period

integer

No

The numeric part of the purchase duration, used together with PeriodUnit. When converting to subscription and a purchase duration is required, you must specify both parameters. For example, 1 and Month indicate a purchase duration of one month. The specific available purchase durations are determined by the sales rules of the target resource.

1

PeriodUnit

string

No

The unit of the purchase duration, used together with Period. This parameter is case-sensitive. The defined units are as follows:

  • Hour: hour.

  • Day: day.

  • Week: week.

  • Month: month.

  • Year: year.

These units do not mean that any combination can be purchased for every product. When converting to subscription, select a period supported by the target resource. For example, for a resource that supports monthly purchases, you can set Period to 1 and PeriodUnit to Month.

Valid values:

  • Month :

    Month.

  • Year :

    Year.

  • Hour :

    Hour.

  • Day :

    Day.

  • Week :

    Week.

Month

The list of resource IDs is in JSON array format and contains only one item. The product, business region, and target resource must match. The target billing method must not be the same as the current value.

Response elements

Element

Type

Description

Example

object

The response information of this call.

RequestId

string

The unique ID of the request. You can use this ID to troubleshoot request issues.

1CBAFFAB-B697-4049-A9B1-67E1FC5F****

AppInstanceGroupModel

object

The task information for this billing method conversion.

TaskId

string

The ID of the billing conversion order task, used to associate with this conversion. It is returned only when a related order task is required and created. It does not indicate that the payment is completed or the new billing method has taken effect.

task-123

Returns the request ID and the billing conversion task information. A returned task ID indicates that a related order task is returned. You still need to complete the payment and verify the actual billing method of the resource.

Examples

Success response

JSON format

{
  "RequestId": "1CBAFFAB-B697-4049-A9B1-67E1FC5F****",
  "AppInstanceGroupModel": {
    "TaskId": "task-123"
  }
}

Error codes

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.