询价
接口描述
请求路径:https://open.didiyunapi.com/dicloud/w/checkPrice
请求方法:POST
输入参数
参数名称 |
必选 |
类型 |
描述 |
regionId |
是 |
string |
地域id |
resourceType |
是 |
string |
要购买的商品类型,如表CheckPriceParams所示 |
isChange |
是 |
bool |
是否是更改规格操作 |
checkCoupon |
否 |
bool |
询价同时是否匹配最符合的优惠券 |
goods |
是 |
object |
要购买的商品的输入参数,如表CheckPriceParams所示 |
CheckPriceParams:
输出参数
参数名称 |
类型 |
描述 |
errno |
int |
错误码 |
errmsg |
string |
请求错误说明 |
requestId |
string |
请求唯一标识 |
data |
CheckPriceResponse |
请求返回数据 |
CheckPriceResponse:
参数名称 |
类型 |
描述 |
bestCouponId |
string |
最匹配的优惠券id,可在操作中传入 |
cashBalance |
int64 |
现金余额,单位为分(人民币) |
couponBalance |
int64 |
优惠券余额,单位为分 |
frozenPrice |
int64 |
当前冻结金额,单位为分 |
isClearToCreate |
bool |
余额是否足够一次创建 |
originPrice |
int64 |
原价格,单位为分 |
payType |
string |
付费方式,"postPaid"为后付费,"prepPaid"为先付费 |
postPaidPrice |
int64 |
后付费部分的价格,单位为分 |
prePaidPrice |
int64 |
先付费部分的价格,单位为分 |
subPrice |
int64 |
当余额不足时,表示还差多少钱可以创建此资源 |
resourceEnquiryItem |
ResourceEnquiryItem 列表 |
分资源的询价结果 |
ResourceEnquiryItem:
参数名称 |
类型 |
描述 |
originPrice |
int64 |
原价格 ,单位为分(人民币) |
postPaidPrice |
int64 |
后付费部分的价格,单位为分 |
prePaidPrice |
int64 |
先付费部分的价格,单位为分 |
resourceType |
string |
产品类型 |
subResourceType |
string |
子产品类型 |
错误码
示例
请求:
curl -X POST \
https://open.didiyunapi.com/dicloud/w/checkPrice \
-H 'authorization: Bearer 9a609744ad675e8fbfcdbf14511b24e6ddd6b427b4d256969534a81d0773f4d7' \
-H 'content-type: application/json' \
-d '{
"regionId":"gz",
"resourceType":"dc2",
"isChange":false,
"goods":{
"payPeriod":2,
"dc2Model":"dc2.s1.small1.d20",
"eip":{
"bandwidth":1
}
}
}'
输出:
{
"errno": 0,
"errmsg": "ok",
"data": {
"bestCouponId": "",
"cashBalance": 333300,
"couponBalance": 1823921,
"frozenPrice": 0,
"isClearToCreate": true,
"originPrice": 9200,
"payType": "prePaid",
"postPaidPrice": 0,
"prePaidPrice": 9200,
"subPrice": 0,
"resourceEnquiryItem":[{
"originPrice": 5600,
"postPaidPrice": 0,
"prePaidPrice": 5600,
"resourceType": "dc2",
"subResourceType": "dc2.ssd"
},
{
"originPrice": 3600,
"postPaidPrice": 0,
"prePaidPrice": 3600,
"resourceType": "eip",
"subResourceType": "eip"
}]
},
"requestId": "0a60538a5bd03e8f6fdc1926f3dba9b0"
}