Customer Operation Capabilities
| Details
  • Registering a Customer (Partner)
    • CheckUserIdentity
    • CreateSubCustomer
    • SendVerificationMessageCode
  • Managing Customers (Partner)
    • FreezeSubCustomers
    • ListSubCustomers
    • UnfreezeSubCustomers
  • Real-Name Authentication (Partner)
    • ChangeEnterpriseRealnameAuthentication
    • CreateEnterpriseRealnameAuthentication
    • CreatePersonalRealnameAuth
    • ShowRealnameAuthenticationReviewResult
  • Managing Coupons (Public)
    • ListSubCustomerCoupons
  • Managing Customer Budgets (Partner)
    • ListSubCustomerBudget
    • ShowSubCustomerBudget
    • UpdateSubCustomerBudget
  • Managing Accounts (Customer)
    • ShowCustomerAccountBalances
  • Purchasing a Cloud Service (Public)
    • ListFreeResourceUsages
    • ListOnDemandResourceRatings
    • ListRateOnPeriodDetail
    • ListRenewRateOnPeriod
  • Managing Yearly/Monthly Orders (Public)
    • ListCustomerOrders
    • ShowCustomerOrderDetails
    • ShowRefundOrderDetails
  • Managing Yearly/Monthly Orders (Customer)
    • AutoRenewalResources
    • CancelAutoRenewalResources
    • CancelCustomerOrder
    • CancelResourcesSubscription
    • ListOrderDiscounts
    • ListPayPerUseCustomerResources
    • PayOrders
    • RenewalResources
    • UpdatePeriodToOnDemand
  • Managing Pay-Per-Use Resources (Partner)
    • ListCustomerOnDemandResources
  • Managing Bills (Partner)
    • ListPostpaidBillSum
  • Managing Bills (Customer)
    • ListCustomerselfResourceRecordDetails
    • ListCustomerselfResourceRecords
    • ListMonthlyExpenditures
  • Managing Enterprise Projects (Customer)
    • CreateEnterpriseProjectAuth
  • Managing Enterprise Accounts (Customer)
    • ListEnterpriseSubCustomers
  • Managing Products (Public)
    • ListConversions
    • ListMeasureUnits
    • ListResourceTypes
    • ListServiceResources
    • ListServiceTypes
    • ListUsageTypes
  • Managing Resource Packages (Customer)
    • ListFreeResourceInfos
    • ListFreeResourcesUsageRecords
  • Managing Huawei Cloud Resellers (Partner)
    • ListIndirectPartners
  • Cost Management (Customer)
    • ListCosts
  • Managing Credits(Partner)
    • ShowPartnerConsumptionQuota
  • Managing Invoices (Public)
    • ListInvoices

ListOnDemandResourceRatings

POST
https://bss-intl.myhuaweicloud.com/v2/bills/ratings/on-demand-resources
Advanced
Required parameters only
Default
Encrypt sensitive parameters
*
Region
Headers
*
Authorization
Body
*{
*
project_id
:
*
inquiry_precision
:
*
product_infos
: [
* {
*
id
:
*
cloud_service_type
:
*
resource_type
:
*
resource_spec
:
*
region
:
*
available_zone
:
*
resource_size
:
*
size_measure_id
:
*
usage_factor
:
*
usage_value
:
*
usage_measure_id
:
*
subscription_num
:
*}
+Add
*]
}
API Description

Partners can query the price of a pay-per-use product by criteria on the sales platform.

If the tenant who purchases the product enjoys a discount, the discount amount and the final price can be obtained from the query result.

If the tenant has enjoyed multiple types discounts, the system will return the commercial discount amount and the final price preferentially.

CAUTION:

HUAWEI CLOUD allows you to query products by service type, service region, resource type, and resource specification. Ensure that you enter correct criteria for search. Otherwise, the API returns an error indicating that the product cannot be found.

Constraints

This API can be invoked using the AK/SK or token of the customer.

URL
POST  https://bss-intl.myhuaweicloud.com/v2/bills/ratings/on-demand-resources
Request Parameters
NameTypeINMandatoryDescription
X-Auth-Token
stringheader Yes

Call with customer token

Body Parameters
NameTypeMandatoryDescription
project_id
string Yes

Project ID. If the customer token is used, invoke the API to obtain the project ID of the target region. For details, see Obtaining a User Token with the assume_role Method. For details, see Step 2 in How Can I Replace a Partner Token with a Customer Token.

inquiry_precision
integer No

Precision of the price query result. 0: The default precision of the query result. The result contains a maximum of six decimal places with the unit of USD, such as USD 0.000001. 1: The result contains a maximum of 10 decimal places with the unit of USD, such as USD 1.0000000001. NOTE: Value 0 and value 1 make differences only when the query result contains at least six decimal places.

product_infos
Array of DemandProductInfo objects Yes

Indicates the product information list. For details, see Table 1.

Parameter:
product_infos
NameTypeMandatoryDescription
id
string Yes

The ID is used to identify the mapping between the inquiry result and the request and must be unique in an inquiry.

cloud_service_type
string Yes

Cloud service type code. For example, the cloud service type code of OBS is hws.service.type.obs. To obtain a specific service type, call the API in Querying Cloud Service Types.

resource_type
string Yes

Resource type code. For example, the VM resource type code of ECS is hws.resource.type.vm. To obtain a specific resource type, call the API in Querying Resource Types. The relationship between ResourceType and CloudServiceType is as follows: A resource type represents a resource contained in the cloud service type, and the cloud service type is a combination of multiple resource types.

resource_spec
string Yes

Resource specifications of cloud service types. The following gives some examples of mappings between resource specifications and cloud service types. ECSAdd .win or .linux to the end of the ECS flavor ID based on the OS type, for example, s2.small.1.linux. Call the API for querying details about flavors and extended flavor information to obtain the flavor IDs. Bandwidth12_bgp: dynamic BGP bandwidth billed by traffic12_sbgp: static BGP bandwidth billed by traffic19_bgp: dynamic BGP bandwidth billed by bandwidth19_sbgp: static BGP bandwidth billed by bandwidth19_share: shared bandwidth billed by bandwidth IP address:5_bgp: dynamic BGP public IP address5_sbgp: static BGP public IP address EVSSATA: common I/O EVS diskSAS: high I/O EVS diskGPSSD: general-purpose SSD EVS diskSSD: ultra-high I/O EVS disk

region
string Yes

Cloud service region code, for example, ap-southeast-1. Obtain the value from the Region column in Regions and Endpoints.

available_zone
string No

AZ ID.

resource_size
integer No

Resource capacity. It can be the subscribed volume size or bandwidth size. This parameter must be set for a linear product. Linear products are those whose size must be specified during a subscription, such as hard disks and bandwidth. For example, you can select 10 GB or 20 GB during a disk subscription.

size_measure_id
integer No

Resource capacity measurement ID. The options are: 15: Mbit/s (used when the bandwidth is subscribed)17: GB (used when an EVS disk is subscribed to)14: amount (times) This parameter must be set for a linear product. Linear products are those whose size must be specified during a subscription, such as hard disks and bandwidth. For example, you can select 10 GB or 20 GB during a disk subscription.

usage_factor
string Yes

Usage factor. The value is the same as the usage factor value in the SDR. The mapping between cloud services and usage factors is as follows: Cloud server: DurationCloud disk: DurationEIP: Duration Bandwidth: Duration or upflowMarketplace image: Duration You can call the API in Querying Usage Types to obtain the value of parameter code in Table 3. The value indicates the billing factor of each cloud service.

usage_value
number Yes

Usage value. For example, if you want to inquire a product price by hour, set usageValue to 1 and usageMeasureID to 4 (hour).

usage_measure_id
integer Yes

Usage unit. You can call the API in Querying Measurement Units to obtain the value. For example, if you want to inquire a product price by hour, set usageValue to 1 and usageMeasureID to 4 (hour).

subscription_num
integer Yes

Number of subscriptions.

Response Parameters
Status code: 200

ListOnDemandResourceRatings Responses

NameTypeDescription
amount
number

Discounted amount.

discount_amount
number

Discount amount (difference between the official website price and final price).

official_website_amount
number

Price of a pay-per-use product on the official website.

measure_id
integer

Measurement unit ID. 1: Yuan/Dollar

currency
string

Currency. USD If the parameter is left blank, USD is used.

product_rating_results
Array of DemandProductRatingResult objects

Product price query result. For details, see Table 2.

200 product_rating_results
NameTypeDescription
id
string

The ID is used to identify the mapping between the inquiry result and the request and must be unique in an inquiry.

product_id
string

Product ID.

amount
number

Discounted amount.

discount_amount
number

Discount amount (difference between the official website price and final price).

official_website_amount
number

Price of a pay-per-use product on the official website.

measure_id
integer

Measurement unit ID. 1: Yuan/Dollar

discount_rating_results
Array of DemandDiscountRatingResult objects

Discount details, including the product promotion information and commercial or partner discount information. For details, see Table 3.

200 product_rating_results.discount_rating_results
NameTypeDescription
discount_id
string

Discount ID.

discount_type
integer

Discount type. Commercial discounts:605: Contract commercial discount in the HUAWEI CLOUD BE scenario606: Contract commercial discount in the reseller BE scenario Partner discounts:607: Partner authorized discount

amount
number

Discounted amount.

measure_id
integer

Measurement unit ID. 1: Yuan/Dollar

discount_name
string

Discount name.

Status code: 400

CBC.0100:Parameter error.

Example Request
Example 1
"POST https://bss-intl.myhuaweicloud.com/v2/bills/ratings/on-demand-resources"
{ "project_id": "06488a********832f55c016b0e337d7", "product_infos": [ { "id": "1", "cloud_service_type": "hws.service.type.ec2", "resource_type": "hws.resource.type.vm", "resource_spec": "c3.3xlarge.2.linux", "region": "ap-southeast-3", "usage_factor": "Duration", "usage_value": 2, "usage_measure_id": 4, "subscription_num": 1, "available_zone": null }, { "id": "2", "cloud_service_type": "hws.service.type.ebs", "resource_type": "hws.resource.type.volume", "resource_spec": "SSD", "region": "ap-southeast-1", "usage_factor": "Duration", "usage_value": 2, "usage_measure_id": 4, "subscription_num": 1, "resource_size": 10, "size_measure_id": 17 }, { "id": "3", "cloud_service_type": "hws.service.type.vpc", "resource_type": "hws.resource.type.ip", "resource_spec": "5_bgp", "region": "ap-southeast-3", "usage_factor": "Duration", "usage_value": 3, "usage_measure_id": 4, "subscription_num": 1, "available_zone": null }, { "id": "4", "cloud_service_type": "hws.service.type.vpc", "resource_type": "hws.resource.type.bandwidth", "resource_spec": "12_sbgp", "region": "ap-southeast-1", "usage_factor": "upflow", "usage_value": 4, "usage_measure_id": 10, "subscription_num": 1, "available_zone": "ap-southeast-1a", "resource_size": 1, "size_measure_id": 15 } ], "inquiry_precision": 1 }
Example Response
Status code: 200

ListOnDemandResourceRatings Responses

Example 1
{
"amount": 8.128,
"discount_amount": 0,
"official_website_amount": 8.128,
"measure_id": 1,
"currency": "USD",
"product_rating_results": [
{
"id": "1",
"product_id": "00301-243025-0--0_merge",
"amount": 5.48,
"discount_amount": 0,
"official_website_amount": 5.48,
"measure_id": 1,
"discount_rating_results": []
},
{
"id": "2",
"product_id": "00301-290407774-0--1",
"amount": 0.028,
"discount_amount": 0,
"official_website_amount": 0.028,
"measure_id": 1,
"discount_rating_results": []
},
{
"id": "3",
"product_id": "00301-238601-0--0_merge",
"amount": 0.06,
"discount_amount": 0,
"official_website_amount": 0.06,
"measure_id": 1,
"discount_rating_results": []
},
{
"id": "4",
"product_id": "00301-290407706-0--1",
"amount": 2.56,
"discount_amount": 0,
"official_website_amount": 2.56,
"measure_id": 1,
"discount_rating_results": []
}
]
}
SDK
Click Customer Operation Capabilities (BSSINTL) SDK to download the SDK in your programming language or view the SDK documentation. To learn how to install an SDK and perform authentication, read Usage.
Error Code
Change History
Jan 23, 2025
Querying the Price of a Pay-Per-Use Product
POST
   ListOnDemandResourceRatings
Modify
Modified Parameters
Jul 11, 2024
Querying the Price of a Pay-Per-Use Product
POST
   ListOnDemandResourceRatings
Modify
Modified Parameters
Jun 21, 2024
Querying the Price of a Pay-Per-Use Product
POST
   ListOnDemandResourceRatings
Modify
Modified Parameters
Jun 01, 2023
Querying the Price of a Pay-Per-Use Product
POST
   ListOnDemandResourceRatings
Modify
Modified Parameters

Outline

API Description
Constraints
URL
Request Parameters
Response Parameters
Example Request
Example Response
SDK
Error Code
Change History