All Products
Search
Document Center

BSS OpenAPI:GetSubscriptionPrice

Last Updated:Feb 15, 2022

GetSubscriptionPrice

Overview

You can call this operation to query the subscription price of a specified product. Alibaba cloud have various products and complexe configuration parameter that will determin the price. You could use with other APIs to get the appropriate attributes :

Request parameters

Name

Type

Required

Description

ProductCode

String

Yes

The code of the specified product.

ProductType

String

No

The type of the specified product.

SubscriptionType

String

Yes

The type of subscription. Valid values: Subscription

OrderType

String

Yes

The type of the specified order. Valid values: NewOrder: new order, Renewal: renewal order, Upgrade: upgrade order.

ServicePeriodQuantity

Integer

Yes

The validity of the specified service.

ServicePeriodUnit

String

Yes

The unit of the validity of the specified service. Valid values: Year: year, Month: month

Region

String

No

The ID of the region that the specified instance is located in. Find the id with Common Region Id Reference

InstanceId

String

No

The ID of the specified instance. This parameter is required in an upgrade order to obtain the earlier configurations before the upgrade.

ModuleList.n.Config

String

Yes

The configuration of the nth ModuleList. Valid values of n: [1,50]. Format: “AA:aa,BB:bb”. AA and BB are the specified configCode of the ModuleList. aa and bb are the values of the specified configCode.

Call the API DescribePricingModule to get the price module.

ModuleList.n.ModuleCode

String

Yes

The specified moduleCode of the nth ModuleList.

ModuleList.n.ModuleStatus

Integer

No

You need to specify the status value if the configuration of the ModuleList is changed in upgrading. The ModuleStatus indicate the status for the upgrade. Valid values: 1 - module added, 2 - module updated. Default value: 1.

ModuleList.n.Tag

Integer

No

You need to specify the tag for some kind of product when upgrading. The tag will used to indicate some named resource. For example, the tag will be used to indicate the Disk to be upgraded with it’s Id

Response parameters

Name

Type

Required

OriginalPrice

Double

The list price of the specified product

DiscountPrice

Double

The discount of the specified product.

TradePrice

Double

The discounted price of the specified product. TradePrice is the actual price to pay. TradePrice = OriginalPrice - DiscountPrice

Currency

String

The currency used for payment. Valid values: CNY, USD, JPY

ModuleDetails

ModuleDetail

The pricing details of the ModuleList. For more information, see Data dictionary.

PromotionDetails

PromotionDetail

The details of the promotion. For more information, see Data dictionary.

Error codes

Error code

Description

HTTP status code

Description

NotApplicable

This API is not applicable for caller.

400

The error message returned when you are not authorized to use the API.

MissingParameter

The specified parameter xx is mandatory for this request.

400

The error message returned when the xx parameter is not specified.

InvalidParameter

The specified parameter xx is not valid.

400

The error message returned when the xx parameter is invalid.

InvalidModuleCode

The specified moduleCode is not valid.

400

The error message returned when the specified moduleCode parameter is invalid.

InvalidConfigCode

The specified configCode is not valid.

400

The error message returned when the specified configCode parameter is invalid.

InvalidOwner

The specified owner doesn’t belong to caller.

400

The error message returned when the specified owner does not belong to the caller.

InvalidCaller

The specified caller doesn’t exists.

400

The error message returned when the caller is invalid.

InternalError

The request processing has failed due to some unknown error, exception or failure.

400

The error message returned when an unknown internal error occurs.

ProductNotFind

Can not find inquired product, it may not exist.

400

The error message returned when the specified product is invalid.

Sample requests

https://business.ap-southeast-1.aliyuncs.com/?Action=GetSubscriptionPrice
&ModuleList. 1. ModuleCode=ExtBandwidth
&ModuleList. 1. Config=ExtBandwidth%3A50
&ModuleList. 2. ModuleCode=PackageCode
&ModuleList. 2. Config=PackageCode3Aversion_1
&OrderType=NewOrder
&ProductCode=waf
&Quantity=1
&Region=cn
&ServicePeriodQuantity=1
&ServicePeriodUnit=Month
&SubscriptionType=Subscription

Sample responses

"Data": {
    "Quantity": 1,
    "DiscountPrice": 900,
    "ModuleDetails": {
      "ModuleDetail": [
        {
          "ModuleCode": "ExtBandwidth",
          "UnitPrice": 0,
          "CostAfterDiscount": 0,
          "OriginalCost": 800,
          "InvoiceDiscount": 800
        },
        {
          "ModuleCode": "PackageCode",
          "UnitPrice": 0,
          "CostAfterDiscount": 0,
          "OriginalCost": 100,
          "InvoiceDiscount": 100
        }
      ]
    },
    "PromotionDetails": {
      "PromotionDetail": [
        {
          "PromotionId": 1001199213,
          "PromotionName": "Internal settlement does not incur fees"
        }
      ]
    },
    "OriginalPrice": 900,
    "TradePrice": 0,
    "Currency": "CNY"

Data dictionary

ModuleDetail

Name

Type

Description

ModuleCode

String

The ModuleCode of the ModuleList.

UnitPrice

Double

The unit price of the specified product.

OriginalCost

Double

The price of the specified product.

InvoiceDiscount

Double

The discount of the specified product.

CostAfterDiscount

Double

The discounted price of the specified product.

PromotionDetail

Name

Type

Description

PromotionName

String

The name of the specified promotion.

PromotionDesc

Double

The description of the specified promotion.

PromotionId

Long

The ID of the specified promotion.

Note: For ECS price, you could use in option the API DescribePrice to get the updated price and DescribeRenewalPrice to get the subscription renewal price.