All Products
Search
Document Center

BSS OpenAPI:GetPayAsYouGoPrice

Last Updated:Feb 15, 2022

GetPayAsYouGoPrice

Overview

You can call this operation to query the price of a specified Pay-As-You-Go 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. Find the code in Alibaba cloud product code list.

ProductType

String

No

The type of the specified product.

SubscriptionType

String

Yes

The type of billing method. Valid value: PayAsYouGo.

Region

String

No

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

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. You can check the pricing module samples in this document.

ModuleList.n.ModuleCode

String

Yes

The moduleCode of the nth ModuleList.

ModuleList.n.PriceType

String

Yes

The price type of the nth ModuleList. Valid values: Hour: hourly price, Usage: usage-based price, Month: monthly price, Year: annual price

Response parameters

Name

Type

Required

Currency

String

The type of currency. Valid values: CNY, USD, JPY

ModuleDetails

ModuleDetail

The price 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=GetPayAsYouGoPrice
&ProductCode=slb
&SubscriptionType=PayAsYouGo
&Region=cn-qingdao
&ModuleList. 1. ModuleCode=LoadBalancerSpec
&ModuleList. 1. Config=LoadBalancerSpec:slb.s3.large
&ModuleList. 1. PriceType=Hour
&ModuleList. 2. ModuleCode=InternetTrafficOut
&ModuleList. 2. Config=InternetTrafficOut:1
&ModuleList. 2. PriceType=Usage

Sample responses

"ModuleDetails": {
      "ModuleDetail": [
        {
          "ModuleCode": "LoadBalancerSpec",
          "UnitPrice": 0,
          "CostAfterDiscount": 0,
          "OriginalCost": 3.18,
          "InvoiceDiscount": 3.18
        },
        {
          "ModuleCode": "InternetTrafficOut",
          "UnitPrice": 0,
          "CostAfterDiscount": 0,
          "OriginalCost": 0.72,
          "InvoiceDiscount": 0.72
        }
      ]
    },
    "PromotionDetails": {
      "PromotionDetail": [
        {
          "PromotionId": 1001199213,
          "PromotionName": "Free of charge in internal settlement"
        }
      ]
    },
    "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 list price of the specified product.

InvoiceDiscount

Double

The discount of the specified product.

CostAfterDiscount

Double

The discounted price of the specified product to pay. CostAfterDiscount = OriginalCost - CostAfterDiscount

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.