All Products
Search
Document Center

GetPayAsYouGoPrice

Last Updated: Mar 09, 2020

API Name

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:Process of query price using API

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

  1. https://business.ap-southeast-1.aliyuncs.com/?Action=GetPayAsYouGoPrice
  2. &ProductCode=slb
  3. &SubscriptionType=PayAsYouGo
  4. &Region=cn-qingdao
  5. &ModuleList. 1. ModuleCode=LoadBalancerSpec
  6. &ModuleList. 1. Config=LoadBalancerSpec:slb.s3.large
  7. &ModuleList. 1. PriceType=Hour
  8. &ModuleList. 2. ModuleCode=InternetTrafficOut
  9. &ModuleList. 2. Config=InternetTrafficOut:1
  10. &ModuleList. 2. PriceType=Usage

Sample responses

  1. "ModuleDetails": {
  2. "ModuleDetail": [
  3. {
  4. "ModuleCode": "LoadBalancerSpec",
  5. "UnitPrice": 0,
  6. "CostAfterDiscount": 0,
  7. "OriginalCost": 3.18,
  8. "InvoiceDiscount": 3.18
  9. },
  10. {
  11. "ModuleCode": "InternetTrafficOut",
  12. "UnitPrice": 0,
  13. "CostAfterDiscount": 0,
  14. "OriginalCost": 0.72,
  15. "InvoiceDiscount": 0.72
  16. }
  17. ]
  18. },
  19. "PromotionDetails": {
  20. "PromotionDetail": [
  21. {
  22. "PromotionId": 1001199213,
  23. "PromotionName": "Free of charge in internal settlement"
  24. }
  25. ]
  26. },
  27. "Currency": "CNY"

Data dictionary

ModuleDetailModuleDetail

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

PromotionDetailPromotionDetail

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.