查询订单-j9九游会登录
功能介绍
云商店商家可通过该接口查询订单所有信息。
接口调用的流程

uri
get :
https://mkt.myhuaweicloud.com/api/mkp-openapi-public/global/v1/order/query
参数说明请参见表1 响应参数。
仅支持https协议。
调测订单数据:
|
订单号 |
订单行id |
订单类型 |
|
mockperiodyearnew |
mockperiodyearnew-000001 |
新购-包周期 |
|
mockonetimenew |
mockonetimenew-000001 |
新购-按次 |
|
mockondemand |
mockondemand-000001 |
新购-按需 |
|
mockondemandpkg |
mockondemandpkg-000001 |
新购-按需套餐包 |
|
mockperioddaytrial |
mockperioddaytrial-000001 |
试用订单 |
|
mockmontytrialtoformal |
mockmontytrialtoformal-000001 |
试用转正 |
|
mockmontyunsubscribe |
mockmontyunsubscribe-000001 |
退订 |
|
mockmontyrenew |
mockmontyrenew-000001 |
续费 |
|
mockmontychange |
mockmontychange-000001 |
变更、升级 |
请求消息
请求参数
请求方法:get
|
参数 |
是否必选 |
参数类型 |
取值范围 |
描述 |
|---|---|---|---|---|
|
orderid |
m |
string |
64 |
云商店订单id |
|
orderlineid |
o |
string |
64 |
云商店订单行id |
请求注意事项:
- 需要对mkt.myhuaweicloud.com https证书进行强校验,不能忽略证书校验,从而保证调用的是真实而非伪造的云商店服务。
请求示例
get /api/mkp-openapi-public/global/v1/order/query?orderid=cs2207261447auy4h&orderlineid=cs2207261447auy4h-000001 host: host server content-type: application/json charset=utf-8 x-sdk-date: request time authorization: authorization
响应消息
|
参数 |
是否必选 |
参数类型 |
取值范围 |
描述 |
|---|---|---|---|---|
|
resultcode |
m |
string |
16 |
结果码。 具体请参考错误码。 |
|
resultmsg |
m |
string |
1024 |
结果消息。 具体请参考错误码。 |
|
orderinfo |
o |
orderinfo |
/ |
附加信息。 orderinfo数据结构定义 |
orderinfo数据结构定义如下:
|
参数 |
是否必选 |
参数类型 |
最大字符长度 |
说明 |
|---|---|---|---|---|
|
orderid |
m |
string |
64 |
云商店订单号 |
|
ordertype |
m |
string |
32 |
订单类型,可用枚举:
|
|
createtime |
m |
datetime |
20 |
订单创建时间,取utc时间。 格式:yyyymmddhhmmss
说明:
不是订单生效时间,只表示用户下单的时间。 |
|
orderline |
list |
订单行信息 |
||
|
buyerinfo |
o |
buyerinfo |
/ |
客户信息 |
orderline数据结构定义如下:
|
参数 |
是否必选 |
参数类型 |
最大字符长度 |
说明 |
|---|---|---|---|---|
|
orderlineid |
m |
string |
64 |
云商店订单行id |
|
chargingmode |
m |
string |
25 |
计费模式。 on_demand:按需计费 one_time:一次性计费 period:包周期计费 on_demand_pkg:按需套餐包。 |
|
expiretime |
o |
datetime |
20 |
过期时间,取utc时间。 格式:yyyymmddhhmmss
说明:
过期时间根据订单创建时间和购买周期计算而来,与订单实际过期时间有误差,仅供参考。 |
|
periodtype |
o |
string |
2 |
周期类型。
说明:
非必传,如需此参数,计费类型需选择包周期chargingmode= period,包周期购买场景请求时传该参数。 年:"year" 月:"month" 天:“day”//试用场景 |
|
extendparams |
o |
list |
/ |
扩展参数。非必填。 扩展参数格式为key/value格式的数组。 例如:[{"name":"emaildomainname","value":"test.xxxx.com"},{"name":"ip","value":"192.168.1.1"}] 其中emaildomainname和ip为发布商品时填写值。 |
|
periodnumber |
o |
integer |
5 |
周期数量。
说明:
非必传,如需此参数,计费类型需选择包周期chargingmode= period,包周期购买场景请求时传该参数。 周期数量:1,2,3… |
|
currency |
o |
string |
64 |
订单金额,新购、续费、变更等正向场景下金额为正,退订、退续费等逆向场景金额为空 |
|
currencyafterdiscount |
o |
string |
25 |
订单成交金额,不包含代金券以及折扣的金额,新购、续费、变更等正向场景下金额为正,退订、退续费等逆向场景金额为负 |
|
productinfo |
m |
list |
订单行关联的商品信息 |
productinfo数据结构定义如下:
|
参数 |
是否必选 |
参数类型 |
最大字符长度 |
说明 |
|---|---|---|---|---|
|
productid |
m |
string |
64 |
产品标识,同一skucode下,不同周期类型的productid不同。 例如:商家发布产品,新增一个规格,会生成一个skucode,再配置包年价格,包月价格,会生成两个productid。
说明:
该参数可在商品审核上架后,进入“卖家中心 > 商品管理 > 我的商品 ”页面,单击该商品操作列的“详情”进入商品详情页面获取。 |
|
skucode |
m |
string |
64 |
产品规格标识。租户购买包月或包年的产品后,可能会续费,续费支持变更周期类型(例如包月转包年),此时,租户开通的实例instanceid对应的productid会变化,但skucode不变。
说明:
该参数可在商品审核上架后,进入“卖家中心 > 商品管理 > 我的商品 ”页面,单击该商品操作列的“详情”进入商品详情页面获取。 |
|
linearvalue |
o |
integer |
线性单位值,如果当前商品存在数量属性,用户在下单时选择的线性数值 |
|
|
productname |
m |
string |
64 |
商品名称 |
extendparam数据结构定义如下:
|
参数 |
是否必选 |
参数类型 |
最大字符长度 |
说明 |
|---|---|---|---|---|
|
name |
m |
string |
64 |
参数名 |
|
value |
m |
string |
64 |
参数的值 |
buyerinfo数据结构定义如下:
|
参数 |
是否必选 |
参数类型 |
最大字符长度 |
说明 |
|---|---|---|---|---|
|
customerid |
m |
string |
64 |
客户id |
|
customername |
m |
string |
64 |
客户账号名//如:zhangsan |
|
customerrealname |
m |
string |
64 |
客户真实名称//如:xxxxx公司 |
|
customertype |
m |
integer |
64 |
未知:-1,个人:0,企业:1 |
|
mobilephone |
o |
string |
64 |
用户手机号//商品发布时需要勾选授权 |
|
|
o |
string |
64 |
用户邮箱//商品发布时需要勾选授权 |
|
userid |
o |
string |
64 |
iam用户id//商品发布时需要勾选授权,并且只在新购场景(创建实例)返回 注意:自2025.10.25日起,新增saas资产不再支持接口传递华为云iam子账号信息,存量的saas资产不受影响。 |
|
username |
o |
string |
64 |
iam用户名称//商品发布时需要勾选授权,并且只在新购场景(创建实例)返回 注意:自2025.10.25日起,新增saas资产不再支持接口传递华为云iam子账号信息,存量的saas资产不受影响。 |
错误码
|
http状态码 |
resultcode |
resultmsg |
描述 |
|---|---|---|---|
|
200 |
mkt.0000 |
success. |
请求成功 |
|
500 |
mkt.0999 |
system internal error. |
其它服务内部错误 |
|
500 |
mkt.0100 |
failure of input parameter |
输入参数校验失败 参数范围超限,非法值或格式错误 |
|
400 |
mkt.0101 |
invalid parameter |
参数无效 输入非接口定义的参数,多参数或少必选参数 |
|
400 |
mkt.0199 |
request parameter error |
请求参数错误 其它参数错误 |
|
401 |
mkt.0150 |
illegal operation |
通常是进行了不被授权的操作,例如instanceid对应的产品不是ak/sk对应的商家发布的 |
|
401 |
mkt.0151 |
no authority |
无api访问权限 token非商家角色 |
|
401 |
mkt.0154 |
illegal token |
鉴权失败 token无效 |
|
406 |
mkt. 0250 |
access frequency overlimit |
访问频率超限 |
|
500 |
mkt.9001 |
instance id not found. |
实例id不存在(商品续费、过期、资源释放接口可能返回) |
|
500 |
mkt.9002 |
invalid usage enties. |
计量实体无效 |
|
500 |
mkt.9003 |
usage records extends size limit. |
计量记录数超出限制(100条) |
|
500 |
mkt.9004 |
record begintime extends limit. |
计量记录的起始时间超出有效期(当前时间21天以内) |
|
400 |
95000001 |
req param is invalid |
请求参数错误(正则、必填项、长度等不满足) |
|
405 |
95000002 |
request method not supported |
请求method类型不支持 |
|
415 |
95000003 |
content type not supported |
请求体类型不支持(content-type不是application/json) |
|
400 |
95000004 |
req message is not readable |
请求体不可读(无法格式化成json) |
|
500 |
mkt.9005 |
order is not exist. |
请求的订单不存在 |
其中,仅在resultcode为mkt.0100、mkt.0150、mkt.0250、mkt.9001、mkt.9002、mkt.9004、mkt.9005时,失败响应中包含extra_info字段。失败响应中resultmsg除字段描述,还包含响应失败详情。您可以结合失败详情和extra_info内容定位并解决问题。
成功响应示例
http/1.1 200 ok
content-type: application/json;charset=utf-8
content-length: length
date: response time
{
"resultcode": "mkt.0000",
"resultmsg": "success",
"orderinfo": {
"orderid": "cs2207261447auy4h",
"ordertype": "new",
"createtime": "20220726064736",
"orderline": [
{
"orderlineid": "cs2207261447auy4h-000001",
"chargingmode": "period",
"periodtype": "year",
"periodnumber": 1,
"expiretime": "20230726155959",
"productinfo": [
{
"productid": "offi758576253042421760",
"skucode": "da9b4d34-ee8a-4355-a823-13e034e49986",
"linearvalue": 10,
"productname": "saas测试商品,测试规格,基础版,包周期"
}
],
"extendparams": []
}
],
"buyerinfo": {
"mobilephone": "18699999999",
"email": "123@test.com",
"customerid": "688055390f3049f283fe9f1aa90f7ds3",
"customername": "koogallery"
}
}
}
失败响应示例
http/1.1 401 unauthorizedcontent-type: application/json;charset=utf-8content-length: lengthdate: response time {
"resultcode": "cbc.0150",
"resultmsg": "illegal operation. param[isvid] and param[instanceid] does not match." }
相关文档
意见反馈
文档内容是否对您有帮助?
如您有其它疑问,您也可以通过华为云社区问答频道来与我们联系探讨