更新时间:2024-01-17 GMT+08:00
分享

查询包年/包月产品价格

功能介绍

客户在自建平台按照条件查询包年/包月产品开通时候的价格。

如果购买该产品的客户享受折扣,可以在查询结果中返回折扣金额以及扣除折扣后的最后成交价。

如果该客户享受多种折扣,系统会返回每种折扣的批价结果。如果客户在下单的时候选择自动支付,则系统会优先应用商务折扣的批价结果。

华为云根据云服务类型、资源类型、云服务区和资源规格四个条件来查询产品,查询时请确认这4个查询条件均输入正确,否则该接口会返回无法找到产品的错误。

接口约束

该接口可以使用客户AK/SK或者Token调用

调试

您可以在API Explorer中调试该接口。

URI

POST /v2/bills/ratings/period-resources/subscribe-rate

请求消息

请求参数

参数

是否必选

参数类型

取值范围

描述

project_id

String

最大长度:64

项目ID。

说明:

获取方法:

  • 访问“我的凭证”页面,在“项目列表”页签,可以查看不同所属区域对应的项目ID。
  • IAM子用户调用此接口,需要IAM主账号授权,具体请参考创建用户组并授权

product_infos

List<PeriodProductInfo>

最大个数:100

产品信息列表,询价时要询价产品的信息的列表,具体参见表1

表1 PeriodProductInfo

参数

是否必选

参数类型

取值范围

描述

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

云服务类型的资源规格。详情请参见各云服务官方文档。

部分云服务类型和资源规格举例如下:

  • 弹性云服务器:

    根据操作系统类型在云服务器规格的ID后添加“.win”或“.linux”,例如“s2.small.1.linux”。云服务器规格的ID字段,您可以调用查询规格详情和规格扩展信息列表接口获取。

  • 带宽:
    • 12_bgp:动态BGP按流量计费带宽
    • 12_sbgp:静态BGP按流量计费带宽
    • 19_bgp:动态BGP按带宽计费带宽
    • 19_sbgp:静态BGP按带宽计费带宽
    • 19_share:按带宽计费共享带宽
  • IP:
    • 5_bgp:动态BGP公网IP
    • 5_sbgp:静态BGP公网IP
  • 云数据库:

    云数据库的资源规格信息,您可以调用查询数据库规格接口获取。

  • 分布式缓存服务:

    分布式缓存服务的资源规格信息,您可以调用查询产品规格接口获取。

  • 云硬盘:
    • SATA:普通IO云硬盘
    • SAS:高IO云硬盘
    • GPSSD:通用型SSD云硬盘
    • SSD:超高IO云硬盘
    • ESSD:极速型SSD云硬盘
    • GPSSD2.storage:通用型SSD V2云硬盘容量

region

String

最大长度:64

云服务区编码,例如:“cn-north-1”。具体请参见地区和终端节点对应云服务的“区域”列的值。

period_type

Integer

[0-4]

订购包年/包月产品的周期类型。

  • 0:天
  • 2:月
  • 3:年
  • 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

-

资源容量度量标识。

  • 15:Mbps(购买带宽时使用)
  • 17:GB(购买云硬盘时使用)
  • 14:个

线性产品时该参数必填。线性产品为包括硬盘,带宽等在订购时需要指定大小的产品。例如硬盘在订购时需选择10G、20G等不同大小。

非线性产品时此参数不携带或者携带值为null时,不作为筛选条件。

fee_installment_mode

String

最大长度:64

费用分期模式。

  • HALF_PAY:半付
  • ZERO_PAY:零付
  • NA:不支持费用分期模式
说明:
  • 此参数不携带或携带值为空串或携带值为null时,默认值为“NA”。
  • 暂只支持IES产品。
请求示例
POST https://bss.myhuaweicloud.com/v2/bills/ratings/period-resources/subscribe-rate HTTP/1.1
Content-Type: application/json
X-Auth-TokenMIIPAgYJKoZIhvcNAQcCo...ggg1BBIINPXsidG9rZ
{
    "project_id": "84c53ec51e794a4888fb0f5c0cfb2420",
    "product_infos": [
        {
            "id": "1",
	   "cloud_service_type": "hws.service.type.ec2",
	   "resource_type": "hws.resource.type.vm",
      "resource_spec": "c6.2xlarge.2.linux",
	   "region": "cn-north-1",
	   "available_zone": "cn-east-3a",
	   "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": "cn-north-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": "cn-north-1",
	   "available_zone": "cn-east-3a",
	   "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": "cn-north-1",
	   "available_zone":"cn-east-3a",
	   "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

currency

String

最大长度:20

币种。

CNY:人民币。

值为空代表人民币。

表2 OfficialWebsiteRatingResult

参数

参数类型

取值范围

描述

official_website_amount

BigDecimal

-

包年/包月产品的官网价格。

installment_official_website_amount

String

-

分期金额的官网价。

说明:

暂只支持IES产品。

installment_period_type

Integer

-

分期付款的周期类型。

  • 2:月
说明:

暂只支持IES产品。

measure_id

Integer

最大长度:4

价格度量单位标识。

1:元

product_rating_results

List<PeriodProductOfficialRatingResult>

-

包年/包月产品的询价结果,具体参见表3

表3 PeriodProductOfficialRatingResult

参数

参数类型

取值范围

描述

id

String

最大长度:64

ID标识,来源于请求中的ID。

product_id

String

最大长度:64

包年/包月产品ID。

official_website_amount

BigDecimal

-

包年/包月产品的官网价格。

measure_id

Integer

最大长度:4

价格的度量单位标识。

  • 1:元

installment_official_website_amount

String

-

分期金额的官网价。

说明:

暂只支持IES产品。

installment_period_type

Integer

-

分期付款的周期类型。

  • 2:月
说明:

暂只支持IES产品。

表4 OptionalDiscountRatingResult

参数

参数类型

取值范围

描述

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

折扣优惠类型。

  • 合同商务折扣:
    • 605:华为云BE场景下的合同商务折扣
    • 606:分销商BE场景下的合同商务折扣
  • 伙伴授予折扣:

    607:合作伙伴授予折扣-折扣率

discount_name

String

最大长度:256

折扣名称。

best_offer

Integer

-

是否为最优折扣。

  • 0:不是最优折扣,为缺省值。
  • 1:是最优折扣

    最优折扣:在商务折扣、伙伴折扣中选择(优惠金额最大的折扣为最优,优惠金额相等则按此顺序排优先级),促销折扣,折扣券不参与最优折扣的计算。

product_rating_results

List<PeriodProductRatingResult>

-

产品询价结果,具体参见表5

installment_official_website_amount

String

最大长度:64

分期金额的官网价。

说明:

暂只支持IES产品。

installment_official_discount_amount

String

最大长度:64

分期金额的折扣价。

说明:

暂只支持IES产品。

installment_amount

String

最大长度:64

分期金额的成交价。

说明:
  • 分期金额的成交价=分期金额的官网价-分期金额的折扣价。
  • 暂只支持IES产品。

installment_period_type

Integer

-

分期付款的周期类型。

  • 2:月
说明:

暂只支持IES产品。

表5 PeriodProductRatingResult

参数

参数类型

取值范围

描述

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:元

installment_official_website_amount

String

最大长度:64

分期金额的官网价。

说明:

暂只支持IES产品。

installment_official_discount_amount

String

最大长度:64

分期金额的折扣价。

说明:

暂只支持IES产品。

installment_amount

String

最大长度:64

分期金额的成交价。

说明:
  • 分期金额的成交价=分期金额的官网价-分期金额的折扣价。
  • 暂只支持IES产品。

installment_period_type

Integer

-

分期付款的周期类型。

  • 2:月
说明:

暂只支持IES产品。

响应示例

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": 3777.2,
        "installment_official_website_amount": null,
        "installment_period_type": null,
        "measure_id": 1,
        "product_rating_results": [
            {
                "id": "1",
                "product_id": "00301-233377-0--0",
                "official_website_amount": 834.2,
                "measure_id": 1,
                "installment_official_website_amount": "1003.33",
                "installment_period_type": null
            },
            {
                "id": "2",
                "product_id": "da27d47d84ff4adba7de3ca3b0c9ce08",
                "official_website_amount": 0,
                "measure_id": 1,
                "installment_official_website_amount": null,
                "installment_period_type": null
            },
            {
                "id": "3",
                "product_id": "OFFI535014055638646785",
                "official_website_amount": 28,
                "measure_id": 1,
                "installment_official_website_amount": null,
                "installment_period_type": null
            },
            {
                "id": "4",
                "product_id": "60564b0c1f484feaad26cda1acc6d4d8",
                "official_website_amount": 2915,
                "measure_id": 1,
                "installment_official_website_amount": null,
                "installment_period_type": null
            }
        ]
    },
    "optional_discount_rating_results": [
    ],
    "currency": "CNY"
}

状态码

  • 状态码4xx:由于明显的客户端错误(例如,格式错误的请求语法、参数错误等),华为云会返回4xx错误码,请及时检查请求消息的正确性,重新发起请求。
  • 状态码5xx:由于华为云系统原因,导致无法完成明显有效请求的处理,可及时联系华为云客服处理。

HTTP状态码

错误码

错误描述

400

CBC.0100

参数错误。

400

CBC.99006006

产品未发现。

400

CBC.99006055

询价结果超过金额最大限制。

403

CBC.0151

拒绝访问。

429

CBC.0250

消息流量控制。

500

CBC.0999

其他错误。

分享:

    相关文档

    相关产品