查询包年/包月产品价格
功能介绍
客户在自建平台按照条件查询包年/包月产品开通时候的价格。
如果购买该产品的客户享受折扣,可以在查询结果中返回折扣金额以及扣除折扣后的最后成交价。
如果该客户享受多种折扣,系统会返回每种折扣的批价结果。如果客户在下单的时候选择自动支付,则系统会优先应用商务折扣的批价结果。
接口约束
该接口可以使用客户AK/SK或者Token调用。
调试
您可以在API Explorer中调试该接口,支持自动认证鉴权。API Explorer可以自动生成SDK代码示例,并提供SDK代码示例调试功能。
URI
POST /v2/bills/ratings/period-resources/subscribe-rate
请求消息
请求参数
| 参数 | 是否必选 | 参数类型 | 取值范围 | 描述 | 
|---|---|---|---|---|
| project_id | 是 | String | 最大长度:64 | 项目ID。 | 
| product_infos | 是 | List<PeriodProductInfo> | 最大个数:100 | 产品信息列表,询价时要询价产品的信息的列表,具体参见表1。 | 
| 参数 | 是否必选 | 参数类型 | 取值范围 | 描述 | 
|---|---|---|---|---|
| id | 是 | String | 最大长度:64 | ID标识,同一次询价中不能重复,用于标识返回询价结果和请求的映射关系。 | 
| cloud_service_type | 是 | String | 最大长度:400 | 云服务类型编码,例如OBS的云服务类型编码为“hws.service.type.obs”。您可以调用查询云服务类型列表接口获取。 | 
| resource_type | 是 | String | 最大长度:400 | 资源类型编码,例如ECS的VM为“hws.resource.type.vm”。您可以调用查询资源类型列表接口获取。 ResourceType是CloudServiceType中的一种资源,CloudServiceType由多种ResourceType组合提供。 | 
| resource_spec | 是 | String | 最大长度:400 | 云服务类型的资源规格。详情请参见各云服务官方文档。 部分云服务类型和资源规格举例如下: 
 | 
| region | 是 | String | 最大长度:64 | 云服务区编码,例如:“ap-southeast-1”。具体请参见地区和终端节点对应云服务的“区域”列的值。 | 
| period_type | 是 | Integer | [0-4] | 订购包年/包月产品的周期类型。 
 | 
| period_num | 是 | Integer | [1-214783647] | 订购包年/包月产品的周期数。 | 
| subscription_num | 是 | Integer | [1-10000] | 订购包年/包月产品的数量。 | 
| available_zone | 否 | String | 最大长度:64 | 可用区标识,例如:“cn-north-1a”,大小写不敏感。具体请参见地区和终端节点可用分区的“可用分区名称”列的值。 此参数不携带或携带值为空串或携带值为null时,不作为筛选条件。 | 
| resource_size | 否 | Integer | [1-214783647] | 资源容量大小,例如购买的卷大小或带宽大小。 线性产品时此参数必填。线性产品为包括硬盘,带宽等在订购时需要指定大小的产品。例如硬盘在订购时需选择10G、20G等不同大小。 非线性产品时此参数不携带或者携带值为null时,不作为筛选条件。 | 
| size_measure_id | 否 | Integer | - | 资源容量度量标识。 
 线性产品时该参数必填。线性产品为包括硬盘,带宽等在订购时需要指定大小的产品。例如硬盘在订购时需选择10G、20G等不同大小。 非线性产品时此参数不携带或者携带值为null时,不作为筛选条件。 | 
POST https://bss-intl.myhuaweicloud.com/v2/bills/ratings/period-resources/subscribe-rate HTTP/1.1 Content-Type: application/json X-Auth-Token:MIIPAgYJKoZIhvcNAQcCo...ggg1BBIINPXsidG9rZ { "project_id": "84c53ec51e794a4888fb0f5c0cfb2420", "product_infos": [ { "id": "1", "cloud_service_type": "hws.service.type.ec2", "resource_type": "hws.resource.type.vm", "resource_spec": "s3.medium.4.linux", "region": "ap-southeast-1", "available_zone": "ap-southeast-1a", "resource_size": null, "size_measure_id": null, "period_type": 2, "period_num": 1, "subscription_num": 1 }, { "id": "2", "cloud_service_type": "hws.service.type.vpc", "resource_type": "hws.resource.type.ip", "resource_spec": "5_bgp", "region": "ap-southeast-1", "available_zone": null, "resource_size": null, "size_measure_id": 15, "period_type": 2, "period_num": 1, "subscription_num": 1 }, { "id": "3", "cloud_service_type": "hws.service.type.ebs", "resource_type": "hws.resource.type.volume", "resource_spec": "GPSSD", "region": "ap-southeast-1", "available_zone": "ap-southeast-1a", "resource_size": 40, "size_measure_id": 17, "period_type": 2, "period_num": 1, "subscription_num": 1 }, { "id": "4", "cloud_service_type": "hws.service.type.vpc", "resource_type": "hws.resource.type.bandwidth", "resource_spec": "19_bgp", "region": "ap-southeast-1", "available_zone":"ap-southeast-1a", "resource_size": 40, "size_measure_id": 15, "period_type": 2, "period_num": 1, "subscription_num": 1 } ] }
响应消息
响应参数
| 参数 | 参数类型 | 取值范围 | 描述 | 
|---|---|---|---|
| error_code | String | 最大长度:20 | 状态码。具体请参考状态码。只有失败才返回该字段。 | 
| error_msg | String | 最大长度:1000 | 错误描述信息。只有失败才返回该字段。 | 
| official_website_rating_result | OfficialWebsiteRatingResult Object | - | 包年/包月产品的官网价格查询结果,具体参见表2。 | 
| optional_discount_rating_results | List<OptionalDiscountRatingResult> | - | 存在可选折扣优惠时返回折扣优惠维度询价结果,每个折扣优惠一组询价结果,具体参见表4。 
         说明: 
         用户无对应权限时,该字段不返回内容,参见API调用授权(客户)。 | 
| currency | String | 最大长度:20 | 币种。 USD:美元。 值为空代表美元。 | 
| 参数 | 参数类型 | 取值范围 | 描述 | 
|---|---|---|---|
| official_website_amount | BigDecimal | - | 包年/包月产品的官网价格。 | 
| measure_id | Integer | 最大长度:4 | 价格度量单位标识。 1:美元 | 
| product_rating_results | List<PeriodProductOfficialRatingResult> | - | 包年/包月产品的询价结果,具体参见表3。 | 
| 参数 | 参数类型 | 取值范围 | 描述 | 
|---|---|---|---|
| id | String | 最大长度:64 | ID标识,来源于请求中的ID。 | 
| product_id | String | 最大长度:64 | 包年/包月产品ID。 | 
| official_website_amount | BigDecimal | - | 包年/包月产品的官网价格。 | 
| measure_id | Integer | 最大长度:4 | 价格的度量单位标识。 
 | 
| 参数 | 参数类型 | 取值范围 | 描述 | 
|---|---|---|---|
| discount_id | String | 最大长度:64 | 折扣优惠ID。 | 
| amount | BigDecimal | - | 总额,即最终优惠后的金额。 amount= official_website_amount - discountAmount。 | 
| official_website_amount | BigDecimal | - | 包年/包月产品的官网价。 | 
| discount_amount | BigDecimal | - | 可选折扣优惠额,如商务折扣、伙伴折扣、促销折扣和折扣券选用时的优惠额。 | 
| measure_id | Integer | 最大长度:4 | 价格度量单位标识。 1:美元 | 
| discount_type | Integer | 最大长度:32 | 折扣优惠类型。 | 
| discount_name | String | 最大长度:256 | 折扣名称。 | 
| best_offer | Integer | - | 是否为最优折扣。 | 
| product_rating_results | List<PeriodProductRatingResult> | - | 产品询价结果,具体参见表5。 | 
| 参数 | 参数类型 | 取值范围 | 描述 | 
|---|---|---|---|
| id | String | 最大长度:64 | ID标识,来源于请求中的ID。 | 
| product_id | String | 最大长度:64 | 包年/包月产品的ID。 | 
| amount | BigDecimal | - | 总额,即最终优惠后的金额。 amount= official_website_amount - discountAmount。 | 
| official_website_amount | BigDecimal | - | 包年/包月产品的官网价。 | 
| discount_amount | BigDecimal | - | 可选折扣优惠额,如商务折扣、伙伴折扣、促销折扣和折扣券选用时的优惠额。 | 
| measure_id | Integer | 最大长度:4 | 价格度量单位标识。 1:美元 | 
响应示例
HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
Content-Length: length
Date: response time 
{
    "official_website_rating_result": {
        "official_website_amount": 623.78,
        "installment_official_website_amount": null,
        "installment_period_type": null,
        "measure_id": 1,
        "product_rating_results": [
            {
                "id": "1",
                "product_id": "00301-18008-0--0",
                "official_website_amount": 27.2,
                "measure_id": 1,
                "installment_official_website_amount": null,
                "installment_period_type": null
            },
            {
                "id": "2",
                "product_id": "00301-03001-0--0",
                "official_website_amount": 0,
                "measure_id": 1,
                "installment_official_website_amount": null,
                "installment_period_type": null
            },
            {
                "id": "3",
                "product_id": "00301-170006-0--0",
                "official_website_amount": 5.28,
                "measure_id": 1,
                "installment_official_website_amount": null,
                "installment_period_type": null
            },
            {
                "id": "4",
                "product_id": "00301-34543-0--0",
                "official_website_amount": 591.3,
                "measure_id": 1,
                "installment_official_website_amount": null,
                "installment_period_type": null
            }
        ]
    },
    "optional_discount_rating_results": [],
    "currency": "USD"
}
  
     
       
 