Queries the subscription price of an Alibaba Cloud service.
Operation description
- Call the QueryProductList operation to obtain the code of the service. For more information, see QueryProductList .
- Call the DescribePricingModule operation to obtain the configuration parameters of the service. For more information, see DescribePricingModule .
- Call the GetSubscriptionPrice operation to obtain the pricing of the service based on the returned configuration parameters.
Debugging
Authorization information
The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action
policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:
- Operation: the value that you can use in the Action element to specify the operation on a resource.
- Access level: the access level of each operation. The levels are read, write, and list.
- Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
- The required resource types are displayed in bold characters.
- If the permissions cannot be granted at the resource level,
All Resources
is used in the Resource type column of the operation.
- Condition Key: the condition key that is defined by the cloud service.
- Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
Operation | Access level | Resource type | Condition key | Associated operation |
---|---|---|---|---|
bssapi:GetSubscriptionPrice | READ |
|
| none |
Request parameters
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
ServicePeriodUnit | string | No | The unit of the service duration. Valid values:
| Year |
SubscriptionType | string | Yes | The billing method. Set the value to Subscription. | Subscription |
ProductCode | string | Yes | The code of the service. For more information about the service code, see Codes of Alibaba Cloud Services. | ecs |
OrderType | string | Yes | The type of the order. Valid values:
| NewOrder |
ServicePeriodQuantity | integer | No | The service duration. | 1 |
ProductType | string | No | The type of the service. Specify the parameter based on the pricing document of the specific service. | ecs |
Region | string | No | The ID of the region in which the instance resides. | cn-hangzhou |
InstanceId | string | No | The ID of the instance for which the price is queried. This parameter is required if you upgrade an instance. You can specify this parameter to obtain the pre-upgrade configurations of the instance. | i-khkjhxxxxxxxxx |
Quantity | integer | No | The quantity. | 1 |
ModuleList | object [] | Yes | The information about the pricing module. | |
ModuleStatus | integer | No | The status of the pricing module. This parameter is required only if the order type is Upgrade. Valid values:
Default value: 1. | 1 |
ModuleCode | string | Yes | The identifier of the Nth pricing module. | PackageCode |
Tag | string | No | The tag of the specified resource. This parameter is required only if you upgrade or modify the configurations of an Alibaba Cloud service. For example, if you want to modify the configurations of a disk, you can use a tag to identify the ID of the disk. | 213213123 |
Config | string | Yes | The configurations of the Nth pricing module. Valid values of N: 1 to 50. Format: AA:aa,BB:bb. The values of AA and BB are the property IDs of the pricing module. The values of aa and bb are the property values of the pricing module. | PackageCode:version_1 |
Response parameters
Examples
Sample success responses
JSON
format
{
"Code": "InvalidConfigCod",
"Message": "Successful",
"RequestId": "30E7066E-AE6F-4E59-AFE6-11386CE3AFA7",
"Success": true,
"Data": {
"OriginalPrice": 900,
"DiscountPrice": 100,
"Currency": "CNY",
"Quantity": 1,
"TradePrice": 0,
"ModuleDetails": {
"ModuleDetail": [
{
"CostAfterDiscount": 0,
"InvoiceDiscount": 100,
"UnitPrice": 0,
"OriginalCost": 200,
"ModuleCode": "PackageCode"
}
]
},
"PromotionDetails": {
"PromotionDetail": [
{
"PromotionDesc": "test",
"PromotionId": 1021199213,
"PromotionName": "test"
}
]
}
}
}
Error codes
For a list of error codes, visit the Service error codes.